azure-quantum 2.5.0.dev0__py3-none-any.whl → 2.5.0.dev2__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.
@@ -1,27 +1,30 @@
1
1
  # coding=utf-8
2
+ # pylint: disable=too-many-lines
2
3
  # --------------------------------------------------------------------------
3
4
  # Copyright (c) Microsoft Corporation. All rights reserved.
4
5
  # Licensed under the MIT License. See License.txt in the project root for license information.
5
- # Code generated by Microsoft (R) Python Code Generator.
6
+ # Code generated by Microsoft (R) AutoRest Code Generator.
6
7
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
8
  # --------------------------------------------------------------------------
8
- # pylint: disable=useless-super-delegation
9
9
 
10
- import datetime
11
- from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload
10
+ import sys
11
+ from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
12
12
 
13
- from azure.core.exceptions import ODataV4Format
13
+ from .. import _serialization
14
14
 
15
- from .. import _model_base
16
- from .._model_base import rest_discriminator, rest_field
17
- from ._enums import ItemType
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
18
19
 
19
20
  if TYPE_CHECKING:
21
+ # pylint: disable=unused-import,ungrouped-imports
20
22
  from .. import models as _models
23
+ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
21
24
 
22
25
 
23
- class BlobDetails(_model_base.Model):
24
- """The details (name and container) of the blob to store or download data.
26
+ class BlobDetails(_serialization.Model):
27
+ """Blob details.
25
28
 
26
29
  All required parameters must be populated in order to send to server.
27
30
 
@@ -31,115 +34,115 @@ class BlobDetails(_model_base.Model):
31
34
  :vartype blob_name: str
32
35
  """
33
36
 
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."""
37
+ _validation = {
38
+ "container_name": {"required": True},
39
+ }
38
40
 
39
- @overload
40
- def __init__(
41
- self,
42
- *,
43
- container_name: str,
44
- blob_name: Optional[str] = None,
45
- ) -> None: ...
41
+ _attribute_map = {
42
+ "container_name": {"key": "containerName", "type": "str"},
43
+ "blob_name": {"key": "blobName", "type": "str"},
44
+ }
46
45
 
47
- @overload
48
- def __init__(self, mapping: Mapping[str, Any]) -> None:
46
+ def __init__(self, *, container_name: str, blob_name: Optional[str] = None, **kwargs: Any) -> None:
49
47
  """
50
- :param mapping: raw JSON to initialize the model.
51
- :type mapping: Mapping[str, Any]
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
52
52
  """
53
+ super().__init__(**kwargs)
54
+ self.container_name = container_name
55
+ self.blob_name = blob_name
53
56
 
54
- def __init__(self, *args: Any, **kwargs: Any) -> None:
55
- super().__init__(*args, **kwargs)
56
57
 
57
-
58
- class CostEstimate(_model_base.Model):
58
+ class CostEstimate(_serialization.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
-
63
- :ivar currency_code: The currency code. Required.
62
+ :ivar currency_code: The currency code.
64
63
  :vartype currency_code: str
65
64
  :ivar events: List of usage events.
66
- :vartype events: list[~azure.quantum.models.UsageEvent]
67
- :ivar estimated_total: The estimated total. Required.
65
+ :vartype events: list[~azure.quantum._client.models.UsageEvent]
66
+ :ivar estimated_total: The estimated total.
68
67
  :vartype estimated_total: float
69
68
  """
70
69
 
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."""
70
+ _attribute_map = {
71
+ "currency_code": {"key": "currencyCode", "type": "str"},
72
+ "events": {"key": "events", "type": "[UsageEvent]"},
73
+ "estimated_total": {"key": "estimatedTotal", "type": "float"},
74
+ }
77
75
 
78
- @overload
79
76
  def __init__(
80
77
  self,
81
78
  *,
82
- currency_code: str,
83
- estimated_total: float,
79
+ currency_code: Optional[str] = None,
84
80
  events: Optional[List["_models.UsageEvent"]] = None,
85
- ) -> None: ...
86
-
87
- @overload
88
- def __init__(self, mapping: Mapping[str, Any]) -> None:
81
+ estimated_total: Optional[float] = None,
82
+ **kwargs: Any
83
+ ) -> None:
89
84
  """
90
- :param mapping: raw JSON to initialize the model.
91
- :type mapping: Mapping[str, Any]
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
92
91
  """
92
+ super().__init__(**kwargs)
93
+ self.currency_code = currency_code
94
+ self.events = events
95
+ self.estimated_total = estimated_total
93
96
 
94
- def __init__(self, *args: Any, **kwargs: Any) -> None:
95
- super().__init__(*args, **kwargs)
96
97
 
98
+ class ErrorData(_serialization.Model):
99
+ """An error response from Azure.
97
100
 
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.
101
+ All required parameters must be populated in order to send to server.
102
102
 
103
- :ivar code: One of a server-defined set of error codes.
103
+ :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
104
+ programmatically. Required.
104
105
  :vartype code: str
105
- :ivar innererror: Inner error.
106
- :vartype innererror: ~azure.quantum.models.InnerError
106
+ :ivar message: A message describing the error, intended to be suitable for displaying in a user
107
+ interface. Required.
108
+ :vartype message: str
107
109
  """
108
110
 
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."""
111
+ _validation = {
112
+ "code": {"required": True},
113
+ "message": {"required": True},
114
+ }
113
115
 
114
- @overload
115
- def __init__(
116
- self,
117
- *,
118
- code: Optional[str] = None,
119
- innererror: Optional["_models.InnerError"] = None,
120
- ) -> None: ...
116
+ _attribute_map = {
117
+ "code": {"key": "code", "type": "str"},
118
+ "message": {"key": "message", "type": "str"},
119
+ }
121
120
 
122
- @overload
123
- def __init__(self, mapping: Mapping[str, Any]) -> None:
121
+ def __init__(self, *, code: str, message: str, **kwargs: Any) -> None:
124
122
  """
125
- :param mapping: raw JSON to initialize the model.
126
- :type mapping: Mapping[str, Any]
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
127
129
  """
130
+ super().__init__(**kwargs)
131
+ self.code = code
132
+ self.message = message
128
133
 
129
- def __init__(self, *args: Any, **kwargs: Any) -> None:
130
- super().__init__(*args, **kwargs)
131
134
 
132
-
133
- class ItemDetails(_model_base.Model):
134
- """A workspace item.
135
+ class ItemDetails(_serialization.Model):
136
+ """Item details. An item can be a job or a session.
135
137
 
136
138
  You probably want to use the sub-classes and not this class directly. Known sub-classes are:
137
139
  JobDetails, SessionDetails
138
140
 
139
- Readonly variables are only populated by the server, and will be ignored when sending a request.
141
+ Variables are only populated by the server, and will be ignored when sending a request.
140
142
 
143
+ All required parameters must be populated in order to send to server.
141
144
 
142
- :ivar id: Id of the item. Required.
145
+ :ivar id: The id of the item. Required.
143
146
  :vartype id: str
144
147
  :ivar name: The name of the item. It is not required for the name to be unique and it's only
145
148
  used for display purposes. Required.
@@ -148,75 +151,128 @@ class ItemDetails(_model_base.Model):
148
151
  :vartype provider_id: str
149
152
  :ivar target: The target identifier to run the job. Required.
150
153
  :vartype target: str
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
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
154
156
  :ivar creation_time: The creation time of the item.
155
157
  :vartype creation_time: ~datetime.datetime
156
158
  :ivar begin_execution_time: The time when the item began execution.
157
159
  :vartype begin_execution_time: ~datetime.datetime
158
160
  :ivar end_execution_time: The time when the item finished execution.
159
161
  :vartype end_execution_time: ~datetime.datetime
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
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
164
167
  """
165
168
 
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
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
+
194
195
  def __init__(
195
196
  self,
196
197
  *,
198
+ id: str, # pylint: disable=redefined-builtin
197
199
  name: str,
198
200
  provider_id: str,
199
201
  target: str,
200
- item_type: str,
201
- ) -> None: ...
202
-
203
- @overload
204
- def __init__(self, mapping: Mapping[str, Any]) -> None:
202
+ cost_estimate: Optional["_models.CostEstimate"] = None,
203
+ error_data: Optional["_models.ErrorData"] = None,
204
+ **kwargs: Any
205
+ ) -> None:
205
206
  """
206
- :param mapping: raw JSON to initialize the model.
207
- :type mapping: Mapping[str, Any]
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
208
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.
209
239
 
210
- def __init__(self, *args: Any, **kwargs: Any) -> None:
211
- super().__init__(*args, **kwargs)
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
+ }
212
254
 
255
+ def __init__(self, *, value: List["_models.ItemDetails"], next_link: Optional[str] = None, **kwargs: Any) -> None:
256
+ """
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
261
+ """
262
+ super().__init__(**kwargs)
263
+ self.value = value
264
+ self.next_link = next_link
213
265
 
214
- class JobDetails(ItemDetails, discriminator="Job"):
215
- """A job to be run in the workspace.
216
266
 
217
- Readonly variables are only populated by the server, and will be ignored when sending a request.
267
+ class JobDetails(ItemDetails): # pylint: disable=too-many-instance-attributes
268
+ """Job details.
218
269
 
270
+ Variables are only populated by the server, and will be ignored when sending a request.
219
271
 
272
+ All required parameters must be populated in order to send to server.
273
+
274
+ :ivar id: The id of the item. Required.
275
+ :vartype id: str
220
276
  :ivar name: The name of the item. It is not required for the name to be unique and it's only
221
277
  used for display purposes. Required.
222
278
  :vartype name: str
@@ -224,278 +280,511 @@ class JobDetails(ItemDetails, discriminator="Job"):
224
280
  :vartype provider_id: str
225
281
  :ivar target: The target identifier to run the job. Required.
226
282
  :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
227
285
  :ivar creation_time: The creation time of the item.
228
286
  :vartype creation_time: ~datetime.datetime
229
287
  :ivar begin_execution_time: The time when the item began execution.
230
288
  :vartype begin_execution_time: ~datetime.datetime
231
289
  :ivar end_execution_time: The time when the item finished execution.
232
290
  :vartype end_execution_time: ~datetime.datetime
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
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
242
296
  :ivar job_type: The type of job. Known values are: "Unknown", "QuantumComputing", and
243
297
  "Optimization".
244
- :vartype job_type: str or ~azure.quantum.models.JobType
298
+ :vartype job_type: str or ~azure.quantum._client.models.JobType
245
299
  :ivar session_id: The ID of the session that the job is part of.
246
300
  :vartype session_id: str
247
301
  :ivar container_uri: The blob container SAS uri, the container is used to host job data.
248
302
  Required.
249
303
  :vartype container_uri: str
250
- :ivar input_data_uri: The input blob URI, if specified, it will override the default input blob
251
- in the container.
304
+ :ivar input_data_uri: The input blob SAS uri, if specified, it will override the default input
305
+ blob in the container.
252
306
  :vartype input_data_uri: str
253
- :ivar input_data_format: The format of the input data.
307
+ :ivar input_data_format: The format of the input data. Required.
254
308
  :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
255
313
  :ivar status: The status of the job. Known values are: "Waiting", "Executing", "Succeeded",
256
314
  "Failed", and "Cancelled".
257
- :vartype status: str or ~azure.quantum.models.JobStatus
315
+ :vartype status: str or ~azure.quantum._client.models.JobStatus
258
316
  :ivar metadata: The job metadata. Metadata provides client the ability to store client-specific
259
317
  information.
260
- :vartype metadata: any
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
261
324
  :ivar cancellation_time: The time when a job was successfully cancelled.
262
325
  :vartype cancellation_time: ~datetime.datetime
326
+ :ivar quantum_computing_data: Quantum computing data.
327
+ :vartype quantum_computing_data: ~azure.quantum._client.models.QuantumComputingData
263
328
  :ivar tags: List of user-supplied tags associated with the job.
264
329
  :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
276
330
  """
277
331
 
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
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
+
316
375
  def __init__(
317
376
  self,
318
377
  *,
378
+ id: str, # pylint: disable=redefined-builtin
319
379
  name: str,
320
380
  provider_id: str,
321
381
  target: str,
322
382
  container_uri: str,
323
- job_type: Optional[Union[str, "_models.JobType"]] = None,
383
+ input_data_format: str,
384
+ cost_estimate: Optional["_models.CostEstimate"] = None,
385
+ error_data: Optional["_models.ErrorData"] = None,
324
386
  session_id: Optional[str] = None,
325
387
  input_data_uri: Optional[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,
388
+ input_params: Optional[JSON] = None,
389
+ metadata: Optional[Dict[str, str]] = None,
330
390
  output_data_uri: Optional[str] = None,
331
391
  output_data_format: Optional[str] = None,
332
- ) -> None: ...
333
-
334
- @overload
335
- def __init__(self, mapping: Mapping[str, Any]) -> None:
392
+ tags: Optional[List[str]] = None,
393
+ **kwargs: Any
394
+ ) -> None:
336
395
  """
337
- :param mapping: raw JSON to initialize the model.
338
- :type mapping: Mapping[str, Any]
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]
339
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
+ """
340
468
 
341
- def __init__(self, *args: Any, **kwargs: Any) -> None:
342
- super().__init__(*args, item_type=ItemType.JOB, **kwargs)
469
+ _attribute_map = {
470
+ "value": {"key": "value", "type": "[JobDetails]"},
471
+ "next_link": {"key": "nextLink", "type": "str"},
472
+ }
473
+
474
+ def __init__(
475
+ self, *, value: Optional[List["_models.JobDetails"]] = None, next_link: Optional[str] = None, **kwargs: Any
476
+ ) -> None:
477
+ """
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
482
+ """
483
+ super().__init__(**kwargs)
484
+ self.value = value
485
+ self.next_link = next_link
343
486
 
344
487
 
345
- class JsonPatchObject(_model_base.Model):
346
- """A JSONPatch object as defined by RFC 6902.
488
+ class JsonPatchDocument(_serialization.Model):
489
+ """A JSONPatch document as defined by RFC 6902.
347
490
 
348
491
  All required parameters must be populated in order to send to server.
349
492
 
350
- :ivar operation: The operation to be performed. Required. Known values are: "add", "remove",
493
+ :ivar op: The operation to be performed. Required. Known values are: "add", "remove",
351
494
  "replace", "move", "copy", and "test".
352
- :vartype operation: str or ~azure.quantum.models.JsonPatchOperation
495
+ :vartype op: str or ~azure.quantum._client.models.JsonPatchOperation
353
496
  :ivar path: A JSON-Pointer. Required.
354
497
  :vartype path: str
355
498
  :ivar value: A value to be used in the operation on the path.
356
- :vartype value: any
499
+ :vartype value: JSON
357
500
  :ivar from_property: Optional field used in copy and move operations.
358
501
  :vartype from_property: str
359
502
  """
360
503
 
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
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
+
372
516
  def __init__(
373
517
  self,
374
518
  *,
375
- operation: Union[str, "_models.JsonPatchOperation"],
519
+ op: Union[str, "_models.JsonPatchOperation"],
376
520
  path: str,
377
- value: Optional[Any] = None,
521
+ value: Optional[JSON] = None,
378
522
  from_property: Optional[str] = None,
379
- ) -> None: ...
380
-
381
- @overload
382
- def __init__(self, mapping: Mapping[str, Any]) -> None:
523
+ **kwargs: Any
524
+ ) -> None:
383
525
  """
384
- :param mapping: raw JSON to initialize the model.
385
- :type mapping: Mapping[str, Any]
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
386
535
  """
536
+ super().__init__(**kwargs)
537
+ self.op = op
538
+ self.path = path
539
+ self.value = value
540
+ self.from_property = from_property
387
541
 
388
- def __init__(self, *args: Any, **kwargs: Any) -> None:
389
- super().__init__(*args, **kwargs)
390
542
 
543
+ class ProviderStatus(_serialization.Model):
544
+ """Providers status.
391
545
 
392
- class ProviderStatus(_model_base.Model):
393
- """Provider status.
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
+ """
394
554
 
395
- Readonly variables are only populated by the server, and will be ignored when sending a request.
555
+ _attribute_map = {
556
+ "id": {"key": "id", "type": "str"},
557
+ "current_availability": {"key": "currentAvailability", "type": "str"},
558
+ "targets": {"key": "targets", "type": "[TargetStatus]"},
559
+ }
396
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
397
582
 
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]
405
- """
406
583
 
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."""
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
591
+ """
416
592
 
593
+ _attribute_map = {
594
+ "value": {"key": "value", "type": "[ProviderStatus]"},
595
+ "next_link": {"key": "nextLink", "type": "str"},
596
+ }
417
597
 
418
- class QuantumComputingData(_model_base.Model):
419
- """Quantum computing data.
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
420
610
 
421
- Readonly variables are only populated by the server, and will be ignored when sending a request.
422
611
 
612
+ class QuantumComputingData(_serialization.Model):
613
+ """Quantum computing data.
423
614
 
424
- :ivar count: The number of quantum computing items in the job. Required.
615
+ :ivar count: The number of quantum computing items in the job.
425
616
  :vartype count: int
426
617
  """
427
618
 
428
- count: int = rest_field(visibility=["read"])
429
- """The number of quantum computing items in the job. Required."""
619
+ _attribute_map = {
620
+ "count": {"key": "count", "type": "int"},
621
+ }
430
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
431
630
 
432
- class Quota(_model_base.Model):
433
- """Quota information.
434
-
435
- Readonly variables are only populated by the server, and will be ignored when sending a request.
436
631
 
632
+ class Quota(_serialization.Model):
633
+ """Quota information.
437
634
 
438
- :ivar dimension: The name of the dimension associated with the quota. Required.
635
+ :ivar dimension: The name of the dimension associated with the quota.
439
636
  :vartype dimension: str
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.
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.
444
641
  :vartype provider_id: str
445
642
  :ivar utilization: The amount of the usage that has been applied for the current period.
446
- Required.
447
643
  :vartype utilization: float
448
644
  :ivar holds: The amount of the usage that has been reserved but not applied for the current
449
- period. Required.
645
+ period.
450
646
  :vartype holds: float
451
- :ivar limit: The maximum amount of usage allowed for the current period. Required.
647
+ :ivar limit: The maximum amount of usage allowed for the current period.
452
648
  :vartype limit: float
453
649
  :ivar period: The time period in which the quota's underlying meter is accumulated. Based on
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
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
457
740
  """
458
741
 
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\"."""
742
+ _validation = {
743
+ "error": {"required": True},
744
+ }
476
745
 
746
+ _attribute_map = {
747
+ "error": {"key": "error", "type": "ErrorData"},
748
+ }
477
749
 
478
- class SasUriResponse(_model_base.Model):
479
- """SAS URI operation response.
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
480
757
 
481
- Readonly variables are only populated by the server, and will be ignored when sending a request.
482
758
 
759
+ class SasUriResponse(_serialization.Model):
760
+ """Get SAS URL operation response.
483
761
 
484
762
  :ivar sas_uri: A URL with a SAS token to upload a blob for execution in the given workspace.
485
- Required.
486
763
  :vartype sas_uri: str
487
764
  """
488
765
 
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."""
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
491
777
 
492
778
 
493
- class SessionDetails(ItemDetails, discriminator="Session"):
494
- """Session, a logical grouping of jobs.
779
+ class SessionDetails(ItemDetails): # pylint: disable=too-many-instance-attributes
780
+ """Session details.
495
781
 
496
- Readonly variables are only populated by the server, and will be ignored when sending a request.
782
+ Variables are only populated by the server, and will be ignored when sending a request.
497
783
 
784
+ All required parameters must be populated in order to send to server.
498
785
 
786
+ :ivar id: The id of the item. Required.
787
+ :vartype id: str
499
788
  :ivar name: The name of the item. It is not required for the name to be unique and it's only
500
789
  used for display purposes. Required.
501
790
  :vartype name: str
@@ -503,190 +792,230 @@ class SessionDetails(ItemDetails, discriminator="Session"):
503
792
  :vartype provider_id: str
504
793
  :ivar target: The target identifier to run the job. Required.
505
794
  :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
506
797
  :ivar creation_time: The creation time of the item.
507
798
  :vartype creation_time: ~datetime.datetime
508
799
  :ivar begin_execution_time: The time when the item began execution.
509
800
  :vartype begin_execution_time: ~datetime.datetime
510
801
  :ivar end_execution_time: The time when the item finished execution.
511
802
  :vartype end_execution_time: ~datetime.datetime
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
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
521
808
  :ivar job_failure_policy: Policy controlling the behavior of the Session when a job in the
522
- session fails. Required. Known values are: "Abort" and "Continue".
523
- :vartype job_failure_policy: str or ~azure.quantum.models.SessionJobFailurePolicy
809
+ session fails. Known values are: "Abort" and "Continue".
810
+ :vartype job_failure_policy: str or ~azure.quantum._client.models.SessionJobFailurePolicy
524
811
  :ivar status: The status of the session. Known values are: "Waiting", "Executing", "Succeeded",
525
812
  "Failed", "Failure(s)", and "TimedOut".
526
- :vartype status: str or ~azure.quantum.models.SessionStatus
813
+ :vartype status: str or ~azure.quantum._client.models.SessionStatus
527
814
  """
528
815
 
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
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
+
541
843
  def __init__(
542
844
  self,
543
845
  *,
846
+ id: str, # pylint: disable=redefined-builtin
544
847
  name: str,
545
848
  provider_id: str,
546
849
  target: str,
547
- job_failure_policy: Union[str, "_models.SessionJobFailurePolicy"],
548
- ) -> None: ...
549
-
550
- @overload
551
- def __init__(self, mapping: Mapping[str, Any]) -> None:
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:
552
855
  """
553
- :param mapping: raw JSON to initialize the model.
554
- :type mapping: Mapping[str, Any]
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
555
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
+ """
556
896
 
557
- def __init__(self, *args: Any, **kwargs: Any) -> None:
558
- super().__init__(*args, item_type=ItemType.SESSION, **kwargs)
559
-
897
+ _attribute_map = {
898
+ "value": {"key": "value", "type": "[SessionDetails]"},
899
+ "next_link": {"key": "nextLink", "type": "str"},
900
+ }
560
901
 
561
- class TargetStatus(_model_base.Model):
562
- """Target status.
902
+ def __init__(
903
+ self, *, value: Optional[List["_models.SessionDetails"]] = None, next_link: Optional[str] = None, **kwargs: Any
904
+ ) -> None:
905
+ """
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
910
+ """
911
+ super().__init__(**kwargs)
912
+ self.value = value
913
+ self.next_link = next_link
563
914
 
564
- Readonly variables are only populated by the server, and will be ignored when sending a request.
565
915
 
916
+ class TargetStatus(_serialization.Model):
917
+ """Target status.
566
918
 
567
- :ivar id: Target id. Required.
919
+ :ivar id: Target id.
568
920
  :vartype id: str
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.
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.
573
925
  :vartype average_queue_time: int
574
926
  :ivar status_page: A page with detailed status of the provider.
575
927
  :vartype status_page: str
576
928
  """
577
929
 
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."""
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
589
962
 
590
963
 
591
- class UsageEvent(_model_base.Model):
964
+ class UsageEvent(_serialization.Model):
592
965
  """Usage event details.
593
966
 
594
-
595
- :ivar dimension_id: The dimension id. Required.
967
+ :ivar dimension_id: The dimension id.
596
968
  :vartype dimension_id: str
597
- :ivar dimension_name: The dimension name. Required.
969
+ :ivar dimension_name: The dimension name.
598
970
  :vartype dimension_name: str
599
- :ivar measure_unit: The unit of measure. Required.
971
+ :ivar measure_unit: The unit of measure.
600
972
  :vartype measure_unit: str
601
- :ivar amount_billed: The amount billed. Required.
973
+ :ivar amount_billed: The amount billed.
602
974
  :vartype amount_billed: float
603
- :ivar amount_consumed: The amount consumed. Required.
975
+ :ivar amount_consumed: The amount consumed.
604
976
  :vartype amount_consumed: float
605
- :ivar unit_price: The unit price. Required.
977
+ :ivar unit_price: The unit price.
606
978
  :vartype unit_price: float
607
979
  """
608
980
 
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.
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
+ }
647
989
 
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
674
990
  def __init__(
675
991
  self,
676
992
  *,
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:
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:
686
1001
  """
687
- :param mapping: raw JSON to initialize the model.
688
- :type mapping: Mapping[str, Any]
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
689
1014
  """
690
-
691
- def __init__(self, *args: Any, **kwargs: Any) -> None:
692
- super().__init__(*args, **kwargs)
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