azure-quantum 2.3.0__py3-none-any.whl → 2.5.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. azure/quantum/_client/__init__.py +11 -5
  2. azure/quantum/_client/_client.py +40 -49
  3. azure/quantum/_client/_configuration.py +34 -41
  4. azure/quantum/_client/_model_base.py +1159 -0
  5. azure/quantum/_client/_serialization.py +285 -172
  6. azure/quantum/_client/_version.py +1 -1
  7. azure/quantum/_client/aio/__init__.py +29 -0
  8. azure/quantum/_client/aio/_client.py +143 -0
  9. azure/quantum/_client/aio/_configuration.py +82 -0
  10. azure/quantum/_client/aio/_patch.py +20 -0
  11. azure/quantum/_client/aio/operations/__init__.py +35 -0
  12. azure/quantum/_client/aio/operations/_operations.py +1824 -0
  13. azure/quantum/_client/aio/operations/_patch.py +20 -0
  14. azure/quantum/_client/models/__init__.py +41 -30
  15. azure/quantum/_client/models/_enums.py +34 -4
  16. azure/quantum/_client/models/_models.py +435 -764
  17. azure/quantum/_client/operations/__init__.py +16 -10
  18. azure/quantum/_client/operations/_operations.py +1191 -769
  19. azure/quantum/_client/py.typed +1 -0
  20. azure/quantum/target/microsoft/elements/dft/target.py +2 -1
  21. azure/quantum/target/rigetti/target.py +1 -1
  22. azure/quantum/version.py +1 -1
  23. azure/quantum/workspace.py +371 -38
  24. {azure_quantum-2.3.0.dist-info → azure_quantum-2.5.0.dev0.dist-info}/METADATA +1 -1
  25. {azure_quantum-2.3.0.dist-info → azure_quantum-2.5.0.dev0.dist-info}/RECORD +27 -19
  26. azure/quantum/_client/_vendor.py +0 -20
  27. {azure_quantum-2.3.0.dist-info → azure_quantum-2.5.0.dev0.dist-info}/WHEEL +0 -0
  28. {azure_quantum-2.3.0.dist-info → azure_quantum-2.5.0.dev0.dist-info}/top_level.txt +0 -0
@@ -1,30 +1,27 @@
1
1
  # coding=utf-8
2
- # pylint: disable=too-many-lines
3
2
  # --------------------------------------------------------------------------
4
3
  # Copyright (c) Microsoft Corporation. All rights reserved.
5
4
  # Licensed under the MIT License. See License.txt in the project root for license information.
6
- # Code generated by Microsoft (R) AutoRest Code Generator.
5
+ # Code generated by Microsoft (R) Python Code Generator.
7
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  # --------------------------------------------------------------------------
8
+ # pylint: disable=useless-super-delegation
9
9
 
10
- import sys
11
- from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
10
+ import datetime
11
+ from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload
12
12
 
13
- from .. import _serialization
13
+ from azure.core.exceptions import ODataV4Format
14
14
 
15
- if sys.version_info >= (3, 9):
16
- from collections.abc import MutableMapping
17
- else:
18
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
15
+ from .. import _model_base
16
+ from .._model_base import rest_discriminator, rest_field
17
+ from ._enums import ItemType
19
18
 
20
19
  if TYPE_CHECKING:
21
- # pylint: disable=unused-import,ungrouped-imports
22
20
  from .. import models as _models
23
- JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
24
21
 
25
22
 
26
- class BlobDetails(_serialization.Model):
27
- """Blob details.
23
+ class BlobDetails(_model_base.Model):
24
+ """The details (name and container) of the blob to store or download data.
28
25
 
29
26
  All required parameters must be populated in order to send to server.
30
27
 
@@ -34,115 +31,115 @@ class BlobDetails(_serialization.Model):
34
31
  :vartype blob_name: str
35
32
  """
36
33
 
37
- _validation = {
38
- "container_name": {"required": True},
39
- }
34
+ container_name: str = rest_field(name="containerName", visibility=["read", "create"])
35
+ """The container name. Required."""
36
+ blob_name: Optional[str] = rest_field(name="blobName", visibility=["read", "create"])
37
+ """The blob name."""
40
38
 
41
- _attribute_map = {
42
- "container_name": {"key": "containerName", "type": "str"},
43
- "blob_name": {"key": "blobName", "type": "str"},
44
- }
39
+ @overload
40
+ def __init__(
41
+ self,
42
+ *,
43
+ container_name: str,
44
+ blob_name: Optional[str] = None,
45
+ ) -> None: ...
45
46
 
46
- def __init__(self, *, container_name: str, blob_name: Optional[str] = None, **kwargs: Any) -> None:
47
+ @overload
48
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
47
49
  """
48
- :keyword container_name: The container name. Required.
49
- :paramtype container_name: str
50
- :keyword blob_name: The blob name.
51
- :paramtype blob_name: str
50
+ :param mapping: raw JSON to initialize the model.
51
+ :type mapping: Mapping[str, Any]
52
52
  """
53
- super().__init__(**kwargs)
54
- self.container_name = container_name
55
- self.blob_name = blob_name
56
53
 
54
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
55
+ super().__init__(*args, **kwargs)
57
56
 
58
- class CostEstimate(_serialization.Model):
57
+
58
+ class CostEstimate(_model_base.Model):
59
59
  """The job cost billed by the provider. The final cost on your bill might be slightly different
60
60
  due to added taxes and currency conversion rates.
61
61
 
62
- :ivar currency_code: The currency code.
62
+
63
+ :ivar currency_code: The currency code. Required.
63
64
  :vartype currency_code: str
64
65
  :ivar events: List of usage events.
65
- :vartype events: list[~azure.quantum._client.models.UsageEvent]
66
- :ivar estimated_total: The estimated total.
66
+ :vartype events: list[~azure.quantum.models.UsageEvent]
67
+ :ivar estimated_total: The estimated total. Required.
67
68
  :vartype estimated_total: float
68
69
  """
69
70
 
70
- _attribute_map = {
71
- "currency_code": {"key": "currencyCode", "type": "str"},
72
- "events": {"key": "events", "type": "[UsageEvent]"},
73
- "estimated_total": {"key": "estimatedTotal", "type": "float"},
74
- }
71
+ currency_code: str = rest_field(name="currencyCode")
72
+ """The currency code. Required."""
73
+ events: Optional[List["_models.UsageEvent"]] = rest_field()
74
+ """List of usage events."""
75
+ estimated_total: float = rest_field(name="estimatedTotal")
76
+ """The estimated total. Required."""
75
77
 
78
+ @overload
76
79
  def __init__(
77
80
  self,
78
81
  *,
79
- currency_code: Optional[str] = None,
82
+ currency_code: str,
83
+ estimated_total: float,
80
84
  events: Optional[List["_models.UsageEvent"]] = None,
81
- estimated_total: Optional[float] = None,
82
- **kwargs: Any
83
- ) -> None:
85
+ ) -> None: ...
86
+
87
+ @overload
88
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
84
89
  """
85
- :keyword currency_code: The currency code.
86
- :paramtype currency_code: str
87
- :keyword events: List of usage events.
88
- :paramtype events: list[~azure.quantum._client.models.UsageEvent]
89
- :keyword estimated_total: The estimated total.
90
- :paramtype estimated_total: float
90
+ :param mapping: raw JSON to initialize the model.
91
+ :type mapping: Mapping[str, Any]
91
92
  """
92
- super().__init__(**kwargs)
93
- self.currency_code = currency_code
94
- self.events = events
95
- self.estimated_total = estimated_total
96
93
 
94
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
95
+ super().__init__(*args, **kwargs)
97
96
 
98
- class ErrorData(_serialization.Model):
99
- """An error response from Azure.
100
97
 
101
- All required parameters must be populated in order to send to server.
98
+ class InnerError(_model_base.Model):
99
+ """An object containing more specific information about the error. As per Microsoft One API
100
+ guidelines -
101
+ https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
102
102
 
103
- :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
104
- programmatically. Required.
103
+ :ivar code: One of a server-defined set of error codes.
105
104
  :vartype code: str
106
- :ivar message: A message describing the error, intended to be suitable for displaying in a user
107
- interface. Required.
108
- :vartype message: str
105
+ :ivar innererror: Inner error.
106
+ :vartype innererror: ~azure.quantum.models.InnerError
109
107
  """
110
108
 
111
- _validation = {
112
- "code": {"required": True},
113
- "message": {"required": True},
114
- }
109
+ code: Optional[str] = rest_field()
110
+ """One of a server-defined set of error codes."""
111
+ innererror: Optional["_models.InnerError"] = rest_field()
112
+ """Inner error."""
115
113
 
116
- _attribute_map = {
117
- "code": {"key": "code", "type": "str"},
118
- "message": {"key": "message", "type": "str"},
119
- }
114
+ @overload
115
+ def __init__(
116
+ self,
117
+ *,
118
+ code: Optional[str] = None,
119
+ innererror: Optional["_models.InnerError"] = None,
120
+ ) -> None: ...
120
121
 
121
- def __init__(self, *, code: str, message: str, **kwargs: Any) -> None:
122
+ @overload
123
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
122
124
  """
123
- :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed
124
- programmatically. Required.
125
- :paramtype code: str
126
- :keyword message: A message describing the error, intended to be suitable for displaying in a
127
- user interface. Required.
128
- :paramtype message: str
125
+ :param mapping: raw JSON to initialize the model.
126
+ :type mapping: Mapping[str, Any]
129
127
  """
130
- super().__init__(**kwargs)
131
- self.code = code
132
- self.message = message
133
128
 
129
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
130
+ super().__init__(*args, **kwargs)
134
131
 
135
- class ItemDetails(_serialization.Model):
136
- """Item details. An item can be a job or a session.
132
+
133
+ class ItemDetails(_model_base.Model):
134
+ """A workspace item.
137
135
 
138
136
  You probably want to use the sub-classes and not this class directly. Known sub-classes are:
139
137
  JobDetails, SessionDetails
140
138
 
141
- Variables are only populated by the server, and will be ignored when sending a request.
139
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
142
140
 
143
- All required parameters must be populated in order to send to server.
144
141
 
145
- :ivar id: The id of the item. Required.
142
+ :ivar id: Id of the item. Required.
146
143
  :vartype id: str
147
144
  :ivar name: The name of the item. It is not required for the name to be unique and it's only
148
145
  used for display purposes. Required.
@@ -151,128 +148,75 @@ class ItemDetails(_serialization.Model):
151
148
  :vartype provider_id: str
152
149
  :ivar target: The target identifier to run the job. Required.
153
150
  :vartype target: str
154
- :ivar item_type: The type of item. Required. Known values are: "Job" and "Session".
155
- :vartype item_type: str or ~azure.quantum._client.models.ItemType
151
+ :ivar item_type: Type of the Quantum Workspace item. Required. Known values are: "Job" and
152
+ "Session".
153
+ :vartype item_type: str or ~azure.quantum.models.ItemType
156
154
  :ivar creation_time: The creation time of the item.
157
155
  :vartype creation_time: ~datetime.datetime
158
156
  :ivar begin_execution_time: The time when the item began execution.
159
157
  :vartype begin_execution_time: ~datetime.datetime
160
158
  :ivar end_execution_time: The time when the item finished execution.
161
159
  :vartype end_execution_time: ~datetime.datetime
162
- :ivar cost_estimate: The job cost billed by the provider. The final cost on your bill might be
163
- slightly different due to added taxes and currency conversion rates.
164
- :vartype cost_estimate: ~azure.quantum._client.models.CostEstimate
165
- :ivar error_data: An error response from Azure.
166
- :vartype error_data: ~azure.quantum._client.models.ErrorData
160
+ :ivar cost_estimate: Cost estimate.
161
+ :vartype cost_estimate: ~azure.quantum.models.CostEstimate
162
+ :ivar error_data: Error information.
163
+ :vartype error_data: ~azure.quantum.models.WorkspaceItemError
167
164
  """
168
165
 
169
- _validation = {
170
- "id": {"required": True},
171
- "name": {"required": True},
172
- "provider_id": {"required": True},
173
- "target": {"required": True},
174
- "item_type": {"required": True},
175
- "creation_time": {"readonly": True},
176
- "begin_execution_time": {"readonly": True},
177
- "end_execution_time": {"readonly": True},
178
- }
179
-
180
- _attribute_map = {
181
- "id": {"key": "id", "type": "str"},
182
- "name": {"key": "name", "type": "str"},
183
- "provider_id": {"key": "providerId", "type": "str"},
184
- "target": {"key": "target", "type": "str"},
185
- "item_type": {"key": "itemType", "type": "str"},
186
- "creation_time": {"key": "creationTime", "type": "iso-8601"},
187
- "begin_execution_time": {"key": "beginExecutionTime", "type": "iso-8601"},
188
- "end_execution_time": {"key": "endExecutionTime", "type": "iso-8601"},
189
- "cost_estimate": {"key": "costEstimate", "type": "CostEstimate"},
190
- "error_data": {"key": "errorData", "type": "ErrorData"},
191
- }
192
-
193
- _subtype_map = {"item_type": {"Job": "JobDetails", "Session": "SessionDetails"}}
194
-
166
+ __mapping__: Dict[str, _model_base.Model] = {}
167
+ id: str = rest_field(visibility=["read"])
168
+ """Id of the item. Required."""
169
+ name: str = rest_field(visibility=["read", "create", "update"])
170
+ """The name of the item. It is not required for the name to be unique and it's only used for
171
+ display purposes. Required."""
172
+ provider_id: str = rest_field(name="providerId", visibility=["read", "create"])
173
+ """The unique identifier for the provider. Required."""
174
+ target: str = rest_field(visibility=["read", "create"])
175
+ """The target identifier to run the job. Required."""
176
+ item_type: str = rest_discriminator(name="itemType", visibility=["read", "create"])
177
+ """Type of the Quantum Workspace item. Required. Known values are: \"Job\" and \"Session\"."""
178
+ creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339")
179
+ """The creation time of the item."""
180
+ begin_execution_time: Optional[datetime.datetime] = rest_field(
181
+ name="beginExecutionTime", visibility=["read"], format="rfc3339"
182
+ )
183
+ """The time when the item began execution."""
184
+ end_execution_time: Optional[datetime.datetime] = rest_field(
185
+ name="endExecutionTime", visibility=["read"], format="rfc3339"
186
+ )
187
+ """The time when the item finished execution."""
188
+ cost_estimate: Optional["_models.CostEstimate"] = rest_field(name="costEstimate", visibility=["read"])
189
+ """Cost estimate."""
190
+ error_data: Optional["_models.WorkspaceItemError"] = rest_field(name="errorData", visibility=["read"])
191
+ """Error information."""
192
+
193
+ @overload
195
194
  def __init__(
196
195
  self,
197
196
  *,
198
- id: str, # pylint: disable=redefined-builtin
199
197
  name: str,
200
198
  provider_id: str,
201
199
  target: str,
202
- cost_estimate: Optional["_models.CostEstimate"] = None,
203
- error_data: Optional["_models.ErrorData"] = None,
204
- **kwargs: Any
205
- ) -> None:
206
- """
207
- :keyword id: The id of the item. Required.
208
- :paramtype id: str
209
- :keyword name: The name of the item. It is not required for the name to be unique and it's only
210
- used for display purposes. Required.
211
- :paramtype name: str
212
- :keyword provider_id: The unique identifier for the provider. Required.
213
- :paramtype provider_id: str
214
- :keyword target: The target identifier to run the job. Required.
215
- :paramtype target: str
216
- :keyword cost_estimate: The job cost billed by the provider. The final cost on your bill might
217
- be slightly different due to added taxes and currency conversion rates.
218
- :paramtype cost_estimate: ~azure.quantum._client.models.CostEstimate
219
- :keyword error_data: An error response from Azure.
220
- :paramtype error_data: ~azure.quantum._client.models.ErrorData
221
- """
222
- super().__init__(**kwargs)
223
- self.id = id
224
- self.name = name
225
- self.provider_id = provider_id
226
- self.target = target
227
- self.item_type: Optional[str] = None
228
- self.creation_time = None
229
- self.begin_execution_time = None
230
- self.end_execution_time = None
231
- self.cost_estimate = cost_estimate
232
- self.error_data = error_data
233
-
234
-
235
- class ItemDetailsList(_serialization.Model):
236
- """List of item details.
237
-
238
- All required parameters must be populated in order to send to server.
239
-
240
- :ivar value: Required.
241
- :vartype value: list[~azure.quantum._client.models.ItemDetails]
242
- :ivar next_link: Link to the next page of results.
243
- :vartype next_link: str
244
- """
245
-
246
- _validation = {
247
- "value": {"required": True},
248
- }
249
-
250
- _attribute_map = {
251
- "value": {"key": "value", "type": "[ItemDetails]"},
252
- "next_link": {"key": "nextLink", "type": "str"},
253
- }
200
+ item_type: str,
201
+ ) -> None: ...
254
202
 
255
- def __init__(self, *, value: List["_models.ItemDetails"], next_link: Optional[str] = None, **kwargs: Any) -> None:
203
+ @overload
204
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
256
205
  """
257
- :keyword value: Required.
258
- :paramtype value: list[~azure.quantum._client.models.ItemDetails]
259
- :keyword next_link: Link to the next page of results.
260
- :paramtype next_link: str
206
+ :param mapping: raw JSON to initialize the model.
207
+ :type mapping: Mapping[str, Any]
261
208
  """
262
- super().__init__(**kwargs)
263
- self.value = value
264
- self.next_link = next_link
265
209
 
210
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
211
+ super().__init__(*args, **kwargs)
266
212
 
267
- class JobDetails(ItemDetails): # pylint: disable=too-many-instance-attributes
268
- """Job details.
269
213
 
270
- Variables are only populated by the server, and will be ignored when sending a request.
214
+ class JobDetails(ItemDetails, discriminator="Job"):
215
+ """A job to be run in the workspace.
216
+
217
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
271
218
 
272
- All required parameters must be populated in order to send to server.
273
219
 
274
- :ivar id: The id of the item. Required.
275
- :vartype id: str
276
220
  :ivar name: The name of the item. It is not required for the name to be unique and it's only
277
221
  used for display purposes. Required.
278
222
  :vartype name: str
@@ -280,511 +224,278 @@ class JobDetails(ItemDetails): # pylint: disable=too-many-instance-attributes
280
224
  :vartype provider_id: str
281
225
  :ivar target: The target identifier to run the job. Required.
282
226
  :vartype target: str
283
- :ivar item_type: The type of item. Required. Known values are: "Job" and "Session".
284
- :vartype item_type: str or ~azure.quantum._client.models.ItemType
285
227
  :ivar creation_time: The creation time of the item.
286
228
  :vartype creation_time: ~datetime.datetime
287
229
  :ivar begin_execution_time: The time when the item began execution.
288
230
  :vartype begin_execution_time: ~datetime.datetime
289
231
  :ivar end_execution_time: The time when the item finished execution.
290
232
  :vartype end_execution_time: ~datetime.datetime
291
- :ivar cost_estimate: The job cost billed by the provider. The final cost on your bill might be
292
- slightly different due to added taxes and currency conversion rates.
293
- :vartype cost_estimate: ~azure.quantum._client.models.CostEstimate
294
- :ivar error_data: An error response from Azure.
295
- :vartype error_data: ~azure.quantum._client.models.ErrorData
233
+ :ivar cost_estimate: Cost estimate.
234
+ :vartype cost_estimate: ~azure.quantum.models.CostEstimate
235
+ :ivar error_data: Error information.
236
+ :vartype error_data: ~azure.quantum.models.WorkspaceItemError
237
+ :ivar id: Id of the job. Required.
238
+ :vartype id: str
239
+ :ivar item_type: Type of the Quantum Workspace item is Job. Required. A program, problem, or
240
+ application submitted for processing.
241
+ :vartype item_type: str or ~azure.quantum.models.JOB
296
242
  :ivar job_type: The type of job. Known values are: "Unknown", "QuantumComputing", and
297
243
  "Optimization".
298
- :vartype job_type: str or ~azure.quantum._client.models.JobType
244
+ :vartype job_type: str or ~azure.quantum.models.JobType
299
245
  :ivar session_id: The ID of the session that the job is part of.
300
246
  :vartype session_id: str
301
247
  :ivar container_uri: The blob container SAS uri, the container is used to host job data.
302
248
  Required.
303
249
  :vartype container_uri: str
304
- :ivar input_data_uri: The input blob SAS uri, if specified, it will override the default input
305
- blob in the container.
250
+ :ivar input_data_uri: The input blob URI, if specified, it will override the default input blob
251
+ in the container.
306
252
  :vartype input_data_uri: str
307
- :ivar input_data_format: The format of the input data. Required.
253
+ :ivar input_data_format: The format of the input data.
308
254
  :vartype input_data_format: str
309
- :ivar input_params: The input parameters for the job. JSON object used by the target solver. It
310
- is expected that the size of this object is small and only used to specify parameters for the
311
- execution target, not the input data.
312
- :vartype input_params: JSON
313
255
  :ivar status: The status of the job. Known values are: "Waiting", "Executing", "Succeeded",
314
256
  "Failed", and "Cancelled".
315
- :vartype status: str or ~azure.quantum._client.models.JobStatus
257
+ :vartype status: str or ~azure.quantum.models.JobStatus
316
258
  :ivar metadata: The job metadata. Metadata provides client the ability to store client-specific
317
259
  information.
318
- :vartype metadata: dict[str, str]
319
- :ivar output_data_uri: The output blob SAS uri. When a job finishes successfully, results will
320
- be uploaded to this blob.
321
- :vartype output_data_uri: str
322
- :ivar output_data_format: The format of the output data.
323
- :vartype output_data_format: str
260
+ :vartype metadata: any
324
261
  :ivar cancellation_time: The time when a job was successfully cancelled.
325
262
  :vartype cancellation_time: ~datetime.datetime
326
- :ivar quantum_computing_data: Quantum computing data.
327
- :vartype quantum_computing_data: ~azure.quantum._client.models.QuantumComputingData
328
263
  :ivar tags: List of user-supplied tags associated with the job.
329
264
  :vartype tags: list[str]
265
+ :ivar quantum_computing_data: Quantum computing data.
266
+ :vartype quantum_computing_data: ~azure.quantum.models.QuantumComputingData
267
+ :ivar input_params: The input parameters for the job. JSON object used by the target solver. It
268
+ is expected that the size of this object is small and only used to specify parameters for the
269
+ execution target, not the input data.
270
+ :vartype input_params: any
271
+ :ivar output_data_uri: The output blob uri. When a job finishes successfully, results will be
272
+ uploaded to this blob.
273
+ :vartype output_data_uri: str
274
+ :ivar output_data_format: The format of the output data.
275
+ :vartype output_data_format: str
330
276
  """
331
277
 
332
- _validation = {
333
- "id": {"required": True},
334
- "name": {"required": True},
335
- "provider_id": {"required": True},
336
- "target": {"required": True},
337
- "item_type": {"required": True},
338
- "creation_time": {"readonly": True},
339
- "begin_execution_time": {"readonly": True},
340
- "end_execution_time": {"readonly": True},
341
- "job_type": {"readonly": True},
342
- "container_uri": {"required": True},
343
- "input_data_format": {"required": True},
344
- "status": {"readonly": True},
345
- "cancellation_time": {"readonly": True},
346
- "quantum_computing_data": {"readonly": True},
347
- }
348
-
349
- _attribute_map = {
350
- "id": {"key": "id", "type": "str"},
351
- "name": {"key": "name", "type": "str"},
352
- "provider_id": {"key": "providerId", "type": "str"},
353
- "target": {"key": "target", "type": "str"},
354
- "item_type": {"key": "itemType", "type": "str"},
355
- "creation_time": {"key": "creationTime", "type": "iso-8601"},
356
- "begin_execution_time": {"key": "beginExecutionTime", "type": "iso-8601"},
357
- "end_execution_time": {"key": "endExecutionTime", "type": "iso-8601"},
358
- "cost_estimate": {"key": "costEstimate", "type": "CostEstimate"},
359
- "error_data": {"key": "errorData", "type": "ErrorData"},
360
- "job_type": {"key": "jobType", "type": "str"},
361
- "session_id": {"key": "sessionId", "type": "str"},
362
- "container_uri": {"key": "containerUri", "type": "str"},
363
- "input_data_uri": {"key": "inputDataUri", "type": "str"},
364
- "input_data_format": {"key": "inputDataFormat", "type": "str"},
365
- "input_params": {"key": "inputParams", "type": "object"},
366
- "status": {"key": "status", "type": "str"},
367
- "metadata": {"key": "metadata", "type": "{str}"},
368
- "output_data_uri": {"key": "outputDataUri", "type": "str"},
369
- "output_data_format": {"key": "outputDataFormat", "type": "str"},
370
- "cancellation_time": {"key": "cancellationTime", "type": "iso-8601"},
371
- "quantum_computing_data": {"key": "quantumComputingData", "type": "QuantumComputingData"},
372
- "tags": {"key": "tags", "type": "[str]"},
373
- }
374
-
278
+ item_type: Literal[ItemType.JOB] = rest_discriminator(name="itemType", visibility=["read", "create"]) # type: ignore # pylint: disable=line-too-long
279
+ """Type of the Quantum Workspace item is Job. Required. A program, problem, or application
280
+ submitted for processing."""
281
+ job_type: Optional[Union[str, "_models.JobType"]] = rest_field(name="jobType", visibility=["read", "create"])
282
+ """The type of job. Known values are: \"Unknown\", \"QuantumComputing\", and \"Optimization\"."""
283
+ session_id: Optional[str] = rest_field(name="sessionId", visibility=["read", "create"])
284
+ """The ID of the session that the job is part of."""
285
+ container_uri: str = rest_field(name="containerUri", visibility=["read", "create"])
286
+ """The blob container SAS uri, the container is used to host job data. Required."""
287
+ input_data_uri: Optional[str] = rest_field(name="inputDataUri", visibility=["read", "create"])
288
+ """The input blob URI, if specified, it will override the default input blob in the container."""
289
+ input_data_format: Optional[str] = rest_field(name="inputDataFormat", visibility=["read", "create"])
290
+ """The format of the input data."""
291
+ status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"])
292
+ """The status of the job. Known values are: \"Waiting\", \"Executing\", \"Succeeded\", \"Failed\",
293
+ and \"Cancelled\"."""
294
+ metadata: Optional[Any] = rest_field(visibility=["read", "create", "update"])
295
+ """The job metadata. Metadata provides client the ability to store client-specific information."""
296
+ cancellation_time: Optional[datetime.datetime] = rest_field(
297
+ name="cancellationTime", visibility=["read"], format="rfc3339"
298
+ )
299
+ """The time when a job was successfully cancelled."""
300
+ tags: Optional[List[str]] = rest_field(visibility=["read", "create", "update"])
301
+ """List of user-supplied tags associated with the job."""
302
+ quantum_computing_data: Optional["_models.QuantumComputingData"] = rest_field(
303
+ name="quantumComputingData", visibility=["read"]
304
+ )
305
+ """Quantum computing data."""
306
+ input_params: Optional[Any] = rest_field(name="inputParams", visibility=["read", "create"])
307
+ """The input parameters for the job. JSON object used by the target solver. It is expected that
308
+ the size of this object is small and only used to specify parameters for the execution target,
309
+ not the input data."""
310
+ output_data_uri: Optional[str] = rest_field(name="outputDataUri", visibility=["read", "create"])
311
+ """The output blob uri. When a job finishes successfully, results will be uploaded to this blob."""
312
+ output_data_format: Optional[str] = rest_field(name="outputDataFormat", visibility=["read", "create"])
313
+ """The format of the output data."""
314
+
315
+ @overload
375
316
  def __init__(
376
317
  self,
377
318
  *,
378
- id: str, # pylint: disable=redefined-builtin
379
319
  name: str,
380
320
  provider_id: str,
381
321
  target: str,
382
322
  container_uri: str,
383
- input_data_format: str,
384
- cost_estimate: Optional["_models.CostEstimate"] = None,
385
- error_data: Optional["_models.ErrorData"] = None,
323
+ job_type: Optional[Union[str, "_models.JobType"]] = None,
386
324
  session_id: Optional[str] = None,
387
325
  input_data_uri: Optional[str] = None,
388
- input_params: Optional[JSON] = None,
389
- metadata: Optional[Dict[str, str]] = None,
326
+ input_data_format: Optional[str] = None,
327
+ metadata: Optional[Any] = None,
328
+ tags: Optional[List[str]] = None,
329
+ input_params: Optional[Any] = None,
390
330
  output_data_uri: Optional[str] = None,
391
331
  output_data_format: Optional[str] = None,
392
- tags: Optional[List[str]] = None,
393
- **kwargs: Any
394
- ) -> None:
395
- """
396
- :keyword id: The id of the item. Required.
397
- :paramtype id: str
398
- :keyword name: The name of the item. It is not required for the name to be unique and it's only
399
- used for display purposes. Required.
400
- :paramtype name: str
401
- :keyword provider_id: The unique identifier for the provider. Required.
402
- :paramtype provider_id: str
403
- :keyword target: The target identifier to run the job. Required.
404
- :paramtype target: str
405
- :keyword cost_estimate: The job cost billed by the provider. The final cost on your bill might
406
- be slightly different due to added taxes and currency conversion rates.
407
- :paramtype cost_estimate: ~azure.quantum._client.models.CostEstimate
408
- :keyword error_data: An error response from Azure.
409
- :paramtype error_data: ~azure.quantum._client.models.ErrorData
410
- :keyword session_id: The ID of the session that the job is part of.
411
- :paramtype session_id: str
412
- :keyword container_uri: The blob container SAS uri, the container is used to host job data.
413
- Required.
414
- :paramtype container_uri: str
415
- :keyword input_data_uri: The input blob SAS uri, if specified, it will override the default
416
- input blob in the container.
417
- :paramtype input_data_uri: str
418
- :keyword input_data_format: The format of the input data. Required.
419
- :paramtype input_data_format: str
420
- :keyword input_params: The input parameters for the job. JSON object used by the target solver.
421
- It is expected that the size of this object is small and only used to specify parameters for
422
- the execution target, not the input data.
423
- :paramtype input_params: JSON
424
- :keyword metadata: The job metadata. Metadata provides client the ability to store
425
- client-specific information.
426
- :paramtype metadata: dict[str, str]
427
- :keyword output_data_uri: The output blob SAS uri. When a job finishes successfully, results
428
- will be uploaded to this blob.
429
- :paramtype output_data_uri: str
430
- :keyword output_data_format: The format of the output data.
431
- :paramtype output_data_format: str
432
- :keyword tags: List of user-supplied tags associated with the job.
433
- :paramtype tags: list[str]
434
- """
435
- super().__init__(
436
- id=id,
437
- name=name,
438
- provider_id=provider_id,
439
- target=target,
440
- cost_estimate=cost_estimate,
441
- error_data=error_data,
442
- **kwargs
443
- )
444
- self.item_type: str = "Job"
445
- self.job_type = None
446
- self.session_id = session_id
447
- self.container_uri = container_uri
448
- self.input_data_uri = input_data_uri
449
- self.input_data_format = input_data_format
450
- self.input_params = input_params
451
- self.status = None
452
- self.metadata = metadata
453
- self.output_data_uri = output_data_uri
454
- self.output_data_format = output_data_format
455
- self.cancellation_time = None
456
- self.quantum_computing_data = None
457
- self.tags = tags
458
-
459
-
460
- class JobDetailsList(_serialization.Model):
461
- """List of job details.
462
-
463
- :ivar value:
464
- :vartype value: list[~azure.quantum._client.models.JobDetails]
465
- :ivar next_link: Link to the next page of results.
466
- :vartype next_link: str
467
- """
468
-
469
- _attribute_map = {
470
- "value": {"key": "value", "type": "[JobDetails]"},
471
- "next_link": {"key": "nextLink", "type": "str"},
472
- }
332
+ ) -> None: ...
473
333
 
474
- def __init__(
475
- self, *, value: Optional[List["_models.JobDetails"]] = None, next_link: Optional[str] = None, **kwargs: Any
476
- ) -> None:
334
+ @overload
335
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
477
336
  """
478
- :keyword value:
479
- :paramtype value: list[~azure.quantum._client.models.JobDetails]
480
- :keyword next_link: Link to the next page of results.
481
- :paramtype next_link: str
337
+ :param mapping: raw JSON to initialize the model.
338
+ :type mapping: Mapping[str, Any]
482
339
  """
483
- super().__init__(**kwargs)
484
- self.value = value
485
- self.next_link = next_link
340
+
341
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
342
+ super().__init__(*args, item_type=ItemType.JOB, **kwargs)
486
343
 
487
344
 
488
- class JsonPatchDocument(_serialization.Model):
489
- """A JSONPatch document as defined by RFC 6902.
345
+ class JsonPatchObject(_model_base.Model):
346
+ """A JSONPatch object as defined by RFC 6902.
490
347
 
491
348
  All required parameters must be populated in order to send to server.
492
349
 
493
- :ivar op: The operation to be performed. Required. Known values are: "add", "remove",
350
+ :ivar operation: The operation to be performed. Required. Known values are: "add", "remove",
494
351
  "replace", "move", "copy", and "test".
495
- :vartype op: str or ~azure.quantum._client.models.JsonPatchOperation
352
+ :vartype operation: str or ~azure.quantum.models.JsonPatchOperation
496
353
  :ivar path: A JSON-Pointer. Required.
497
354
  :vartype path: str
498
355
  :ivar value: A value to be used in the operation on the path.
499
- :vartype value: JSON
356
+ :vartype value: any
500
357
  :ivar from_property: Optional field used in copy and move operations.
501
358
  :vartype from_property: str
502
359
  """
503
360
 
504
- _validation = {
505
- "op": {"required": True},
506
- "path": {"required": True},
507
- }
508
-
509
- _attribute_map = {
510
- "op": {"key": "op", "type": "str"},
511
- "path": {"key": "path", "type": "str"},
512
- "value": {"key": "value", "type": "object"},
513
- "from_property": {"key": "from", "type": "str"},
514
- }
515
-
361
+ operation: Union[str, "_models.JsonPatchOperation"] = rest_field(name="op", visibility=["create"])
362
+ """The operation to be performed. Required. Known values are: \"add\", \"remove\", \"replace\",
363
+ \"move\", \"copy\", and \"test\"."""
364
+ path: str = rest_field(visibility=["create"])
365
+ """A JSON-Pointer. Required."""
366
+ value: Optional[Any] = rest_field(visibility=["create"])
367
+ """A value to be used in the operation on the path."""
368
+ from_property: Optional[str] = rest_field(name="from", visibility=["create"])
369
+ """Optional field used in copy and move operations."""
370
+
371
+ @overload
516
372
  def __init__(
517
373
  self,
518
374
  *,
519
- op: Union[str, "_models.JsonPatchOperation"],
375
+ operation: Union[str, "_models.JsonPatchOperation"],
520
376
  path: str,
521
- value: Optional[JSON] = None,
377
+ value: Optional[Any] = None,
522
378
  from_property: Optional[str] = None,
523
- **kwargs: Any
524
- ) -> None:
379
+ ) -> None: ...
380
+
381
+ @overload
382
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
525
383
  """
526
- :keyword op: The operation to be performed. Required. Known values are: "add", "remove",
527
- "replace", "move", "copy", and "test".
528
- :paramtype op: str or ~azure.quantum._client.models.JsonPatchOperation
529
- :keyword path: A JSON-Pointer. Required.
530
- :paramtype path: str
531
- :keyword value: A value to be used in the operation on the path.
532
- :paramtype value: JSON
533
- :keyword from_property: Optional field used in copy and move operations.
534
- :paramtype from_property: str
384
+ :param mapping: raw JSON to initialize the model.
385
+ :type mapping: Mapping[str, Any]
535
386
  """
536
- super().__init__(**kwargs)
537
- self.op = op
538
- self.path = path
539
- self.value = value
540
- self.from_property = from_property
541
387
 
388
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
389
+ super().__init__(*args, **kwargs)
542
390
 
543
- class ProviderStatus(_serialization.Model):
544
- """Providers status.
545
391
 
546
- :ivar id: Provider id.
547
- :vartype id: str
548
- :ivar current_availability: Provider availability. Known values are: "Available", "Degraded",
549
- and "Unavailable".
550
- :vartype current_availability: str or ~azure.quantum._client.models.ProviderAvailability
551
- :ivar targets:
552
- :vartype targets: list[~azure.quantum._client.models.TargetStatus]
553
- """
392
+ class ProviderStatus(_model_base.Model):
393
+ """Provider status.
554
394
 
555
- _attribute_map = {
556
- "id": {"key": "id", "type": "str"},
557
- "current_availability": {"key": "currentAvailability", "type": "str"},
558
- "targets": {"key": "targets", "type": "[TargetStatus]"},
559
- }
560
-
561
- def __init__(
562
- self,
563
- *,
564
- id: Optional[str] = None, # pylint: disable=redefined-builtin
565
- current_availability: Optional[Union[str, "_models.ProviderAvailability"]] = None,
566
- targets: Optional[List["_models.TargetStatus"]] = None,
567
- **kwargs: Any
568
- ) -> None:
569
- """
570
- :keyword id: Provider id.
571
- :paramtype id: str
572
- :keyword current_availability: Provider availability. Known values are: "Available",
573
- "Degraded", and "Unavailable".
574
- :paramtype current_availability: str or ~azure.quantum._client.models.ProviderAvailability
575
- :keyword targets:
576
- :paramtype targets: list[~azure.quantum._client.models.TargetStatus]
577
- """
578
- super().__init__(**kwargs)
579
- self.id = id
580
- self.current_availability = current_availability
581
- self.targets = targets
395
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
582
396
 
583
397
 
584
- class ProviderStatusList(_serialization.Model):
585
- """Providers status.
586
-
587
- :ivar value:
588
- :vartype value: list[~azure.quantum._client.models.ProviderStatus]
589
- :ivar next_link: Link to the next page of results.
590
- :vartype next_link: str
398
+ :ivar id: Provider id. Required.
399
+ :vartype id: str
400
+ :ivar current_availability: Current provider availability. Required. Known values are:
401
+ "Available", "Degraded", and "Unavailable".
402
+ :vartype current_availability: str or ~azure.quantum.models.ProviderAvailability
403
+ :ivar targets: Current target statuses. Required.
404
+ :vartype targets: list[~azure.quantum.models.TargetStatus]
591
405
  """
592
406
 
593
- _attribute_map = {
594
- "value": {"key": "value", "type": "[ProviderStatus]"},
595
- "next_link": {"key": "nextLink", "type": "str"},
596
- }
597
-
598
- def __init__(
599
- self, *, value: Optional[List["_models.ProviderStatus"]] = None, next_link: Optional[str] = None, **kwargs: Any
600
- ) -> None:
601
- """
602
- :keyword value:
603
- :paramtype value: list[~azure.quantum._client.models.ProviderStatus]
604
- :keyword next_link: Link to the next page of results.
605
- :paramtype next_link: str
606
- """
607
- super().__init__(**kwargs)
608
- self.value = value
609
- self.next_link = next_link
407
+ id: str = rest_field(visibility=["read"])
408
+ """Provider id. Required."""
409
+ current_availability: Union[str, "_models.ProviderAvailability"] = rest_field(
410
+ name="currentAvailability", visibility=["read"]
411
+ )
412
+ """Current provider availability. Required. Known values are: \"Available\", \"Degraded\", and
413
+ \"Unavailable\"."""
414
+ targets: List["_models.TargetStatus"] = rest_field(visibility=["read"])
415
+ """Current target statuses. Required."""
610
416
 
611
417
 
612
- class QuantumComputingData(_serialization.Model):
418
+ class QuantumComputingData(_model_base.Model):
613
419
  """Quantum computing data.
614
420
 
615
- :ivar count: The number of quantum computing items in the job.
421
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
422
+
423
+
424
+ :ivar count: The number of quantum computing items in the job. Required.
616
425
  :vartype count: int
617
426
  """
618
427
 
619
- _attribute_map = {
620
- "count": {"key": "count", "type": "int"},
621
- }
622
-
623
- def __init__(self, *, count: Optional[int] = None, **kwargs: Any) -> None:
624
- """
625
- :keyword count: The number of quantum computing items in the job.
626
- :paramtype count: int
627
- """
628
- super().__init__(**kwargs)
629
- self.count = count
428
+ count: int = rest_field(visibility=["read"])
429
+ """The number of quantum computing items in the job. Required."""
630
430
 
631
431
 
632
- class Quota(_serialization.Model):
432
+ class Quota(_model_base.Model):
633
433
  """Quota information.
634
434
 
635
- :ivar dimension: The name of the dimension associated with the quota.
435
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
436
+
437
+
438
+ :ivar dimension: The name of the dimension associated with the quota. Required.
636
439
  :vartype dimension: str
637
- :ivar scope: The scope at which the quota is applied. Known values are: "Workspace" and
638
- "Subscription".
639
- :vartype scope: str or ~azure.quantum._client.models.DimensionScope
640
- :ivar provider_id: The unique identifier for the provider.
440
+ :ivar scope: The scope at which the quota is applied. Required. Known values are: "Workspace"
441
+ and "Subscription".
442
+ :vartype scope: str or ~azure.quantum.models.DimensionScope
443
+ :ivar provider_id: The unique identifier for the provider. Required.
641
444
  :vartype provider_id: str
642
445
  :ivar utilization: The amount of the usage that has been applied for the current period.
446
+ Required.
643
447
  :vartype utilization: float
644
448
  :ivar holds: The amount of the usage that has been reserved but not applied for the current
645
- period.
449
+ period. Required.
646
450
  :vartype holds: float
647
- :ivar limit: The maximum amount of usage allowed for the current period.
451
+ :ivar limit: The maximum amount of usage allowed for the current period. Required.
648
452
  :vartype limit: float
649
453
  :ivar period: The time period in which the quota's underlying meter is accumulated. Based on
650
- calendar year. 'None' is used for concurrent quotas. Known values are: "None" and "Monthly".
651
- :vartype period: str or ~azure.quantum._client.models.MeterPeriod
652
- """
653
-
654
- _attribute_map = {
655
- "dimension": {"key": "dimension", "type": "str"},
656
- "scope": {"key": "scope", "type": "str"},
657
- "provider_id": {"key": "providerId", "type": "str"},
658
- "utilization": {"key": "utilization", "type": "float"},
659
- "holds": {"key": "holds", "type": "float"},
660
- "limit": {"key": "limit", "type": "float"},
661
- "period": {"key": "period", "type": "str"},
662
- }
663
-
664
- def __init__(
665
- self,
666
- *,
667
- dimension: Optional[str] = None,
668
- scope: Optional[Union[str, "_models.DimensionScope"]] = None,
669
- provider_id: Optional[str] = None,
670
- utilization: Optional[float] = None,
671
- holds: Optional[float] = None,
672
- limit: Optional[float] = None,
673
- period: Optional[Union[str, "_models.MeterPeriod"]] = None,
674
- **kwargs: Any
675
- ) -> None:
676
- """
677
- :keyword dimension: The name of the dimension associated with the quota.
678
- :paramtype dimension: str
679
- :keyword scope: The scope at which the quota is applied. Known values are: "Workspace" and
680
- "Subscription".
681
- :paramtype scope: str or ~azure.quantum._client.models.DimensionScope
682
- :keyword provider_id: The unique identifier for the provider.
683
- :paramtype provider_id: str
684
- :keyword utilization: The amount of the usage that has been applied for the current period.
685
- :paramtype utilization: float
686
- :keyword holds: The amount of the usage that has been reserved but not applied for the current
687
- period.
688
- :paramtype holds: float
689
- :keyword limit: The maximum amount of usage allowed for the current period.
690
- :paramtype limit: float
691
- :keyword period: The time period in which the quota's underlying meter is accumulated. Based on
692
- calendar year. 'None' is used for concurrent quotas. Known values are: "None" and "Monthly".
693
- :paramtype period: str or ~azure.quantum._client.models.MeterPeriod
694
- """
695
- super().__init__(**kwargs)
696
- self.dimension = dimension
697
- self.scope = scope
698
- self.provider_id = provider_id
699
- self.utilization = utilization
700
- self.holds = holds
701
- self.limit = limit
702
- self.period = period
703
-
704
-
705
- class QuotaList(_serialization.Model):
706
- """List of quotas.
707
-
708
- :ivar value:
709
- :vartype value: list[~azure.quantum._client.models.Quota]
710
- :ivar next_link: Link to the next page of results.
711
- :vartype next_link: str
712
- """
713
-
714
- _attribute_map = {
715
- "value": {"key": "value", "type": "[Quota]"},
716
- "next_link": {"key": "nextLink", "type": "str"},
717
- }
718
-
719
- def __init__(
720
- self, *, value: Optional[List["_models.Quota"]] = None, next_link: Optional[str] = None, **kwargs: Any
721
- ) -> None:
722
- """
723
- :keyword value:
724
- :paramtype value: list[~azure.quantum._client.models.Quota]
725
- :keyword next_link: Link to the next page of results.
726
- :paramtype next_link: str
727
- """
728
- super().__init__(**kwargs)
729
- self.value = value
730
- self.next_link = next_link
731
-
732
-
733
- class RestError(_serialization.Model):
734
- """Error information returned by the API.
735
-
736
- All required parameters must be populated in order to send to server.
737
-
738
- :ivar error: An error response from Azure. Required.
739
- :vartype error: ~azure.quantum._client.models.ErrorData
454
+ calendar year. 'None' is used for concurrent quotas. Required. Known values are: "None" and
455
+ "Monthly".
456
+ :vartype period: str or ~azure.quantum.models.MeterPeriod
740
457
  """
741
458
 
742
- _validation = {
743
- "error": {"required": True},
744
- }
459
+ dimension: str = rest_field(visibility=["read"])
460
+ """The name of the dimension associated with the quota. Required."""
461
+ scope: Union[str, "_models.DimensionScope"] = rest_field(visibility=["read"])
462
+ """The scope at which the quota is applied. Required. Known values are: \"Workspace\" and
463
+ \"Subscription\"."""
464
+ provider_id: str = rest_field(name="providerId", visibility=["read"])
465
+ """The unique identifier for the provider. Required."""
466
+ utilization: float = rest_field(visibility=["read"])
467
+ """The amount of the usage that has been applied for the current period. Required."""
468
+ holds: float = rest_field(visibility=["read"])
469
+ """The amount of the usage that has been reserved but not applied for the current period.
470
+ Required."""
471
+ limit: float = rest_field(visibility=["read"])
472
+ """The maximum amount of usage allowed for the current period. Required."""
473
+ period: Union[str, "_models.MeterPeriod"] = rest_field(visibility=["read"])
474
+ """The time period in which the quota's underlying meter is accumulated. Based on calendar year.
475
+ 'None' is used for concurrent quotas. Required. Known values are: \"None\" and \"Monthly\"."""
745
476
 
746
- _attribute_map = {
747
- "error": {"key": "error", "type": "ErrorData"},
748
- }
749
477
 
750
- def __init__(self, *, error: "_models.ErrorData", **kwargs: Any) -> None:
751
- """
752
- :keyword error: An error response from Azure. Required.
753
- :paramtype error: ~azure.quantum._client.models.ErrorData
754
- """
755
- super().__init__(**kwargs)
756
- self.error = error
478
+ class SasUriResponse(_model_base.Model):
479
+ """SAS URI operation response.
757
480
 
481
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
758
482
 
759
- class SasUriResponse(_serialization.Model):
760
- """Get SAS URL operation response.
761
483
 
762
484
  :ivar sas_uri: A URL with a SAS token to upload a blob for execution in the given workspace.
485
+ Required.
763
486
  :vartype sas_uri: str
764
487
  """
765
488
 
766
- _attribute_map = {
767
- "sas_uri": {"key": "sasUri", "type": "str"},
768
- }
769
-
770
- def __init__(self, *, sas_uri: Optional[str] = None, **kwargs: Any) -> None:
771
- """
772
- :keyword sas_uri: A URL with a SAS token to upload a blob for execution in the given workspace.
773
- :paramtype sas_uri: str
774
- """
775
- super().__init__(**kwargs)
776
- self.sas_uri = sas_uri
489
+ sas_uri: str = rest_field(name="sasUri", visibility=["read"])
490
+ """A URL with a SAS token to upload a blob for execution in the given workspace. Required."""
777
491
 
778
492
 
779
- class SessionDetails(ItemDetails): # pylint: disable=too-many-instance-attributes
780
- """Session details.
493
+ class SessionDetails(ItemDetails, discriminator="Session"):
494
+ """Session, a logical grouping of jobs.
781
495
 
782
- Variables are only populated by the server, and will be ignored when sending a request.
496
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
783
497
 
784
- All required parameters must be populated in order to send to server.
785
498
 
786
- :ivar id: The id of the item. Required.
787
- :vartype id: str
788
499
  :ivar name: The name of the item. It is not required for the name to be unique and it's only
789
500
  used for display purposes. Required.
790
501
  :vartype name: str
@@ -792,230 +503,190 @@ class SessionDetails(ItemDetails): # pylint: disable=too-many-instance-attribut
792
503
  :vartype provider_id: str
793
504
  :ivar target: The target identifier to run the job. Required.
794
505
  :vartype target: str
795
- :ivar item_type: The type of item. Required. Known values are: "Job" and "Session".
796
- :vartype item_type: str or ~azure.quantum._client.models.ItemType
797
506
  :ivar creation_time: The creation time of the item.
798
507
  :vartype creation_time: ~datetime.datetime
799
508
  :ivar begin_execution_time: The time when the item began execution.
800
509
  :vartype begin_execution_time: ~datetime.datetime
801
510
  :ivar end_execution_time: The time when the item finished execution.
802
511
  :vartype end_execution_time: ~datetime.datetime
803
- :ivar cost_estimate: The job cost billed by the provider. The final cost on your bill might be
804
- slightly different due to added taxes and currency conversion rates.
805
- :vartype cost_estimate: ~azure.quantum._client.models.CostEstimate
806
- :ivar error_data: An error response from Azure.
807
- :vartype error_data: ~azure.quantum._client.models.ErrorData
512
+ :ivar cost_estimate: Cost estimate.
513
+ :vartype cost_estimate: ~azure.quantum.models.CostEstimate
514
+ :ivar error_data: Error information.
515
+ :vartype error_data: ~azure.quantum.models.WorkspaceItemError
516
+ :ivar id: Id of the session. Required.
517
+ :vartype id: str
518
+ :ivar item_type: Type of the Quantum Workspace item is Session. Required. A logical grouping of
519
+ jobs.
520
+ :vartype item_type: str or ~azure.quantum.models.SESSION
808
521
  :ivar job_failure_policy: Policy controlling the behavior of the Session when a job in the
809
- session fails. Known values are: "Abort" and "Continue".
810
- :vartype job_failure_policy: str or ~azure.quantum._client.models.SessionJobFailurePolicy
522
+ session fails. Required. Known values are: "Abort" and "Continue".
523
+ :vartype job_failure_policy: str or ~azure.quantum.models.SessionJobFailurePolicy
811
524
  :ivar status: The status of the session. Known values are: "Waiting", "Executing", "Succeeded",
812
525
  "Failed", "Failure(s)", and "TimedOut".
813
- :vartype status: str or ~azure.quantum._client.models.SessionStatus
526
+ :vartype status: str or ~azure.quantum.models.SessionStatus
814
527
  """
815
528
 
816
- _validation = {
817
- "id": {"required": True},
818
- "name": {"required": True},
819
- "provider_id": {"required": True},
820
- "target": {"required": True},
821
- "item_type": {"required": True},
822
- "creation_time": {"readonly": True},
823
- "begin_execution_time": {"readonly": True},
824
- "end_execution_time": {"readonly": True},
825
- "status": {"readonly": True},
826
- }
827
-
828
- _attribute_map = {
829
- "id": {"key": "id", "type": "str"},
830
- "name": {"key": "name", "type": "str"},
831
- "provider_id": {"key": "providerId", "type": "str"},
832
- "target": {"key": "target", "type": "str"},
833
- "item_type": {"key": "itemType", "type": "str"},
834
- "creation_time": {"key": "creationTime", "type": "iso-8601"},
835
- "begin_execution_time": {"key": "beginExecutionTime", "type": "iso-8601"},
836
- "end_execution_time": {"key": "endExecutionTime", "type": "iso-8601"},
837
- "cost_estimate": {"key": "costEstimate", "type": "CostEstimate"},
838
- "error_data": {"key": "errorData", "type": "ErrorData"},
839
- "job_failure_policy": {"key": "jobFailurePolicy", "type": "str"},
840
- "status": {"key": "status", "type": "str"},
841
- }
842
-
529
+ item_type: Literal[ItemType.SESSION] = rest_discriminator(name="itemType", visibility=["read", "create"]) # type: ignore # pylint: disable=line-too-long
530
+ """Type of the Quantum Workspace item is Session. Required. A logical grouping of jobs."""
531
+ job_failure_policy: Union[str, "_models.SessionJobFailurePolicy"] = rest_field(
532
+ name="jobFailurePolicy", visibility=["read", "create"]
533
+ )
534
+ """Policy controlling the behavior of the Session when a job in the session fails. Required. Known
535
+ values are: \"Abort\" and \"Continue\"."""
536
+ status: Optional[Union[str, "_models.SessionStatus"]] = rest_field(visibility=["read"])
537
+ """The status of the session. Known values are: \"Waiting\", \"Executing\", \"Succeeded\",
538
+ \"Failed\", \"Failure(s)\", and \"TimedOut\"."""
539
+
540
+ @overload
843
541
  def __init__(
844
542
  self,
845
543
  *,
846
- id: str, # pylint: disable=redefined-builtin
847
544
  name: str,
848
545
  provider_id: str,
849
546
  target: str,
850
- cost_estimate: Optional["_models.CostEstimate"] = None,
851
- error_data: Optional["_models.ErrorData"] = None,
852
- job_failure_policy: Union[str, "_models.SessionJobFailurePolicy"] = "Abort",
853
- **kwargs: Any
854
- ) -> None:
855
- """
856
- :keyword id: The id of the item. Required.
857
- :paramtype id: str
858
- :keyword name: The name of the item. It is not required for the name to be unique and it's only
859
- used for display purposes. Required.
860
- :paramtype name: str
861
- :keyword provider_id: The unique identifier for the provider. Required.
862
- :paramtype provider_id: str
863
- :keyword target: The target identifier to run the job. Required.
864
- :paramtype target: str
865
- :keyword cost_estimate: The job cost billed by the provider. The final cost on your bill might
866
- be slightly different due to added taxes and currency conversion rates.
867
- :paramtype cost_estimate: ~azure.quantum._client.models.CostEstimate
868
- :keyword error_data: An error response from Azure.
869
- :paramtype error_data: ~azure.quantum._client.models.ErrorData
870
- :keyword job_failure_policy: Policy controlling the behavior of the Session when a job in the
871
- session fails. Known values are: "Abort" and "Continue".
872
- :paramtype job_failure_policy: str or ~azure.quantum._client.models.SessionJobFailurePolicy
873
- """
874
- super().__init__(
875
- id=id,
876
- name=name,
877
- provider_id=provider_id,
878
- target=target,
879
- cost_estimate=cost_estimate,
880
- error_data=error_data,
881
- **kwargs
882
- )
883
- self.item_type: str = "Session"
884
- self.job_failure_policy = job_failure_policy
885
- self.status = None
886
-
887
-
888
- class SessionDetailsList(_serialization.Model):
889
- """List of session details.
890
-
891
- :ivar value:
892
- :vartype value: list[~azure.quantum._client.models.SessionDetails]
893
- :ivar next_link: Link to the next page of results.
894
- :vartype next_link: str
895
- """
547
+ job_failure_policy: Union[str, "_models.SessionJobFailurePolicy"],
548
+ ) -> None: ...
896
549
 
897
- _attribute_map = {
898
- "value": {"key": "value", "type": "[SessionDetails]"},
899
- "next_link": {"key": "nextLink", "type": "str"},
900
- }
901
-
902
- def __init__(
903
- self, *, value: Optional[List["_models.SessionDetails"]] = None, next_link: Optional[str] = None, **kwargs: Any
904
- ) -> None:
550
+ @overload
551
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
905
552
  """
906
- :keyword value:
907
- :paramtype value: list[~azure.quantum._client.models.SessionDetails]
908
- :keyword next_link: Link to the next page of results.
909
- :paramtype next_link: str
553
+ :param mapping: raw JSON to initialize the model.
554
+ :type mapping: Mapping[str, Any]
910
555
  """
911
- super().__init__(**kwargs)
912
- self.value = value
913
- self.next_link = next_link
914
556
 
557
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
558
+ super().__init__(*args, item_type=ItemType.SESSION, **kwargs)
915
559
 
916
- class TargetStatus(_serialization.Model):
560
+
561
+ class TargetStatus(_model_base.Model):
917
562
  """Target status.
918
563
 
919
- :ivar id: Target id.
564
+ Readonly variables are only populated by the server, and will be ignored when sending a request.
565
+
566
+
567
+ :ivar id: Target id. Required.
920
568
  :vartype id: str
921
- :ivar current_availability: Target availability. Known values are: "Available", "Degraded", and
922
- "Unavailable".
923
- :vartype current_availability: str or ~azure.quantum._client.models.TargetAvailability
924
- :ivar average_queue_time: Average queue time in seconds.
569
+ :ivar current_availability: Current target availability. Required. Known values are:
570
+ "Available", "Degraded", and "Unavailable".
571
+ :vartype current_availability: str or ~azure.quantum.models.TargetAvailability
572
+ :ivar average_queue_time: Average queue time in seconds. Required.
925
573
  :vartype average_queue_time: int
926
574
  :ivar status_page: A page with detailed status of the provider.
927
575
  :vartype status_page: str
928
576
  """
929
577
 
930
- _attribute_map = {
931
- "id": {"key": "id", "type": "str"},
932
- "current_availability": {"key": "currentAvailability", "type": "str"},
933
- "average_queue_time": {"key": "averageQueueTime", "type": "int"},
934
- "status_page": {"key": "statusPage", "type": "str"},
935
- }
936
-
937
- def __init__(
938
- self,
939
- *,
940
- id: Optional[str] = None, # pylint: disable=redefined-builtin
941
- current_availability: Optional[Union[str, "_models.TargetAvailability"]] = None,
942
- average_queue_time: Optional[int] = None,
943
- status_page: Optional[str] = None,
944
- **kwargs: Any
945
- ) -> None:
946
- """
947
- :keyword id: Target id.
948
- :paramtype id: str
949
- :keyword current_availability: Target availability. Known values are: "Available", "Degraded",
950
- and "Unavailable".
951
- :paramtype current_availability: str or ~azure.quantum._client.models.TargetAvailability
952
- :keyword average_queue_time: Average queue time in seconds.
953
- :paramtype average_queue_time: int
954
- :keyword status_page: A page with detailed status of the provider.
955
- :paramtype status_page: str
956
- """
957
- super().__init__(**kwargs)
958
- self.id = id
959
- self.current_availability = current_availability
960
- self.average_queue_time = average_queue_time
961
- self.status_page = status_page
578
+ id: str = rest_field(visibility=["read"])
579
+ """Target id. Required."""
580
+ current_availability: Union[str, "_models.TargetAvailability"] = rest_field(
581
+ name="currentAvailability", visibility=["read"]
582
+ )
583
+ """Current target availability. Required. Known values are: \"Available\", \"Degraded\", and
584
+ \"Unavailable\"."""
585
+ average_queue_time: int = rest_field(name="averageQueueTime", visibility=["read"])
586
+ """Average queue time in seconds. Required."""
587
+ status_page: Optional[str] = rest_field(name="statusPage", visibility=["read"])
588
+ """A page with detailed status of the provider."""
962
589
 
963
590
 
964
- class UsageEvent(_serialization.Model):
591
+ class UsageEvent(_model_base.Model):
965
592
  """Usage event details.
966
593
 
967
- :ivar dimension_id: The dimension id.
594
+
595
+ :ivar dimension_id: The dimension id. Required.
968
596
  :vartype dimension_id: str
969
- :ivar dimension_name: The dimension name.
597
+ :ivar dimension_name: The dimension name. Required.
970
598
  :vartype dimension_name: str
971
- :ivar measure_unit: The unit of measure.
599
+ :ivar measure_unit: The unit of measure. Required.
972
600
  :vartype measure_unit: str
973
- :ivar amount_billed: The amount billed.
601
+ :ivar amount_billed: The amount billed. Required.
974
602
  :vartype amount_billed: float
975
- :ivar amount_consumed: The amount consumed.
603
+ :ivar amount_consumed: The amount consumed. Required.
976
604
  :vartype amount_consumed: float
977
- :ivar unit_price: The unit price.
605
+ :ivar unit_price: The unit price. Required.
978
606
  :vartype unit_price: float
979
607
  """
980
608
 
981
- _attribute_map = {
982
- "dimension_id": {"key": "dimensionId", "type": "str"},
983
- "dimension_name": {"key": "dimensionName", "type": "str"},
984
- "measure_unit": {"key": "measureUnit", "type": "str"},
985
- "amount_billed": {"key": "amountBilled", "type": "float"},
986
- "amount_consumed": {"key": "amountConsumed", "type": "float"},
987
- "unit_price": {"key": "unitPrice", "type": "float"},
988
- }
609
+ dimension_id: str = rest_field(name="dimensionId")
610
+ """The dimension id. Required."""
611
+ dimension_name: str = rest_field(name="dimensionName")
612
+ """The dimension name. Required."""
613
+ measure_unit: str = rest_field(name="measureUnit")
614
+ """The unit of measure. Required."""
615
+ amount_billed: float = rest_field(name="amountBilled")
616
+ """The amount billed. Required."""
617
+ amount_consumed: float = rest_field(name="amountConsumed")
618
+ """The amount consumed. Required."""
619
+ unit_price: float = rest_field(name="unitPrice")
620
+ """The unit price. Required."""
621
+
622
+ @overload
623
+ def __init__(
624
+ self,
625
+ *,
626
+ dimension_id: str,
627
+ dimension_name: str,
628
+ measure_unit: str,
629
+ amount_billed: float,
630
+ amount_consumed: float,
631
+ unit_price: float,
632
+ ) -> None: ...
633
+
634
+ @overload
635
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
636
+ """
637
+ :param mapping: raw JSON to initialize the model.
638
+ :type mapping: Mapping[str, Any]
639
+ """
640
+
641
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
642
+ super().__init__(*args, **kwargs)
643
+
644
+
645
+ class WorkspaceItemError(_model_base.Model):
646
+ """The error object.
989
647
 
648
+
649
+ :ivar code: One of a server-defined set of error codes. Required.
650
+ :vartype code: str
651
+ :ivar message: A human-readable representation of the error. Required.
652
+ :vartype message: str
653
+ :ivar target: The target of the error.
654
+ :vartype target: str
655
+ :ivar details: An array of details about specific errors that led to this reported error.
656
+ :vartype details: list[~azure.core.ODataV4Format]
657
+ :ivar innererror: An object containing more specific information than the current object about
658
+ the error.
659
+ :vartype innererror: ~azure.quantum.models.InnerError
660
+ """
661
+
662
+ code: str = rest_field()
663
+ """One of a server-defined set of error codes. Required."""
664
+ message: str = rest_field()
665
+ """A human-readable representation of the error. Required."""
666
+ target: Optional[str] = rest_field()
667
+ """The target of the error."""
668
+ details: Optional[List[ODataV4Format]] = rest_field()
669
+ """An array of details about specific errors that led to this reported error."""
670
+ innererror: Optional["_models.InnerError"] = rest_field()
671
+ """An object containing more specific information than the current object about the error."""
672
+
673
+ @overload
990
674
  def __init__(
991
675
  self,
992
676
  *,
993
- dimension_id: Optional[str] = None,
994
- dimension_name: Optional[str] = None,
995
- measure_unit: Optional[str] = None,
996
- amount_billed: Optional[float] = None,
997
- amount_consumed: Optional[float] = None,
998
- unit_price: Optional[float] = None,
999
- **kwargs: Any
1000
- ) -> None:
677
+ code: str,
678
+ message: str,
679
+ target: Optional[str] = None,
680
+ details: Optional[List[ODataV4Format]] = None,
681
+ innererror: Optional["_models.InnerError"] = None,
682
+ ) -> None: ...
683
+
684
+ @overload
685
+ def __init__(self, mapping: Mapping[str, Any]) -> None:
1001
686
  """
1002
- :keyword dimension_id: The dimension id.
1003
- :paramtype dimension_id: str
1004
- :keyword dimension_name: The dimension name.
1005
- :paramtype dimension_name: str
1006
- :keyword measure_unit: The unit of measure.
1007
- :paramtype measure_unit: str
1008
- :keyword amount_billed: The amount billed.
1009
- :paramtype amount_billed: float
1010
- :keyword amount_consumed: The amount consumed.
1011
- :paramtype amount_consumed: float
1012
- :keyword unit_price: The unit price.
1013
- :paramtype unit_price: float
687
+ :param mapping: raw JSON to initialize the model.
688
+ :type mapping: Mapping[str, Any]
1014
689
  """
1015
- super().__init__(**kwargs)
1016
- self.dimension_id = dimension_id
1017
- self.dimension_name = dimension_name
1018
- self.measure_unit = measure_unit
1019
- self.amount_billed = amount_billed
1020
- self.amount_consumed = amount_consumed
1021
- self.unit_price = unit_price
690
+
691
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
692
+ super().__init__(*args, **kwargs)