Skip to content

Commit

Permalink
CodeGen from PR 16506 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Web ant95 2021 03 01 (Azure#16506)

* Adds base for updating Microsoft.Web from version stable/2021-02-01 to version 2021-03-01

* Updates readme

* Updates API version in new specs and examples

* Re-add Microsoft.CertificateRegistration and Microsoft.DomainRegistration APIs since they do not get pulled in by OpenApiHub (Azure#15917)

* Introduce enterpriseGradeCdnStatus to StaticSites.json (Azure#16080)

* Update StaticSites.json

* Update StaticSites.json

* Onedeploy API swapper spec (Azure#15985)

* Onedeploy API swapper spec

* Adding onedeploy custom keyword

* Formatting onedeploy api indentation

Formatting onedeploy api indentation

* prettifier

Co-authored-by: Calvin Chan <calvinch4n@gmail.com>

* Fix status codes for syncfunctiontriggers (Azure#16413)

* Add GET endpoint at /config/authsettingsv2 for Microsoft.Web (Azure#16427)

* Add GET endpoint at /config/authsettingsv2 for Microsoft.Web

* Fix duplicate operation ids

* Swagger for ASD Transfer out (Azure#16000)

* Add domain transfer out to swagger

* Prettifier

* Add 202 response for webapp restart

* Add certificate listHostnameBindingsOfCertificate

* Formatting

* Swagger for listHostnameBindings endpoint (Azure#16516)

* Swagger for listHostnameBindings endpoint

* Re-add Microsoft.CertificateRegistration and Microsoft.DomainRegistration APIs since they do not get pulled in by OpenApiHub (Azure#15917)

* ops

Co-authored-by: Naveed Aziz <naveeda@microsoft.com>

* User/jennylaw/containerapp (Azure#16657)

* Pre-Prettier-commit

* Adding missing file

* Prettier fixes

* Add missing definitions

* Fix intendation in readme.md

* add suppressions

* Add custom hostname sites endpoint (Azure#16745)

* Add custom hostname sites endpoint

* Fix models

* Swagger Fixes for Container App, KubeEnvironments spec (Azure#16793)

* Pre-Prettier-commit

* Adding missing file

* Prettier fixes

* Add missing definitions

* Fix intendation in readme.md

* add suppressions

* Fix Kube Environments 2021-03-01 contract + add list secrets api to Container Apps Swagger

* Fix sercret read property

* Prettier fix

* Model fix

* Prettier Fix #2

Co-authored-by: Jenny Lawrance <jennylaw@microsoft.com>

* Add long running extension for restart (Azure#16791)

* Remove unused API from ANT95 swagger (Azure#16901)

* Address PR comments (Azure#17019)

* Fixing PR comments (Azure#17127)

* Remove Certificate Hostname bindings API (Azure#17204)

* Remove Certificate Hostname bindings API

* Remove examples file as well

Co-authored-by: mkarmark <mikarmar@microsoft.com>
Co-authored-by: SatishRanjan <SatishRanjan@users.noreply.github.com>
Co-authored-by: Calvin Chan <calvinch4n@gmail.com>
Co-authored-by: Connor McMahon <comcmaho@microsoft.com>
Co-authored-by: JennyLawrance <jennylaw@microsoft.com>
Co-authored-by: Sanchit Mehta <sanchit.mehta602@gmail.com>
  • Loading branch information
7 people committed Jan 6, 2022
1 parent 2344a63 commit b5d566c
Show file tree
Hide file tree
Showing 535 changed files with 519,292 additions and 498,029 deletions.
10 changes: 5 additions & 5 deletions sdk/appservice/azure-mgmt-web/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
"@autorest/python@5.12.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "ec2b6d1985ce89c8646276e0806a738338e98bd2",
"commit": "bbc623e46174253535ed0393d073741069ce9c31",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/web/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"autorest_command": "autorest specification/web/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/web/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -68,4 +68,4 @@ def _configure(
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)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
92 changes: 36 additions & 56 deletions sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@
# --------------------------------------------------------------------------
from msrest import Serializer, Deserializer
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

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
from typing import Any, Iterable, Optional, Union

from azure.core.paging import ItemPaged


class WebSiteManagementClientOperationsMixin(object):
Expand All @@ -32,6 +27,7 @@ def check_name_availability(
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.
Expand Down Expand Up @@ -76,50 +72,11 @@ 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.v2021_02_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
elif api_version == '2020-12-01':
from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass
elif api_version == '2021-01-01':
from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass
elif api_version == '2021-01-15':
from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass
elif api_version == '2021-02-01':
from .v2021_02_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
):
# type: (...) -> "_models.User"
"""Gets publishing user.
Description for Gets publishing user.
Expand Down Expand Up @@ -163,6 +120,7 @@ def get_source_control(
source_control_type, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.SourceControl"
"""Gets source control token.
Description for Gets source control token.
Expand Down Expand Up @@ -207,6 +165,7 @@ 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.
Expand Down Expand Up @@ -251,6 +210,7 @@ def list_billing_meters(
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.
Expand All @@ -260,7 +220,8 @@ def list_billing_meters(
: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)
:return: An iterator like instance of either BillingMeterCollection or the result of
cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
Expand Down Expand Up @@ -299,6 +260,7 @@ def list_geo_regions(
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.
Expand Down Expand Up @@ -352,13 +314,16 @@ 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.v2021_02_01.models.PremierAddOnOfferCollection]
:return: An iterator like instance of either PremierAddOnOfferCollection or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = self._get_api_version('list_premier_add_on_offers')
Expand Down Expand Up @@ -395,14 +360,16 @@ def list_site_identifiers_assigned_to_host_name(
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.v2021_02_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)
:return: An iterator like instance of either IdentifierCollection or the result of
cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
Expand Down Expand Up @@ -439,6 +406,7 @@ def list_skus(
self,
**kwargs # type: Any
):
# type: (...) -> "_models.SkuInfos"
"""List all SKUs.
Description for List all SKUs.
Expand Down Expand Up @@ -481,13 +449,16 @@ 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.v2021_02_01.models.SourceControlCollection]
:return: An iterator like instance of either SourceControlCollection or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = self._get_api_version('list_source_controls')
Expand Down Expand Up @@ -525,6 +496,7 @@ def move(
move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope"
**kwargs # type: Any
):
# type: (...) -> None
"""Move resources between resource groups.
Description for Move resources between resource groups.
Expand Down Expand Up @@ -572,6 +544,7 @@ def update_publishing_user(
user_details, # type: "_models.User"
**kwargs # type: Any
):
# type: (...) -> "_models.User"
"""Updates publishing user.
Description for Updates publishing user.
Expand Down Expand Up @@ -618,6 +591,7 @@ def update_source_control(
request_message, # type: "_models.SourceControl"
**kwargs # type: Any
):
# type: (...) -> "_models.SourceControl"
"""Updates source control token.
Description for Updates source control token.
Expand Down Expand Up @@ -666,6 +640,7 @@ def validate(
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.
Expand Down Expand Up @@ -714,14 +689,16 @@ def validate_container_settings(
validate_container_settings_request, # type: "_models.ValidateContainerSettingsRequest"
**kwargs # type: Any
):
# type: (...) -> Any
"""Validate if the container settings are correct.
Validate if the container settings are correct.
:param resource_group_name: Name of the resource group to which the resource belongs.
:type resource_group_name: str
:param validate_container_settings_request:
:type validate_container_settings_request: ~azure.mgmt.web.v2018_02_01.models.ValidateContainerSettingsRequest
:type validate_container_settings_request:
~azure.mgmt.web.v2018_02_01.models.ValidateContainerSettingsRequest
:keyword callable cls: A custom type or function that will be passed the direct response
:return: any, or the result of cls(response)
:rtype: any
Expand All @@ -746,6 +723,7 @@ def validate_move(
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.
Expand Down Expand Up @@ -793,7 +771,9 @@ def verify_hosting_environment_vnet(
parameters, # type: "_models.VnetParameters"
**kwargs # type: Any
):
"""Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
# 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -73,12 +72,10 @@ def __init__(
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
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)
super(WebSiteManagementClient, self).__init__(
Expand Down Expand Up @@ -525,15 +522,15 @@ def domains(self):
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def global_model(self):
def global_operations(self):
"""Instance depends on the API version:
* 2020-12-01: :class:`GlobalOperations<azure.mgmt.web.v2020_12_01.operations.GlobalOperations>`
* 2021-01-01: :class:`GlobalOperations<azure.mgmt.web.v2021_01_01.operations.GlobalOperations>`
* 2021-01-15: :class:`GlobalOperations<azure.mgmt.web.v2021_01_15.operations.GlobalOperations>`
* 2021-02-01: :class:`GlobalOperations<azure.mgmt.web.v2021_02_01.operations.GlobalOperations>`
"""
api_version = self._get_api_version('global_model')
api_version = self._get_api_version('global_operations')
if api_version == '2020-12-01':
from .v2020_12_01.operations import GlobalOperations as OperationClass
elif api_version == '2021-01-01':
Expand All @@ -543,7 +540,7 @@ def global_model(self):
elif api_version == '2021-02-01':
from .v2021_02_01.operations import GlobalOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'global_model'".format(api_version))
raise ValueError("API version {} does not have operation group 'global_operations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy

from .._version import VERSION

Expand Down Expand Up @@ -64,4 +64,4 @@ def _configure(
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)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Loading

0 comments on commit b5d566c

Please sign in to comment.