Skip to content

Commit

Permalink
CodeGen from PR 14888 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Operationsmanagement t1 del (Azure#14888)

* sql t2 readme config

* readme config

* Update readme.python.md

* conflient resolve

* t1 del

Co-authored-by: msyyc <[email protected]>
  • Loading branch information
SDKAuto and msyyc committed Jun 18, 2021
1 parent b37aa44 commit f67cdf8
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 75 deletions.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "32933ef052fcd30901fe4282e7ebe301165f7f0b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/operationsmanagement/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] --use=@autorest/[email protected] --version=3.4.2",
"readme": "specification/operationsmanagement/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"chosen_version": "2015-11-01-preview",
"total_api_version_list": ["2015-11-01-preview"],
"client": {
"name": "OperationsManagementClient",
"filename": "_operations_management_client",
"description": "Operations Management Client.",
"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\": [\"OperationsManagementClientConfiguration\"]}}, \"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\": [\"OperationsManagementClientConfiguration\"]}}, \"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": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
},
"provider_name": {
"signature": "provider_name, # type: str",
"description": "Provider name for the parent resource.",
"docstring_type": "str",
"required": true
},
"resource_type": {
"signature": "resource_type, # type: str",
"description": "Resource type for the parent resource.",
"docstring_type": "str",
"required": true
},
"resource_name": {
"signature": "resource_name, # type: str",
"description": "Parent resource name.",
"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": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
},
"provider_name": {
"signature": "provider_name: str,",
"description": "Provider name for the parent resource.",
"docstring_type": "str",
"required": true
},
"resource_type": {
"signature": "resource_type: str,",
"description": "Resource type for the parent resource.",
"docstring_type": "str",
"required": true
},
"resource_name": {
"signature": "resource_name: str,",
"description": "Parent resource name.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id, provider_name, resource_type, resource_name",
"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": {
"solutions": "SolutionsOperations",
"management_associations": "ManagementAssociationsOperations",
"management_configurations": "ManagementConfigurationsOperations",
"operations": "Operations"
}
}
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 OperationsManagementClientConfiguration
from .operations import SolutionsOperations
Expand Down Expand Up @@ -80,6 +81,27 @@ def __init__(
self.operations = Operations(
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'),
'providerName': self._serialize.url("self._config.provider_name", self._config.provider_name, 'str'),
'resourceType': self._serialize.url("self._config.resource_type", self._config.resource_type, 'str'),
'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, '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 @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.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 @@ -77,6 +78,26 @@ def __init__(
self.operations = Operations(
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'),
'providerName': self._serialize.url("self._config.provider_name", self._config.provider_name, 'str'),
'resourceType': self._serialize.url("self._config.resource_type", self._config.resource_type, 'str'),
'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, '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 @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

async def list_by_subscription(
self,
**kwargs
**kwargs: Any
) -> "_models.ManagementAssociationPropertiesList":
"""Retrieves the ManagementAssociations list for the subscription.
Expand Down Expand Up @@ -82,7 +82,7 @@ async def list_by_subscription(

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

deserialized = self._deserialize('ManagementAssociationPropertiesList', pipeline_response)
Expand All @@ -98,7 +98,7 @@ async def create_or_update(
resource_group_name: str,
management_association_name: str,
parameters: "_models.ManagementAssociation",
**kwargs
**kwargs: Any
) -> "_models.ManagementAssociation":
"""Create/Update ManagementAssociation.
Expand Down Expand Up @@ -155,7 +155,7 @@ async def create_or_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.CodeMessageError, response)
error = self._deserialize.failsafe_deserialize(_models.CodeMessageError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ManagementAssociation', pipeline_response)
Expand All @@ -170,7 +170,7 @@ async def delete(
self,
resource_group_name: str,
management_association_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the ManagementAssociation.
Expand Down Expand Up @@ -220,7 +220,7 @@ async def delete(

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

if cls:
Expand All @@ -232,7 +232,7 @@ async def get(
self,
resource_group_name: str,
management_association_name: str,
**kwargs
**kwargs: Any
) -> "_models.ManagementAssociation":
"""Retrieve ManagementAssociation.
Expand Down Expand Up @@ -282,7 +282,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.CodeMessageError, response)
error = self._deserialize.failsafe_deserialize(_models.CodeMessageError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ManagementAssociation', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

async def list_by_subscription(
self,
**kwargs
**kwargs: Any
) -> "_models.ManagementConfigurationPropertiesList":
"""Retrieves the ManagementConfigurations list for the subscription.
Expand Down Expand Up @@ -82,7 +82,7 @@ async def list_by_subscription(

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

deserialized = self._deserialize('ManagementConfigurationPropertiesList', pipeline_response)
Expand All @@ -98,7 +98,7 @@ async def create_or_update(
resource_group_name: str,
management_configuration_name: str,
parameters: "_models.ManagementConfiguration",
**kwargs
**kwargs: Any
) -> "_models.ManagementConfiguration":
"""Create/Update ManagementConfiguration.
Expand Down Expand Up @@ -152,7 +152,7 @@ async def create_or_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.CodeMessageError, response)
error = self._deserialize.failsafe_deserialize(_models.CodeMessageError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ManagementConfiguration', pipeline_response)
Expand All @@ -167,7 +167,7 @@ async def delete(
self,
resource_group_name: str,
management_configuration_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the ManagementConfiguration.
Expand Down Expand Up @@ -214,7 +214,7 @@ async def delete(

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

if cls:
Expand All @@ -226,7 +226,7 @@ async def get(
self,
resource_group_name: str,
management_configuration_name: str,
**kwargs
**kwargs: Any
) -> "_models.ManagementConfiguration":
"""Retrieve ManagementConfiguration.
Expand Down Expand Up @@ -273,7 +273,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.CodeMessageError, response)
error = self._deserialize.failsafe_deserialize(_models.CodeMessageError, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ManagementConfiguration', pipeline_response)
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 OperationsManagement Rest API operations.
Expand Down
Loading

0 comments on commit f67cdf8

Please sign in to comment.