Skip to content

Commit

Permalink
CodeGen from PR 15000 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
alertsmanagement,applicationinsights,attestation,batch,cost-management,netapp,synapse (Azure#15000)
  • Loading branch information
SDKAuto committed Jun 28, 2021
1 parent 97e5b6e commit 775eae1
Show file tree
Hide file tree
Showing 17 changed files with 200 additions and 42 deletions.
1 change: 1 addition & 0 deletions sdk/search/azure-mgmt-search/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/search/azure-mgmt-search/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.1",
"@autorest/modelerfour@4.19.2"
],
"commit": "25af5c1c0fae2bc594c1932445d06209745f5917",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/search/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.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/search/resource-manager/readme.md"
}
109 changes: 109 additions & 0 deletions sdk/search/azure-mgmt-search/azure/mgmt/search/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"chosen_version": "2020-08-01",
"total_api_version_list": ["2020-08-01"],
"client": {
"name": "SearchManagementClient",
"filename": "_search_management_client",
"description": "Client that can be used to manage Azure Cognitive Search services and API keys.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": 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\": [\"SearchManagementClientConfiguration\"]}}, \"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\": [\"SearchManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"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: str,",
"description": "The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"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,
"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": {
"operations": "Operations",
"admin_keys": "AdminKeysOperations",
"query_keys": "QueryKeysOperations",
"services": "ServicesOperations",
"private_link_resources": "PrivateLinkResourcesOperations",
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
"shared_private_link_resources": "SharedPrivateLinkResourcesOperations"
}
}
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 SearchManagementClientConfiguration
from .operations import Operations
Expand Down Expand Up @@ -86,6 +87,24 @@ def __init__(
self.shared_private_link_resources = SharedPrivateLinkResourcesOperations(
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
2 changes: 1 addition & 1 deletion sdk/search/azure-mgmt-search/azure/mgmt/search/_version.py
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 = "8.0.0"
VERSION = "1.0.0b1"
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 @@ -83,6 +84,23 @@ def __init__(
self.shared_private_link_resources = SharedPrivateLinkResourcesOperations(
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 @@ async def get(
resource_group_name: str,
search_service_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.AdminKeyResult":
"""Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service.
Expand Down Expand Up @@ -115,7 +115,7 @@ async def regenerate(
search_service_name: str,
key_kind: Union[str, "_models.AdminKeyKind"],
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.AdminKeyResult":
"""Regenerates either the primary or secondary admin API key. You can only regenerate one key at a
time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

def list(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.OperationListResult"]:
"""Lists all of the available REST API operations of the Microsoft.Search provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def update(
private_endpoint_connection_name: str,
private_endpoint_connection: "_models.PrivateEndpointConnection",
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.PrivateEndpointConnection":
"""Updates a Private Endpoint connection to the search service in the given resource group.
Expand Down Expand Up @@ -130,7 +130,7 @@ async def get(
search_service_name: str,
private_endpoint_connection_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.PrivateEndpointConnection":
"""Gets the details of the private endpoint connection to the search service in the given resource
group.
Expand Down Expand Up @@ -205,7 +205,7 @@ async def delete(
search_service_name: str,
private_endpoint_connection_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> Optional["_models.PrivateEndpointConnection"]:
"""Disconnects the private endpoint connection and deletes it from the search service.
Expand Down Expand Up @@ -280,7 +280,7 @@ def list_by_service(
resource_group_name: str,
search_service_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]:
"""Gets a list of all private endpoint connections in the given service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def list_supported(
resource_group_name: str,
search_service_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.PrivateLinkResourcesResult"]:
"""Gets a list of all supported private link resource types for the given service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def create(
search_service_name: str,
name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.QueryKey":
"""Generates a new query key for the specified search service. You can create up to 50 query keys
per service.
Expand Down Expand Up @@ -120,7 +120,7 @@ def list_by_search_service(
resource_group_name: str,
search_service_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ListQueryKeysResult"]:
"""Returns the list of query API keys for the given Azure Cognitive Search service.
Expand Down Expand Up @@ -206,7 +206,7 @@ async def delete(
search_service_name: str,
key: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process
for regenerating a query key is to delete and then recreate it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def _create_or_update_initial(
search_service_name: str,
service: "_models.SearchService",
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.SearchService":
cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchService"]
error_map = {
Expand Down Expand Up @@ -113,7 +113,7 @@ async def begin_create_or_update(
search_service_name: str,
service: "_models.SearchService",
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.SearchService"]:
"""Creates or updates a search service in the given resource group. If the search service already
exists, all properties will be updated with the given values.
Expand All @@ -134,8 +134,8 @@ async def begin_create_or_update(
:type search_management_request_options: ~azure.mgmt.search.models.SearchManagementRequestOptions
: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: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in 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 SearchService or the result of cls(response)
Expand Down Expand Up @@ -195,7 +195,7 @@ async def update(
search_service_name: str,
service: "_models.SearchServiceUpdate",
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.SearchService":
"""Updates an existing search service in the given resource group.
Expand Down Expand Up @@ -270,7 +270,7 @@ async def get(
resource_group_name: str,
search_service_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.SearchService":
"""Gets the search service with the given name in the given resource group.
Expand Down Expand Up @@ -339,7 +339,7 @@ async def delete(
resource_group_name: str,
search_service_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> None:
"""Deletes a search service in the given resource group, along with its associated resources.
Expand Down Expand Up @@ -404,7 +404,7 @@ def list_by_resource_group(
self,
resource_group_name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.SearchServiceListResult"]:
"""Gets a list of all search services in the given resource group.
Expand Down Expand Up @@ -483,7 +483,7 @@ async def get_next(next_link=None):
def list_by_subscription(
self,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.SearchServiceListResult"]:
"""Gets a list of all search services in the given subscription.
Expand Down Expand Up @@ -559,7 +559,7 @@ async def check_name_availability(
self,
name: str,
search_management_request_options: Optional["_models.SearchManagementRequestOptions"] = None,
**kwargs
**kwargs: Any
) -> "_models.CheckNameAvailabilityOutput":
"""Checks whether or not the given search service name is available for use. Search service names
must be globally unique since they are part of the service URI
Expand Down
Loading

0 comments on commit 775eae1

Please sign in to comment.