Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-apimanagement] APIM - Network Watcher Connectivity Check integration specs #6375

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/apimanagement/azure-mgmt-apimanagement/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
11 changes: 11 additions & 0 deletions sdk/apimanagement/azure-mgmt-apimanagement/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.5",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "3c097280ac78f67c74995dcbba991ab09331469a",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/apimanagement/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",
"readme": "specification/apimanagement/resource-manager/readme.md"
}
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 ApiManagementClientConfiguration
from .operations import ApiOperations
Expand Down Expand Up @@ -62,6 +63,7 @@
from .operations import NotificationRecipientUserOperations
from .operations import NotificationRecipientEmailOperations
from .operations import OpenIdConnectProviderOperations
from .operations import OutboundNetworkDependenciesEndpointsOperations
from .operations import PolicyOperations
from .operations import PolicyDescriptionOperations
from .operations import PortalRevisionOperations
Expand Down Expand Up @@ -90,10 +92,11 @@
from .operations import UserSubscriptionOperations
from .operations import UserIdentitiesOperations
from .operations import UserConfirmationPasswordOperations
from .operations import ApiManagementClientOperationsMixin
from . import models


class ApiManagementClient(object):
class ApiManagementClient(ApiManagementClientOperationsMixin):
"""ApiManagement Client.

:ivar api: ApiOperations operations
Expand Down Expand Up @@ -184,6 +187,8 @@ class ApiManagementClient(object):
:vartype notification_recipient_email: azure.mgmt.apimanagement.operations.NotificationRecipientEmailOperations
:ivar open_id_connect_provider: OpenIdConnectProviderOperations operations
:vartype open_id_connect_provider: azure.mgmt.apimanagement.operations.OpenIdConnectProviderOperations
:ivar outbound_network_dependencies_endpoints: OutboundNetworkDependenciesEndpointsOperations operations
:vartype outbound_network_dependencies_endpoints: azure.mgmt.apimanagement.operations.OutboundNetworkDependenciesEndpointsOperations
:ivar policy: PolicyOperations operations
:vartype policy: azure.mgmt.apimanagement.operations.PolicyOperations
:ivar policy_description: PolicyDescriptionOperations operations
Expand Down Expand Up @@ -354,6 +359,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.open_id_connect_provider = OpenIdConnectProviderOperations(
self._client, self._config, self._serialize, self._deserialize)
self.outbound_network_dependencies_endpoints = OutboundNetworkDependenciesEndpointsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.policy = PolicyOperations(
self._client, self._config, self._serialize, self._deserialize)
self.policy_description = PolicyDescriptionOperations(
Expand Down Expand Up @@ -411,6 +418,24 @@ def __init__(
self.user_confirmation_password = UserConfirmationPasswordOperations(
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 @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-04-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.0.0"
VERSION = "0.1.0"
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 @@ -60,6 +61,7 @@
from .operations import NotificationRecipientUserOperations
from .operations import NotificationRecipientEmailOperations
from .operations import OpenIdConnectProviderOperations
from .operations import OutboundNetworkDependenciesEndpointsOperations
from .operations import PolicyOperations
from .operations import PolicyDescriptionOperations
from .operations import PortalRevisionOperations
Expand Down Expand Up @@ -88,10 +90,11 @@
from .operations import UserSubscriptionOperations
from .operations import UserIdentitiesOperations
from .operations import UserConfirmationPasswordOperations
from .operations import ApiManagementClientOperationsMixin
from .. import models


class ApiManagementClient(object):
class ApiManagementClient(ApiManagementClientOperationsMixin):
"""ApiManagement Client.

:ivar api: ApiOperations operations
Expand Down Expand Up @@ -182,6 +185,8 @@ class ApiManagementClient(object):
:vartype notification_recipient_email: azure.mgmt.apimanagement.aio.operations.NotificationRecipientEmailOperations
:ivar open_id_connect_provider: OpenIdConnectProviderOperations operations
:vartype open_id_connect_provider: azure.mgmt.apimanagement.aio.operations.OpenIdConnectProviderOperations
:ivar outbound_network_dependencies_endpoints: OutboundNetworkDependenciesEndpointsOperations operations
:vartype outbound_network_dependencies_endpoints: azure.mgmt.apimanagement.aio.operations.OutboundNetworkDependenciesEndpointsOperations
:ivar policy: PolicyOperations operations
:vartype policy: azure.mgmt.apimanagement.aio.operations.PolicyOperations
:ivar policy_description: PolicyDescriptionOperations operations
Expand Down Expand Up @@ -351,6 +356,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.open_id_connect_provider = OpenIdConnectProviderOperations(
self._client, self._config, self._serialize, self._deserialize)
self.outbound_network_dependencies_endpoints = OutboundNetworkDependenciesEndpointsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.policy = PolicyOperations(
self._client, self._config, self._serialize, self._deserialize)
self.policy_description = PolicyDescriptionOperations(
Expand Down Expand Up @@ -408,6 +415,23 @@ def __init__(
self.user_confirmation_password = UserConfirmationPasswordOperations(
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 @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-04-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from ._notification_recipient_user_operations import NotificationRecipientUserOperations
from ._notification_recipient_email_operations import NotificationRecipientEmailOperations
from ._open_id_connect_provider_operations import OpenIdConnectProviderOperations
from ._outbound_network_dependencies_endpoints_operations import OutboundNetworkDependenciesEndpointsOperations
from ._policy_operations import PolicyOperations
from ._policy_description_operations import PolicyDescriptionOperations
from ._portal_revision_operations import PortalRevisionOperations
Expand Down Expand Up @@ -78,6 +79,7 @@
from ._user_subscription_operations import UserSubscriptionOperations
from ._user_identities_operations import UserIdentitiesOperations
from ._user_confirmation_password_operations import UserConfirmationPasswordOperations
from ._api_management_client_operations import ApiManagementClientOperationsMixin

__all__ = [
'ApiOperations',
Expand Down Expand Up @@ -124,6 +126,7 @@
'NotificationRecipientUserOperations',
'NotificationRecipientEmailOperations',
'OpenIdConnectProviderOperations',
'OutboundNetworkDependenciesEndpointsOperations',
'PolicyOperations',
'PolicyDescriptionOperations',
'PortalRevisionOperations',
Expand Down Expand Up @@ -152,4 +155,5 @@
'UserSubscriptionOperations',
'UserIdentitiesOperations',
'UserConfirmationPasswordOperations',
'ApiManagementClientOperationsMixin',
]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def list_by_service(
filter: Optional[str] = None,
top: Optional[int] = None,
skip: Optional[int] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.DiagnosticCollection"]:
"""Lists all diagnostics of an API.

Expand Down Expand Up @@ -77,7 +77,7 @@ def list_by_service(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-12-01"
api_version = "2021-04-01-preview"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -126,7 +126,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -143,7 +143,7 @@ async def get_entity_tag(
service_name: str,
api_id: str,
diagnostic_id: str,
**kwargs
**kwargs: Any
) -> bool:
"""Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier.

Expand All @@ -166,7 +166,7 @@ async def get_entity_tag(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-12-01"
api_version = "2021-04-01-preview"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -194,7 +194,7 @@ async def get_entity_tag(

if response.status_code not in [200]:
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)

response_headers = {}
Expand All @@ -212,7 +212,7 @@ async def get(
service_name: str,
api_id: str,
diagnostic_id: str,
**kwargs
**kwargs: Any
) -> "_models.DiagnosticContract":
"""Gets the details of the Diagnostic for an API specified by its identifier.

Expand All @@ -235,7 +235,7 @@ async def get(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-12-01"
api_version = "2021-04-01-preview"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -263,7 +263,7 @@ async def get(

if response.status_code not in [200]:
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)

response_headers = {}
Expand All @@ -284,7 +284,7 @@ async def create_or_update(
diagnostic_id: str,
parameters: "_models.DiagnosticContract",
if_match: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.DiagnosticContract":
"""Creates a new Diagnostic for an API or updates an existing one.

Expand Down Expand Up @@ -312,7 +312,7 @@ async def create_or_update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-12-01"
api_version = "2021-04-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -347,7 +347,7 @@ async def create_or_update(

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

response_headers = {}
Expand All @@ -373,7 +373,7 @@ async def update(
diagnostic_id: str,
if_match: str,
parameters: "_models.DiagnosticContract",
**kwargs
**kwargs: Any
) -> "_models.DiagnosticContract":
"""Updates the details of the Diagnostic for an API specified by its identifier.

Expand Down Expand Up @@ -401,7 +401,7 @@ async def update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-12-01"
api_version = "2021-04-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -435,7 +435,7 @@ async def update(

if response.status_code not in [200]:
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)

response_headers = {}
Expand All @@ -455,7 +455,7 @@ async def delete(
api_id: str,
diagnostic_id: str,
if_match: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the specified Diagnostic from an API.

Expand All @@ -481,7 +481,7 @@ async def delete(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-12-01"
api_version = "2021-04-01-preview"
accept = "application/json"

# Construct URL
Expand Down Expand Up @@ -510,7 +510,7 @@ async def delete(

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

if cls:
Expand Down
Loading