Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-quantum] Automation - Fix Client Name #8759

Draft
wants to merge 1 commit into
base: release/v3
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions sdk/quantum/azure-quantum/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "V2",
"use": "@microsoft.azure/autorest.python@~4.0.71",
"commit": "21d41536f1b5adee299c54ff89c17ece2f87a34f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/quantum/data-plane/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2",
"readme": "specification/quantum/data-plane/readme.md"
}
1 change: 1 addition & 0 deletions sdk/quantum/azure-quantum/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions sdk/quantum/azure-quantum/azure/quantum/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
19 changes: 19 additions & 0 deletions sdk/quantum/azure-quantum/azure/quantum/_client/__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

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 msrest import Configuration

from .version import VERSION


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

: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 credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
:param str base_url: Service URL
"""

def __init__(
self, subscription_id, resource_group_name, workspace_name, credentials, base_url=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 credentials is None:
raise ValueError("Parameter 'credentials' 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.subscription_id = subscription_id
self.resource_group_name = resource_group_name
self.workspace_name = workspace_name
self.credentials = credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 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 msrest.exceptions import HttpOperationError
from .operations import JobsOperations
from .operations import ProvidersOperations
from .operations import StorageOperations
from .operations import QuotasOperations
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._client.operations.JobsOperations
:ivar providers: Providers operations
:vartype providers: azure.quantum._client.operations.ProvidersOperations
:ivar storage: Storage operations
:vartype storage: azure.quantum._client.operations.StorageOperations
:ivar quotas: Quotas operations
:vartype quotas: azure.quantum._client.operations.QuotasOperations

: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 credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
:param str base_url: Service URL
"""

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

self.config = QuantumClientConfiguration(subscription_id, resource_group_name, workspace_name, credentials, 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 = '2021-11-01-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)
self.quotas = QuotasOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 CostEstimate
from ._models_py3 import ErrorData
from ._models_py3 import JobDetails
from ._models_py3 import JobDetailsList
from ._models_py3 import JsonPatchDocument
from ._models_py3 import ProviderStatus
from ._models_py3 import ProviderStatusList
from ._models_py3 import Quota
from ._models_py3 import QuotaList
from ._models_py3 import RestError, RestErrorException
from ._models_py3 import SasUriResponse
from ._models_py3 import TargetStatus
from ._models_py3 import UsageEvent
except (SyntaxError, ImportError):
from ._models import BlobDetails
from ._models import CostEstimate
from ._models import ErrorData
from ._models import JobDetails
from ._models import JobDetailsList
from ._models import JsonPatchDocument
from ._models import ProviderStatus
from ._models import ProviderStatusList
from ._models import Quota
from ._models import QuotaList
from ._models import RestError, RestErrorException
from ._models import SasUriResponse
from ._models import TargetStatus
from ._models import UsageEvent
from ._quantum_client_enums import (
DimensionScope,
JobStatus,
JsonPatchOperation,
MeterPeriod,
ProviderAvailability,
TargetAvailability,
)

__all__ = [
'BlobDetails',
'CostEstimate',
'ErrorData',
'JobDetails',
'JobDetailsList',
'JsonPatchDocument',
'ProviderStatus',
'ProviderStatusList',
'Quota',
'QuotaList',
'RestError', 'RestErrorException',
'SasUriResponse',
'TargetStatus',
'UsageEvent',
'JobStatus',
'ProviderAvailability',
'TargetAvailability',
'DimensionScope',
'MeterPeriod',
'JsonPatchOperation',
]
Loading