Skip to content

Commit bef4148

Browse files
author
SDKAuto
committed
CodeGen from PR 11259 in Azure/azure-rest-api-specs
[Hub Generated] Review request for Microsoft.Quantum to add version preview/2019-11-04-preview (Azure#11259) * New Readme Config File * New Go Language Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New Ruby Language Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Creating swagger for Azure Quantum * error wrapper * remove 200 from cancel. * prettier * remove arm tag * python * rm ruby * +jobscheduler * merge from master * -ruby * go * python * js * csharp * -go +java * nodejs * missing @ * date-time * capital defs * op names * fixing sample
1 parent e188de6 commit bef4148

File tree

13 files changed

+1379
-0
lines changed

13 files changed

+1379
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from ._configuration import QuantumClientConfiguration
13+
from ._quantum_client import QuantumClient
14+
__all__ = ['QuantumClient', 'QuantumClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class QuantumClientConfiguration(AzureConfiguration):
17+
"""Configuration for QuantumClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: The Azure subscription ID. This is a
25+
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
26+
:type subscription_id: str
27+
:param resource_group_name: Name of an Azure resource group.
28+
:type resource_group_name: str
29+
:param workspace_name: Name of the workspace.
30+
:type workspace_name: str
31+
:param str base_url: Service URL
32+
"""
33+
34+
def __init__(
35+
self, credentials, subscription_id, resource_group_name, workspace_name, base_url=None):
36+
37+
if credentials is None:
38+
raise ValueError("Parameter 'credentials' must not be None.")
39+
if subscription_id is None:
40+
raise ValueError("Parameter 'subscription_id' must not be None.")
41+
if resource_group_name is None:
42+
raise ValueError("Parameter 'resource_group_name' must not be None.")
43+
if workspace_name is None:
44+
raise ValueError("Parameter 'workspace_name' must not be None.")
45+
if not base_url:
46+
base_url = 'https://quantum.azure.com'
47+
48+
super(QuantumClientConfiguration, self).__init__(base_url)
49+
50+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
51+
self.keep_alive = True
52+
53+
self.add_user_agent('azure-quantum/{}'.format(VERSION))
54+
self.add_user_agent('Azure-SDK-For-Python')
55+
56+
self.credentials = credentials
57+
self.subscription_id = subscription_id
58+
self.resource_group_name = resource_group_name
59+
self.workspace_name = workspace_name
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import QuantumClientConfiguration
16+
from .operations import JobsOperations
17+
from .operations import ProvidersOperations
18+
from .operations import StorageOperations
19+
from . import models
20+
21+
22+
class QuantumClient(SDKClient):
23+
"""Azure Quantum REST API client
24+
25+
:ivar config: Configuration for client.
26+
:vartype config: QuantumClientConfiguration
27+
28+
:ivar jobs: Jobs operations
29+
:vartype jobs: azure.quantum.operations.JobsOperations
30+
:ivar providers: Providers operations
31+
:vartype providers: azure.quantum.operations.ProvidersOperations
32+
:ivar storage: Storage operations
33+
:vartype storage: azure.quantum.operations.StorageOperations
34+
35+
:param credentials: Credentials needed for the client to connect to Azure.
36+
:type credentials: :mod:`A msrestazure Credentials
37+
object<msrestazure.azure_active_directory>`
38+
:param subscription_id: The Azure subscription ID. This is a
39+
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
40+
:type subscription_id: str
41+
:param resource_group_name: Name of an Azure resource group.
42+
:type resource_group_name: str
43+
:param workspace_name: Name of the workspace.
44+
:type workspace_name: str
45+
:param str base_url: Service URL
46+
"""
47+
48+
def __init__(
49+
self, credentials, subscription_id, resource_group_name, workspace_name, base_url=None):
50+
51+
self.config = QuantumClientConfiguration(credentials, subscription_id, resource_group_name, workspace_name, base_url)
52+
super(QuantumClient, self).__init__(self.config.credentials, self.config)
53+
54+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
55+
self.api_version = '2019-11-04-preview'
56+
self._serialize = Serializer(client_models)
57+
self._deserialize = Deserializer(client_models)
58+
59+
self.jobs = JobsOperations(
60+
self._client, self.config, self._serialize, self._deserialize)
61+
self.providers = ProvidersOperations(
62+
self._client, self.config, self._serialize, self._deserialize)
63+
self.storage = StorageOperations(
64+
self._client, self.config, self._serialize, self._deserialize)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
try:
13+
from ._models_py3 import BlobDetails
14+
from ._models_py3 import ErrorData
15+
from ._models_py3 import JobDetails
16+
from ._models_py3 import ProviderStatus
17+
from ._models_py3 import RestError, RestErrorException
18+
from ._models_py3 import SasUriResponse
19+
from ._models_py3 import TargetStatus
20+
except (SyntaxError, ImportError):
21+
from ._models import BlobDetails
22+
from ._models import ErrorData
23+
from ._models import JobDetails
24+
from ._models import ProviderStatus
25+
from ._models import RestError, RestErrorException
26+
from ._models import SasUriResponse
27+
from ._models import TargetStatus
28+
from ._paged_models import JobDetailsPaged
29+
from ._paged_models import ProviderStatusPaged
30+
from ._quantum_client_enums import (
31+
JobStatus,
32+
ProviderAvailability,
33+
TargetAvailability,
34+
)
35+
36+
__all__ = [
37+
'BlobDetails',
38+
'ErrorData',
39+
'JobDetails',
40+
'ProviderStatus',
41+
'RestError', 'RestErrorException',
42+
'SasUriResponse',
43+
'TargetStatus',
44+
'JobDetailsPaged',
45+
'ProviderStatusPaged',
46+
'JobStatus',
47+
'ProviderAvailability',
48+
'TargetAvailability',
49+
]

0 commit comments

Comments
 (0)