Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sdk/quantum/azure-quantum/azure/quantum/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import QuantumClientConfiguration
from ._quantum_client import QuantumClient
__all__ = ['QuantumClient', 'QuantumClientConfiguration']

from .version import VERSION

__version__ = VERSION

59 changes: 59 additions & 0 deletions sdk/quantum/azure-quantum/azure/quantum/_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


class QuantumClientConfiguration(AzureConfiguration):
"""Configuration for QuantumClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription ID. This is a
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
:type subscription_id: str
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param workspace_name: Name of the workspace.
:type workspace_name: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, resource_group_name, workspace_name, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if resource_group_name is None:
raise ValueError("Parameter 'resource_group_name' must not be None.")
if workspace_name is None:
raise ValueError("Parameter 'workspace_name' must not be None.")
if not base_url:
base_url = 'https://quantum.azure.com'

super(QuantumClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-quantum/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
self.resource_group_name = resource_group_name
self.workspace_name = workspace_name
64 changes: 64 additions & 0 deletions sdk/quantum/azure-quantum/azure/quantum/_quantum_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import QuantumClientConfiguration
from .operations import JobsOperations
from .operations import ProvidersOperations
from .operations import StorageOperations
from . import models


class QuantumClient(SDKClient):
"""Azure Quantum REST API client

:ivar config: Configuration for client.
:vartype config: QuantumClientConfiguration

:ivar jobs: Jobs operations
:vartype jobs: azure.quantum.operations.JobsOperations
:ivar providers: Providers operations
:vartype providers: azure.quantum.operations.ProvidersOperations
:ivar storage: Storage operations
:vartype storage: azure.quantum.operations.StorageOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription ID. This is a
GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
:type subscription_id: str
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param workspace_name: Name of the workspace.
:type workspace_name: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, resource_group_name, workspace_name, base_url=None):

self.config = QuantumClientConfiguration(credentials, subscription_id, resource_group_name, workspace_name, base_url)
super(QuantumClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-11-04-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.jobs = JobsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.providers = ProvidersOperations(
self._client, self.config, self._serialize, self._deserialize)
self.storage = StorageOperations(
self._client, self.config, self._serialize, self._deserialize)
49 changes: 49 additions & 0 deletions sdk/quantum/azure-quantum/azure/quantum/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from ._models_py3 import BlobDetails
from ._models_py3 import ErrorData
from ._models_py3 import JobDetails
from ._models_py3 import ProviderStatus
from ._models_py3 import RestError, RestErrorException
from ._models_py3 import SasUriResponse
from ._models_py3 import TargetStatus
except (SyntaxError, ImportError):
from ._models import BlobDetails
from ._models import ErrorData
from ._models import JobDetails
from ._models import ProviderStatus
from ._models import RestError, RestErrorException
from ._models import SasUriResponse
from ._models import TargetStatus
from ._paged_models import JobDetailsPaged
from ._paged_models import ProviderStatusPaged
from ._quantum_client_enums import (
JobStatus,
ProviderAvailability,
TargetAvailability,
)

__all__ = [
'BlobDetails',
'ErrorData',
'JobDetails',
'ProviderStatus',
'RestError', 'RestErrorException',
'SasUriResponse',
'TargetStatus',
'JobDetailsPaged',
'ProviderStatusPaged',
'JobStatus',
'ProviderAvailability',
'TargetAvailability',
]
Loading