Skip to content

Commit 3d9c147

Browse files
Azure CLI BotSDKAutomsyycRAY-316
authored
[AutoRelease] t2-quantum-2021-08-04-00093 (Azure#20080)
* CodeGen from PR 12566 in Azure/azure-rest-api-specs Update quantum python track2 config (Azure#12566) * update quantum python track2 config * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * version,CHANGELOG * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: SDKAuto <sdkautomation@microsoft.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Zed Lei <59104634+RAY-316@users.noreply.github.com>
1 parent 6585a10 commit 3d9c147

17 files changed

+151
-48
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Release History
22

3+
## 1.0.0b2 (2021-08-04)
4+
5+
**Features**
6+
7+
- Model SkuDescription has a new parameter version
8+
- Model SkuDescription has a new parameter restricted_access_uri
9+
- Model QuantumWorkspace has a new parameter system_data
10+
- Added operation group WorkspaceOperations
11+
312
## 1.0.0b1 (2021-01-28)
413

514
* Initial Release

sdk/quantum/azure-mgmt-quantum/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.2",
3+
"use": [
4+
"@autorest/python@5.8.0",
5+
"@autorest/modelerfour@4.19.2"
6+
],
7+
"commit": "5e076b3d3a0d6b5c9f083a0fddf0e3082137b0c6",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/quantum/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.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
10+
"readme": "specification/quantum/resource-manager/readme.md"
11+
}

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_azure_quantum_management_client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import AzureQuantumManagementClientConfiguration
2122
from .operations import WorkspacesOperations
@@ -56,6 +57,7 @@ def __init__(
5657

5758
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5859
self._serialize = Serializer(client_models)
60+
self._serialize.client_side_validation = False
5961
self._deserialize = Deserializer(client_models)
6062

6163
self.workspaces = WorkspacesOperations(
@@ -65,6 +67,24 @@ def __init__(
6567
self.operations = Operations(
6668
self._client, self._config, self._serialize, self._deserialize)
6769

70+
def _send_request(self, http_request, **kwargs):
71+
# type: (HttpRequest, Any) -> HttpResponse
72+
"""Runs the network request through the client's chained policies.
73+
74+
:param http_request: The network request you want to make. Required.
75+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
76+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
77+
:return: The response of your network call. Does not do error handling on your response.
78+
:rtype: ~azure.core.pipeline.transport.HttpResponse
79+
"""
80+
path_format_arguments = {
81+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
82+
}
83+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
84+
stream = kwargs.pop("stream", True)
85+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
86+
return pipeline_response.http_response
87+
6888
def close(self):
6989
# type: () -> None
7090
self._client.close()

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_metadata.json

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"custom_base_url": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
12-
"client_side_validation": true
12+
"client_side_validation": false,
13+
"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\": [\"AzureQuantumManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"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\": [\"AzureQuantumManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1315
},
1416
"global_parameters": {
1517
"sync": {
@@ -28,36 +30,76 @@
2830
},
2931
"async": {
3032
"credential": {
31-
"signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3234
"description": "Credential needed for the client to connect to Azure.",
3335
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3436
"required": true
3537
},
3638
"subscription_id": {
37-
"signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3840
"description": "The Azure subscription ID.",
3941
"docstring_type": "str",
4042
"required": true
4143
}
4244
},
4345
"constant": {
4446
},
45-
"call": "credential, subscription_id"
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
4690
},
4791
"config": {
4892
"credential": true,
4993
"credential_scopes": ["https://management.azure.com/.default"],
5094
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5195
"credential_default_policy_type_has_async_version": true,
52-
"credential_key_header_name": null
96+
"credential_key_header_name": null,
97+
"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\"]}}}",
98+
"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\"]}}}"
5399
},
54100
"operation_groups": {
55101
"workspaces": "WorkspacesOperations",
56102
"offerings": "OfferingsOperations",
57103
"operations": "Operations"
58-
},
59-
"operation_mixins": {
60-
},
61-
"sync_imports": "None",
62-
"async_imports": "None"
104+
}
63105
}

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0b1"
9+
VERSION = "1.0.0b2"

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/aio/_azure_quantum_management_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -53,6 +54,7 @@ def __init__(
5354

5455
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5556
self._serialize = Serializer(client_models)
57+
self._serialize.client_side_validation = False
5658
self._deserialize = Deserializer(client_models)
5759

5860
self.workspaces = WorkspacesOperations(
@@ -62,6 +64,23 @@ def __init__(
6264
self.operations = Operations(
6365
self._client, self._config, self._serialize, self._deserialize)
6466

67+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
68+
"""Runs the network request through the client's chained policies.
69+
70+
:param http_request: The network request you want to make. Required.
71+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
72+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
73+
:return: The response of your network call. Does not do error handling on your response.
74+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
75+
"""
76+
path_format_arguments = {
77+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
78+
}
79+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
80+
stream = kwargs.pop("stream", True)
81+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
82+
return pipeline_response.http_response
83+
6584
async def close(self) -> None:
6685
await self._client.close()
6786

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/aio/operations/_offerings_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4444
def list(
4545
self,
4646
location_name: str,
47-
**kwargs
47+
**kwargs: Any
4848
) -> AsyncIterable["_models.OfferingsListResult"]:
4949
"""Returns the list of all provider offerings available for the given location.
5050
@@ -101,7 +101,7 @@ async def get_next(next_link=None):
101101
response = pipeline_response.http_response
102102

103103
if response.status_code not in [200]:
104-
error = self._deserialize(_models.ErrorResponse, response)
104+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
105105
map_error(status_code=response.status_code, response=response, error_map=error_map)
106106
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
107107

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/aio/operations/_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4343

4444
def list(
4545
self,
46-
**kwargs
46+
**kwargs: Any
4747
) -> AsyncIterable["_models.OperationsList"]:
4848
"""Returns list of operations.
4949
@@ -93,7 +93,7 @@ async def get_next(next_link=None):
9393
response = pipeline_response.http_response
9494

9595
if response.status_code not in [200]:
96-
error = self._deserialize(_models.ErrorResponse, response)
96+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
9797
map_error(status_code=response.status_code, response=response, error_map=error_map)
9898
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
9999

0 commit comments

Comments
 (0)