Skip to content

Commit

Permalink
CodeGen from PR 13666 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
fix python track2 generation (Azure#13666)
  • Loading branch information
SDKAuto committed Mar 26, 2021
1 parent 0caa4ba commit 7a514dd
Show file tree
Hide file tree
Showing 16 changed files with 287 additions and 192 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"chosen_version": "2020-08-01",
"total_api_version_list": ["2020-08-01"],
"client": {
"name": "LogAnalyticsManagementClient",
"filename": "_log_analytics_management_client",
"description": "Operational Insights Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false
},
"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 ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential, # type: \"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",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
},
"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
},
"operation_groups": {
"data_exports": "DataExportsOperations",
"data_sources": "DataSourcesOperations",
"intelligence_packs": "IntelligencePacksOperations",
"linked_services": "LinkedServicesOperations",
"linked_storage_accounts": "LinkedStorageAccountsOperations",
"management_groups": "ManagementGroupsOperations",
"operations": "Operations",
"operation_statuses": "OperationStatusesOperations",
"shared_keys": "SharedKeysOperations",
"usages": "UsagesOperations",
"workspaces": "WorkspacesOperations",
"deleted_workspaces": "DeletedWorkspacesOperations",
"clusters": "ClustersOperations",
"storage_insight_configs": "StorageInsightConfigsOperations",
"saved_searches": "SavedSearchesOperations",
"available_service_tiers": "AvailableServiceTiersOperations",
"gateways": "GatewaysOperations",
"schema": "SchemaOperations",
"workspace_purge": "WorkspacePurgeOperations",
"tables": "TablesOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
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 = "7.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ClusterErrorResponse, response)
error = self._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 Down Expand Up @@ -170,7 +170,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ClusterErrorResponse, response)
error = self._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 Down Expand Up @@ -224,7 +224,7 @@ async def _create_or_update_initial(

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

deserialized = None
Expand Down Expand Up @@ -348,7 +348,7 @@ async def _delete_initial(

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

if cls:
Expand Down Expand Up @@ -468,7 +468,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.ClusterErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Cluster', pipeline_response)
Expand Down Expand Up @@ -535,7 +535,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.ClusterErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Cluster', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.DataExportErrorResponse, response)
error = self._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 Down Expand Up @@ -176,7 +176,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.DataExportErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand Down Expand Up @@ -243,7 +243,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.DataExportErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('DataExport', pipeline_response)
Expand Down Expand Up @@ -306,7 +306,7 @@ async def delete(

if response.status_code not in [200, 404]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.DataExportErrorResponse, response)
error = self._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 @@ -97,8 +97,9 @@ 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)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

Expand Down Expand Up @@ -167,8 +168,9 @@ 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)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorContract, response)
error = self._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 Down Expand Up @@ -176,7 +176,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.ErrorContract, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Table', pipeline_response)
Expand Down Expand Up @@ -239,7 +239,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.ErrorContract, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Table', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ 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)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

Expand Down Expand Up @@ -169,8 +170,9 @@ 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)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

Expand Down Expand Up @@ -222,7 +224,8 @@ async def _create_or_update_initial(

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

deserialized = None
if response.status_code == 200:
Expand Down Expand Up @@ -321,6 +324,7 @@ async def _delete_initial(
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-08-01"
accept = "application/json"

# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
Expand All @@ -339,14 +343,16 @@ async def _delete_initial(

# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

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

if cls:
return cls(pipeline_response, None, {})
Expand Down Expand Up @@ -473,7 +479,8 @@ async def get(

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

deserialized = self._deserialize('Workspace', pipeline_response)

Expand Down Expand Up @@ -539,7 +546,8 @@ async def update(

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

deserialized = self._deserialize('Workspace', pipeline_response)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
from ._models_py3 import AvailableServiceTier
from ._models_py3 import AzureEntityResource
from ._models_py3 import Cluster
from ._models_py3 import ClusterErrorResponse
from ._models_py3 import ClusterListResult
from ._models_py3 import ClusterPatch
from ._models_py3 import ClusterSku
from ._models_py3 import CoreSummary
from ._models_py3 import DataExport
from ._models_py3 import DataExportErrorResponse
from ._models_py3 import DataExportListResult
from ._models_py3 import DataSource
from ._models_py3 import DataSourceFilter
from ._models_py3 import DataSourceListResult
from ._models_py3 import ErrorAdditionalInfo
from ._models_py3 import ErrorContract
from ._models_py3 import ErrorDetail
from ._models_py3 import ErrorResponse
from ._models_py3 import Identity
from ._models_py3 import IntelligencePack
Expand Down Expand Up @@ -72,19 +70,17 @@
from ._models import AvailableServiceTier # type: ignore
from ._models import AzureEntityResource # type: ignore
from ._models import Cluster # type: ignore
from ._models import ClusterErrorResponse # type: ignore
from ._models import ClusterListResult # type: ignore
from ._models import ClusterPatch # type: ignore
from ._models import ClusterSku # type: ignore
from ._models import CoreSummary # type: ignore
from ._models import DataExport # type: ignore
from ._models import DataExportErrorResponse # type: ignore
from ._models import DataExportListResult # type: ignore
from ._models import DataSource # type: ignore
from ._models import DataSourceFilter # type: ignore
from ._models import DataSourceListResult # type: ignore
from ._models import ErrorAdditionalInfo # type: ignore
from ._models import ErrorContract # type: ignore
from ._models import ErrorDetail # type: ignore
from ._models import ErrorResponse # type: ignore
from ._models import Identity # type: ignore
from ._models import IntelligencePack # type: ignore
Expand Down Expand Up @@ -153,19 +149,17 @@
'AvailableServiceTier',
'AzureEntityResource',
'Cluster',
'ClusterErrorResponse',
'ClusterListResult',
'ClusterPatch',
'ClusterSku',
'CoreSummary',
'DataExport',
'DataExportErrorResponse',
'DataExportListResult',
'DataSource',
'DataSourceFilter',
'DataSourceListResult',
'ErrorAdditionalInfo',
'ErrorContract',
'ErrorDetail',
'ErrorResponse',
'Identity',
'IntelligencePack',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@ class WorkspaceSkuNameEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
PER_GB2018 = "PerGB2018"
STANDALONE = "Standalone"
CAPACITY_RESERVATION = "CapacityReservation"
LA_CLUSTER = "LACluster"
Loading

0 comments on commit 7a514dd

Please sign in to comment.