Skip to content

Commit b79e783

Browse files
author
SDKAuto
committed
CodeGen from PR 17175 in Azure/azure-rest-api-specs
Merge dec52e351fb8a07d94fb38512aa66d4b8860e346 into 698ebc7
1 parent 6c50bbe commit b79e783

File tree

522 files changed

+553132
-324633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+553132
-324633
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/[email protected].2"
4+
"@autorest/python@5.12.0",
5+
"@autorest/[email protected].3"
66
],
7-
"commit": "ec2b6d1985ce89c8646276e0806a738338e98bd2",
7+
"commit": "ca17b2ba463d78aae5ec67d1bd73abc3978f0e1b",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"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/[email protected].2 --version=3.4.5",
9+
"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.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
1010
"readme": "specification/web/resource-manager/readme.md"
1111
}

sdk/appservice/azure-mgmt-web/azure/mgmt/web/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

@@ -68,4 +68,4 @@ def _configure(
6868
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6969
self.authentication_policy = kwargs.get('authentication_policy')
7070
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
71+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py

Lines changed: 36 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@
1010
# --------------------------------------------------------------------------
1111
from msrest import Serializer, Deserializer
1212
from typing import TYPE_CHECKING
13-
import warnings
14-
15-
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
16-
from azure.core.paging import ItemPaged
17-
from azure.core.pipeline import PipelineResponse
18-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
19-
from azure.mgmt.core.exceptions import ARMErrorFormat
2013

2114
if TYPE_CHECKING:
2215
# pylint: disable=unused-import,ungrouped-imports
23-
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
16+
from typing import Any, Iterable, Optional, Union
17+
18+
from azure.core.paging import ItemPaged
2419

2520

2621
class WebSiteManagementClientOperationsMixin(object):
@@ -32,6 +27,7 @@ def check_name_availability(
3227
is_fqdn=None, # type: Optional[bool]
3328
**kwargs # type: Any
3429
):
30+
# type: (...) -> "_models.ResourceNameAvailability"
3531
"""Check if a resource name is available.
3632
3733
Description for Check if a resource name is available.
@@ -76,50 +72,11 @@ def check_name_availability(
7672
mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
7773
return mixin_instance.check_name_availability(name, type, is_fqdn, **kwargs)
7874

79-
def generate_github_access_token_for_appservice_cli_async(
80-
self,
81-
code, # type: str
82-
state, # type: str
83-
**kwargs # type: Any
84-
):
85-
"""Exchange code for GitHub access token for AppService CLI.
86-
87-
Description for Exchange code for GitHub access token for AppService CLI.
88-
89-
:param code: Code string to exchange for Github Access token.
90-
:type code: str
91-
:param state: State string used for verification.
92-
:type state: str
93-
:keyword callable cls: A custom type or function that will be passed the direct response
94-
:return: AppserviceGithubToken, or the result of cls(response)
95-
:rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken
96-
:raises: ~azure.core.exceptions.HttpResponseError
97-
"""
98-
api_version = self._get_api_version('generate_github_access_token_for_appservice_cli_async')
99-
if api_version == '2020-09-01':
100-
from .v2020_09_01.operations import WebSiteManagementClientOperationsMixin as OperationClass
101-
elif api_version == '2020-12-01':
102-
from .v2020_12_01.operations import WebSiteManagementClientOperationsMixin as OperationClass
103-
elif api_version == '2021-01-01':
104-
from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass
105-
elif api_version == '2021-01-15':
106-
from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass
107-
elif api_version == '2021-02-01':
108-
from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass
109-
else:
110-
raise ValueError("API version {} does not have operation 'generate_github_access_token_for_appservice_cli_async'".format(api_version))
111-
mixin_instance = OperationClass()
112-
mixin_instance._client = self._client
113-
mixin_instance._config = self._config
114-
mixin_instance._serialize = Serializer(self._models_dict(api_version))
115-
mixin_instance._serialize.client_side_validation = False
116-
mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
117-
return mixin_instance.generate_github_access_token_for_appservice_cli_async(code, state, **kwargs)
118-
11975
def get_publishing_user(
12076
self,
12177
**kwargs # type: Any
12278
):
79+
# type: (...) -> "_models.User"
12380
"""Gets publishing user.
12481
12582
Description for Gets publishing user.
@@ -163,6 +120,7 @@ def get_source_control(
163120
source_control_type, # type: str
164121
**kwargs # type: Any
165122
):
123+
# type: (...) -> "_models.SourceControl"
166124
"""Gets source control token.
167125
168126
Description for Gets source control token.
@@ -207,6 +165,7 @@ def get_subscription_deployment_locations(
207165
self,
208166
**kwargs # type: Any
209167
):
168+
# type: (...) -> "_models.DeploymentLocations"
210169
"""Gets list of available geo regions plus ministamps.
211170
212171
Description for Gets list of available geo regions plus ministamps.
@@ -251,6 +210,7 @@ def list_billing_meters(
251210
os_type=None, # type: Optional[str]
252211
**kwargs # type: Any
253212
):
213+
# type: (...) -> Iterable["_models.BillingMeterCollection"]
254214
"""Gets a list of meters for a given location.
255215
256216
Description for Gets a list of meters for a given location.
@@ -260,7 +220,8 @@ def list_billing_meters(
260220
:param os_type: App Service OS type meters used for.
261221
:type os_type: str
262222
:keyword callable cls: A custom type or function that will be passed the direct response
263-
:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)
223+
:return: An iterator like instance of either BillingMeterCollection or the result of
224+
cls(response)
264225
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection]
265226
:raises: ~azure.core.exceptions.HttpResponseError
266227
"""
@@ -299,6 +260,7 @@ def list_geo_regions(
299260
linux_dynamic_workers_enabled=None, # type: Optional[bool]
300261
**kwargs # type: Any
301262
):
263+
# type: (...) -> Iterable["_models.GeoRegionCollection"]
302264
"""Get a list of available geographical regions.
303265
304266
Description for Get a list of available geographical regions.
@@ -352,13 +314,16 @@ def list_premier_add_on_offers(
352314
self,
353315
**kwargs # type: Any
354316
):
317+
# type: (...) -> Iterable["_models.PremierAddOnOfferCollection"]
355318
"""List all premier add-on offers.
356319
357320
Description for List all premier add-on offers.
358321
359322
:keyword callable cls: A custom type or function that will be passed the direct response
360-
:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)
361-
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection]
323+
:return: An iterator like instance of either PremierAddOnOfferCollection or the result of
324+
cls(response)
325+
:rtype:
326+
~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection]
362327
:raises: ~azure.core.exceptions.HttpResponseError
363328
"""
364329
api_version = self._get_api_version('list_premier_add_on_offers')
@@ -395,14 +360,16 @@ def list_site_identifiers_assigned_to_host_name(
395360
name_identifier, # type: "_models.NameIdentifier"
396361
**kwargs # type: Any
397362
):
363+
# type: (...) -> Iterable["_models.IdentifierCollection"]
398364
"""List all apps that are assigned to a hostname.
399365
400366
Description for List all apps that are assigned to a hostname.
401367
402368
:param name_identifier: Hostname information.
403369
:type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier
404370
:keyword callable cls: A custom type or function that will be passed the direct response
405-
:return: An iterator like instance of either IdentifierCollection or the result of cls(response)
371+
:return: An iterator like instance of either IdentifierCollection or the result of
372+
cls(response)
406373
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection]
407374
:raises: ~azure.core.exceptions.HttpResponseError
408375
"""
@@ -439,6 +406,7 @@ def list_skus(
439406
self,
440407
**kwargs # type: Any
441408
):
409+
# type: (...) -> "_models.SkuInfos"
442410
"""List all SKUs.
443411
444412
Description for List all SKUs.
@@ -481,13 +449,16 @@ def list_source_controls(
481449
self,
482450
**kwargs # type: Any
483451
):
452+
# type: (...) -> Iterable["_models.SourceControlCollection"]
484453
"""Gets the source controls available for Azure websites.
485454
486455
Description for Gets the source controls available for Azure websites.
487456
488457
:keyword callable cls: A custom type or function that will be passed the direct response
489-
:return: An iterator like instance of either SourceControlCollection or the result of cls(response)
490-
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection]
458+
:return: An iterator like instance of either SourceControlCollection or the result of
459+
cls(response)
460+
:rtype:
461+
~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection]
491462
:raises: ~azure.core.exceptions.HttpResponseError
492463
"""
493464
api_version = self._get_api_version('list_source_controls')
@@ -525,6 +496,7 @@ def move(
525496
move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope"
526497
**kwargs # type: Any
527498
):
499+
# type: (...) -> None
528500
"""Move resources between resource groups.
529501
530502
Description for Move resources between resource groups.
@@ -572,6 +544,7 @@ def update_publishing_user(
572544
user_details, # type: "_models.User"
573545
**kwargs # type: Any
574546
):
547+
# type: (...) -> "_models.User"
575548
"""Updates publishing user.
576549
577550
Description for Updates publishing user.
@@ -618,6 +591,7 @@ def update_source_control(
618591
request_message, # type: "_models.SourceControl"
619592
**kwargs # type: Any
620593
):
594+
# type: (...) -> "_models.SourceControl"
621595
"""Updates source control token.
622596
623597
Description for Updates source control token.
@@ -666,6 +640,7 @@ def validate(
666640
validate_request, # type: "_models.ValidateRequest"
667641
**kwargs # type: Any
668642
):
643+
# type: (...) -> "_models.ValidateResponse"
669644
"""Validate if a resource can be created.
670645
671646
Description for Validate if a resource can be created.
@@ -714,14 +689,16 @@ def validate_container_settings(
714689
validate_container_settings_request, # type: "_models.ValidateContainerSettingsRequest"
715690
**kwargs # type: Any
716691
):
692+
# type: (...) -> Any
717693
"""Validate if the container settings are correct.
718694
719695
Validate if the container settings are correct.
720696
721697
:param resource_group_name: Name of the resource group to which the resource belongs.
722698
:type resource_group_name: str
723699
:param validate_container_settings_request:
724-
:type validate_container_settings_request: ~azure.mgmt.web.v2018_02_01.models.ValidateContainerSettingsRequest
700+
:type validate_container_settings_request:
701+
~azure.mgmt.web.v2018_02_01.models.ValidateContainerSettingsRequest
725702
:keyword callable cls: A custom type or function that will be passed the direct response
726703
:return: any, or the result of cls(response)
727704
:rtype: any
@@ -746,6 +723,7 @@ def validate_move(
746723
move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope"
747724
**kwargs # type: Any
748725
):
726+
# type: (...) -> None
749727
"""Validate whether a resource can be moved.
750728
751729
Description for Validate whether a resource can be moved.
@@ -793,7 +771,9 @@ def verify_hosting_environment_vnet(
793771
parameters, # type: "_models.VnetParameters"
794772
**kwargs # type: Any
795773
):
796-
"""Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.
774+
# type: (...) -> "_models.VnetValidationFailureDetails"
775+
"""Verifies if this VNET is compatible with an App Service Environment by analyzing the Network
776+
Security Group rules.
797777
798778
Description for Verifies if this VNET is compatible with an App Service Environment by
799779
analyzing the Network Security Group rules.

sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from typing import Any, Optional
2525

2626
from azure.core.credentials import TokenCredential
27-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
2827

2928
class _SDKClient(object):
3029
def __init__(self, *args, **kwargs):
@@ -73,12 +72,10 @@ def __init__(
7372
credential, # type: "TokenCredential"
7473
subscription_id, # type: str
7574
api_version=None, # type: Optional[str]
76-
base_url=None, # type: Optional[str]
75+
base_url="https://management.azure.com", # type: str
7776
profile=KnownProfiles.default, # type: KnownProfiles
7877
**kwargs # type: Any
7978
):
80-
if not base_url:
81-
base_url = 'https://management.azure.com'
8279
self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs)
8380
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
8481
super(WebSiteManagementClient, self).__init__(
@@ -525,15 +522,15 @@ def domains(self):
525522
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
526523

527524
@property
528-
def global_model(self):
525+
def global_operations(self):
529526
"""Instance depends on the API version:
530527
531528
* 2020-12-01: :class:`GlobalOperations<azure.mgmt.web.v2020_12_01.operations.GlobalOperations>`
532529
* 2021-01-01: :class:`GlobalOperations<azure.mgmt.web.v2021_01_01.operations.GlobalOperations>`
533530
* 2021-01-15: :class:`GlobalOperations<azure.mgmt.web.v2021_01_15.operations.GlobalOperations>`
534531
* 2021-02-01: :class:`GlobalOperations<azure.mgmt.web.v2021_02_01.operations.GlobalOperations>`
535532
"""
536-
api_version = self._get_api_version('global_model')
533+
api_version = self._get_api_version('global_operations')
537534
if api_version == '2020-12-01':
538535
from .v2020_12_01.operations import GlobalOperations as OperationClass
539536
elif api_version == '2021-01-01':
@@ -543,7 +540,7 @@ def global_model(self):
543540
elif api_version == '2021-02-01':
544541
from .v2021_02_01.operations import GlobalOperations as OperationClass
545542
else:
546-
raise ValueError("API version {} does not have operation group 'global_model'".format(api_version))
543+
raise ValueError("API version {} does not have operation group 'global_operations'".format(api_version))
547544
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
548545

549546
@property

sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
1616

1717
from .._version import VERSION
1818

@@ -64,4 +64,4 @@ def _configure(
6464
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
6565
self.authentication_policy = kwargs.get('authentication_policy')
6666
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)