Skip to content

Commit

Permalink
CodeGen from PR 14018 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Re-add a previously erroneously removed PUT API for /networkConfig/VirtualNetwork (Azure#14018)

* Add CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck, and site-level virtualNetworkSubnetId field

* Add site-level virtualNetworkSubnetId field

* Tabs vs spaces

* Removing the new property since it's technically a 'breaking change'

* Add changes needed for correct .NET SDK generation issues. Reference PR: Azure/azure-sdk-for-net#20300

* Fix prettier issue.

* Remove breaking changes other than property order changes

* Make it pretty again

* Added new properties SiteConfig.PublicNetworkAccess and Site.virtualNetworkSubnetId to enable azure policy

* Fix prettier and spellcheck issue

* Fix spellcheck issue

* Add virtualNetworkSubnetId prperty to Site objec tmodel

Co-authored-by: Naveed Aziz <[email protected]>
  • Loading branch information
SDKAuto and naveedaz committed May 1, 2021
1 parent 7f29a2c commit 1799859
Show file tree
Hide file tree
Showing 286 changed files with 149,515 additions and 6,603 deletions.
1 change: 1 addition & 0 deletions sdk/appservice/azure-mgmt-web/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/appservice/azure-mgmt-web/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/[email protected]",
"commit": "dceaa75fe47854ad7b0fcc0c7cf38677b4bb181f",
"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/[email protected] --version=3.3.0",
"readme": "specification/web/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
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

class WebSiteManagementClientConfiguration(Configuration):
"""Configuration for WebSiteManagementClient.
Expand Down
86 changes: 60 additions & 26 deletions sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
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

from .._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

class WebSiteManagementClientConfiguration(Configuration):
"""Configuration for WebSiteManagementClient.
Expand All @@ -31,8 +34,8 @@ class WebSiteManagementClientConfiguration(Configuration):

def __init__(
self,
credential, # type: "AsyncTokenCredential"
subscription_id, # type: str
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs # type: Any
) -> None:
if credential is None:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# --------------------------------------------------------------------------
from .v2016_03_01.models import *
from .v2018_02_01.models import *
from .v2020_09_01.models import *
from .v2020_12_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# --------------------------------------------------------------------------

from ._web_site_management_client import WebSiteManagementClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['WebSiteManagementClient']

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"WebSiteManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"WebSiteManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,36 +30,76 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"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",
"signature": "subscription_id: 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"
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"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
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"domains": "DomainsOperations",
"top_level_domains": "TopLevelDomainsOperations",
"domain_registration_provider": "DomainRegistrationProviderOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "0.42.0"
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

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

from ._configuration import WebSiteManagementClientConfiguration
from .operations import DomainsOperations
Expand Down Expand Up @@ -66,6 +67,24 @@ def __init__(
self.domain_registration_provider = DomainRegistrationProviderOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand Down Expand Up @@ -63,6 +64,23 @@ def __init__(
self.domain_registration_provider = DomainRegistrationProviderOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ async def begin_create_or_update(
:type domain: ~azure.mgmt.web.v2015_04_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
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Domain or the result of cls(response)
Expand Down Expand Up @@ -845,10 +845,10 @@ async def create_or_update_ownership_identifier(
domain_ownership_identifier: "_models.DomainOwnershipIdentifier",
**kwargs
) -> "_models.DomainOwnershipIdentifier":
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifier.
Creates an ownership identifier for a domain or updates identifier details for an existing
identifer.
identifier.
:param resource_group_name: Name of the resource group to which the resource belongs.
:type resource_group_name: str
Expand Down Expand Up @@ -977,10 +977,10 @@ async def update_ownership_identifier(
domain_ownership_identifier: "_models.DomainOwnershipIdentifier",
**kwargs
) -> "_models.DomainOwnershipIdentifier":
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifier.
Creates an ownership identifier for a domain or updates identifier details for an existing
identifer.
identifier.
:param resource_group_name: Name of the resource group to which the resource belongs.
:type resource_group_name: str
Expand Down Expand Up @@ -1092,7 +1092,7 @@ async def renew(

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.ErrorResponse, response)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ class DomainControlCenterSsoRequest(msrest.serialization.Model):
: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.
:ivar post_parameter_value: Post parameter value. Client should use
'application/x-www-form-urlencoded' encoding for this value.
:vartype post_parameter_value: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ class DomainControlCenterSsoRequest(msrest.serialization.Model):
: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.
:ivar post_parameter_value: Post parameter value. Client should use
'application/x-www-form-urlencoded' encoding for this value.
:vartype post_parameter_value: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def begin_create_or_update(
:type domain: ~azure.mgmt.web.v2015_04_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
:keyword polling: Pass in True if you'd like the ARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns either Domain or the result of cls(response)
Expand Down Expand Up @@ -862,10 +862,10 @@ def create_or_update_ownership_identifier(
**kwargs # type: Any
):
# type: (...) -> "_models.DomainOwnershipIdentifier"
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifier.
Creates an ownership identifier for a domain or updates identifier details for an existing
identifer.
identifier.
:param resource_group_name: Name of the resource group to which the resource belongs.
:type resource_group_name: str
Expand Down Expand Up @@ -996,10 +996,10 @@ def update_ownership_identifier(
**kwargs # type: Any
):
# type: (...) -> "_models.DomainOwnershipIdentifier"
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
"""Creates an ownership identifier for a domain or updates identifier details for an existing identifier.
Creates an ownership identifier for a domain or updates identifier details for an existing
identifer.
identifier.
:param resource_group_name: Name of the resource group to which the resource belongs.
:type resource_group_name: str
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def renew(

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.ErrorResponse, response)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down
Loading

0 comments on commit 1799859

Please sign in to comment.