Skip to content

Commit

Permalink
CodeGen from PR 16715 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Schema resource added in REST API Spec for api-version 2021-08-01 (Azure#16715)

* Adds base for updating Microsoft.ApiManagement from version preview/2021-01-01-preview to version 2021-04-01-preview

* Updates readme

* Updates API version in new specs and examples

* Added support for GraphQL API type (Azure#14851)

* Added support for GraphQL API type

* Added missing enum value for GraphQL APIs.

* add schema definition fix from 2021-01-01-preview (Azure#14883)

Co-authored-by: Alan Feng <[email protected]>

* Vanguard: Get Outbound Network Dependency (Azure#14900)

* outbound dependency

* fix resource

* Update backup/restore API for managed identities (Azure#14973)

* Update backup/restore API for system-assigned and user-assigned identities

* Fix formatting issue

* Rename user-assigned-msi-client-id with client-id

* SystemData implemenation on API Management Control Plane (Azure#14899)

* system-data

* fix spec

* remove unreferenced file

* APIM - Network Watcher Connectivity Check integration specs (Azure#15056)

* Connectivity Check API Specs

* Fix

* Fix errors

* style fixs

* Fix 202 code

* HTTPConnect request parameters

* Fix errors

Co-authored-by: Nicolás Barrera <[email protected]>

* Parameter examples added (Azure#14836)

* platformversion (Azure#15114)

* fix update service (Azure#15478)

* HttpConnect example (Azure#15493)

* HttpConnect example

* Prettifier fix

Co-authored-by: Nicolás Barrera <[email protected]>

* Rename from SchemaContract to ApiSchemaContract

* apimschema.json added to last apim preview version

* Completing specification for Schema resource.
Fixing changes in SchemaContract.

* Value field added to Schema resource specification.

* path fixed.
Renamed from ApiSchema to Schema.
Adding suppression rule to readme.md
Custom word added for spellcheck

* Fixing PR observations.

* Added properties of difference API spec format for "SchemaDocumentProperties" (Azure#15703)

* add schema definition fix from 2021-01-01-preview

* added properties for SchemaDocumentProperties

* updated the fix

* updated fix

* [APIM]Add private endpoint connection APIs (Azure#15115)

* Add private endpoint connection apis

* add readme

* quick fixes

* fix to PE contract

* Small fixes

* small fixes

* small fixes

* Small fixes

* small fixes

* small fix

* small fixes

* small fixes

* small fixes

* Update readme.md

* fix error

* small fix

* fix format

* address comments

* small fixes

* Change to lower case

* small fixes

Co-authored-by: msyyc <[email protected]>

* Adds base for updating Microsoft.ApiManagement from version preview/2021-04-01-preview to version 2021-08-01

* Updates readme

* Updates API version in new specs and examples

* Merge main

* Modifications to Schema definition to add "description" field.
Updating examples of Schema.

* Fixing apimanagement.json

* Prettier applied in files

* Fixing PR comments

* fixing x-ms-long-running-operation.

* x-ms-long-running-operation : true in apischema.

* Removing "Resource" type from apimanagement.json

* Apimschema.json updated to point to types.json for ErrorResponse.

* Merging from 2021-04-01-preview to 2021-08-01 stable version.

* undoing change of responseBody

* Updating ErrorResponse.

* Fixing definitions merge.

* Changing definitions to fix output of examples.

* Changes in definitions

* Updating response in some examples.

* Rolling back
ApiSchema -> Schema
Schema -> GlobalSchema

* Changes to undo apimapis.json and adding prefix for Global example Schemas.

* Setting x-ms-long-running-operation-options to location.

Co-authored-by: Samir Solanki <[email protected]>
Co-authored-by: Alexander Zaslonov <[email protected]>
Co-authored-by: DreamlessA <[email protected]>
Co-authored-by: Alan Feng <[email protected]>
Co-authored-by: Jatin Sanghvi <[email protected]>
Co-authored-by: Nicolás Barrera <[email protected]>
Co-authored-by: Nicolás Barrera <[email protected]>
Co-authored-by: VitaliyKurokhtin <[email protected]>
Co-authored-by: Christian Palomares <[email protected]>
Co-authored-by: RupengLiu <[email protected]>
Co-authored-by: msyyc <[email protected]>
  • Loading branch information
12 people committed Jan 5, 2022
1 parent bc99c22 commit fec021b
Show file tree
Hide file tree
Showing 170 changed files with 43,595 additions and 36,697 deletions.
10 changes: 5 additions & 5 deletions sdk/apimanagement/azure-mgmt-apimanagement/_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/[email protected].2"
"@autorest/python@5.12.0",
"@autorest/[email protected].3"
],
"commit": "ecf0d999c9128ddfc1cac5ba52f57a5b00f94000",
"commit": "925e8285703ddd461588d8f5fbf14bd97c286fab",
"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/[email protected].2 --version=3.4.5",
"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 --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
"readme": "specification/apimanagement/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
__version__ = VERSION
__all__ = ['ApiManagementClient']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()

Large diffs are not rendered by default.

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

from typing import TYPE_CHECKING
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 azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential


Expand All @@ -35,20 +33,19 @@ class ApiManagementClientConfiguration(Configuration):

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
super(ApiManagementClientConfiguration, self).__init__(**kwargs)
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(ApiManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01"
self.api_version = "2021-08-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION))
self._configure(**kwargs)
Expand All @@ -68,4 +65,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)
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"chosen_version": "2020-12-01",
"total_api_version_list": ["2020-12-01"],
"chosen_version": "2021-08-01",
"total_api_version_list": ["2021-08-01"],
"client": {
"name": "ApiManagementClient",
"filename": "_api_management_client",
"description": "ApiManagement Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_lro_operations": true,
"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\": [\"ApiManagementClientConfiguration\"]}}, \"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\": [\"ApiManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
"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\": [\"ApiManagementClientConfiguration\"], \"._operations_mixin\": [\"ApiManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApiManagementClientConfiguration\"], \"._operations_mixin\": [\"ApiManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"signature": "base_url=\"https://management.azure.com\", # type: str",
"description": "Service URL",
"docstring_type": "str",
"required": false
Expand All @@ -74,7 +74,7 @@
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
Expand All @@ -91,11 +91,10 @@
"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,
"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\"]}}}"
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"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\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"api": "ApiOperations",
Expand Down Expand Up @@ -142,13 +141,15 @@
"notification_recipient_user": "NotificationRecipientUserOperations",
"notification_recipient_email": "NotificationRecipientEmailOperations",
"open_id_connect_provider": "OpenIdConnectProviderOperations",
"outbound_network_dependencies_endpoints": "OutboundNetworkDependenciesEndpointsOperations",
"policy": "PolicyOperations",
"policy_description": "PolicyDescriptionOperations",
"portal_revision": "PortalRevisionOperations",
"portal_settings": "PortalSettingsOperations",
"sign_in_settings": "SignInSettingsOperations",
"sign_up_settings": "SignUpSettingsOperations",
"delegation_settings": "DelegationSettingsOperations",
"private_endpoint_connection": "PrivateEndpointConnectionOperations",
"product": "ProductOperations",
"product_api": "ProductApiOperations",
"product_group": "ProductGroupOperations",
Expand All @@ -158,6 +159,7 @@
"quota_by_period_keys": "QuotaByPeriodKeysOperations",
"region": "RegionOperations",
"reports": "ReportsOperations",
"global_schema": "GlobalSchemaOperations",
"tenant_settings": "TenantSettingsOperations",
"api_management_skus": "ApiManagementSkusOperations",
"subscription": "SubscriptionOperations",
Expand All @@ -170,5 +172,35 @@
"user_subscription": "UserSubscriptionOperations",
"user_identities": "UserIdentitiesOperations",
"user_confirmation_password": "UserConfirmationPasswordOperations"
},
"operation_mixins": {
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.polling\": [\"LROPoller\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.polling\": [\"AsyncLROPoller\"]}}}",
"operations": {
"_perform_connectivity_check_async_initial" : {
"sync": {
"signature": "def _perform_connectivity_check_async_initial(\n self,\n resource_group_name, # type: str\n service_name, # type: str\n connectivity_check_request_params, # type: \"_models.ConnectivityCheckRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.ConnectivityCheckResponse\"]\n",
"doc": "\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ConnectivityCheckResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.apimanagement.models.ConnectivityCheckResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def _perform_connectivity_check_async_initial(\n self,\n resource_group_name: str,\n service_name: str,\n connectivity_check_request_params: \"_models.ConnectivityCheckRequest\",\n **kwargs: Any\n) -\u003e Optional[\"_models.ConnectivityCheckResponse\"]:\n",
"doc": "\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ConnectivityCheckResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.apimanagement.models.ConnectivityCheckResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "resource_group_name, service_name, connectivity_check_request_params"
},
"begin_perform_connectivity_check_async" : {
"sync": {
"signature": "def begin_perform_connectivity_check_async(\n self,\n resource_group_name, # type: str\n service_name, # type: str\n connectivity_check_request_params, # type: \"_models.ConnectivityCheckRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e LROPoller[\"_models.ConnectivityCheckResponse\"]\n",
"doc": "\"\"\"Performs a connectivity check between the API Management service and a given destination, and\nreturns metrics for the connection, as well as errors encountered while trying to establish it.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either ConnectivityCheckResponse or the result\n of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ConnectivityCheckResponse]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def begin_perform_connectivity_check_async(\n self,\n resource_group_name: str,\n service_name: str,\n connectivity_check_request_params: \"_models.ConnectivityCheckRequest\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.ConnectivityCheckResponse\"]:\n",
"doc": "\"\"\"Performs a connectivity check between the API Management service and a given destination, and\nreturns metrics for the connection, as well as errors encountered while trying to establish it.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either ConnectivityCheckResponse or the\n result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ConnectivityCheckResponse]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "resource_group_name, service_name, connectivity_check_request_params"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
Loading

0 comments on commit fec021b

Please sign in to comment.