diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/JobsRestClient.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/JobsRestClient.cs index 21daa586ef60..69e65e56a82f 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/JobsRestClient.cs +++ b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/JobsRestClient.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -331,103 +330,6 @@ public Response Cancel(string jobId, CancellationToken cancellationToken = defau } } - internal HttpMessage CreatePatchRequest(string jobId, IEnumerable patchJob) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/v1.0/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(jobId, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteStartArray(); - foreach (var item in patchJob) - { - content.JsonWriter.WriteObjectValue(item); - } - content.JsonWriter.WriteEndArray(); - request.Content = content; - return message; - } - - /// Patch a job. - /// Id of the job. - /// The json patch document containing the patch operations. - /// The cancellation token to use. - /// or is null. - public async Task> PatchAsync(string jobId, IEnumerable patchJob, CancellationToken cancellationToken = default) - { - if (jobId == null) - { - throw new ArgumentNullException(nameof(jobId)); - } - if (patchJob == null) - { - throw new ArgumentNullException(nameof(patchJob)); - } - - using var message = CreatePatchRequest(jobId, patchJob); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JobDetails value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JobDetails.DeserializeJobDetails(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((JobDetails)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Patch a job. - /// Id of the job. - /// The json patch document containing the patch operations. - /// The cancellation token to use. - /// or is null. - public Response Patch(string jobId, IEnumerable patchJob, CancellationToken cancellationToken = default) - { - if (jobId == null) - { - throw new ArgumentNullException(nameof(jobId)); - } - if (patchJob == null) - { - throw new ArgumentNullException(nameof(patchJob)); - } - - using var message = CreatePatchRequest(jobId, patchJob); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JobDetails value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JobDetails.DeserializeJobDetails(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((JobDetails)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - internal HttpMessage CreateListNextPageRequest(string nextLink) { var message = _pipeline.CreateMessage(); diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/CostEstimate.Serialization.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/CostEstimate.Serialization.cs deleted file mode 100644 index 32ec7e7a0feb..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/CostEstimate.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Quantum.Jobs.Models -{ - public partial class CostEstimate - { - internal static CostEstimate DeserializeCostEstimate(JsonElement element) - { - Optional currencyCode = default; - Optional> events = default; - Optional estimatedTotal = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("currencyCode")) - { - currencyCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("events")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(UsageEvent.DeserializeUsageEvent(item)); - } - events = array; - continue; - } - if (property.NameEquals("estimatedTotal")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - estimatedTotal = property.Value.GetSingle(); - continue; - } - } - return new CostEstimate(currencyCode.Value, Optional.ToList(events), Optional.ToNullable(estimatedTotal)); - } - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/CostEstimate.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/CostEstimate.cs deleted file mode 100644 index 6e9c4cedec47..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/CostEstimate.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.Quantum.Jobs.Models -{ - /// The job cost billed by the provider. The final cost on your bill might be slightly different due to added taxes and currency conversion rates. - public partial class CostEstimate - { - /// Initializes a new instance of CostEstimate. - internal CostEstimate() - { - Events = new ChangeTrackingList(); - } - - /// Initializes a new instance of CostEstimate. - /// The currency code. - /// List of usage events. - /// The estimated total. - internal CostEstimate(string currencyCode, IReadOnlyList events, float? estimatedTotal) - { - CurrencyCode = currencyCode; - Events = events; - EstimatedTotal = estimatedTotal; - } - - /// The currency code. - public string CurrencyCode { get; } - /// List of usage events. - public IReadOnlyList Events { get; } - /// The estimated total. - public float? EstimatedTotal { get; } - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs index 0b53bfe8be23..7cbbe21f9ea5 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs +++ b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs @@ -47,21 +47,14 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Target); if (Optional.IsCollectionDefined(Metadata)) { - if (Metadata != null) + writer.WritePropertyName("metadata"); + writer.WriteStartObject(); + foreach (var item in Metadata) { - writer.WritePropertyName("metadata"); - writer.WriteStartObject(); - foreach (var item in Metadata) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("metadata"); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } + writer.WriteEndObject(); } if (Optional.IsDefined(OutputDataUri)) { @@ -73,23 +66,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("outputDataFormat"); writer.WriteStringValue(OutputDataFormat); } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"); - writer.WriteStartArray(); - foreach (var item in Tags) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("tags"); - } - } writer.WriteEndObject(); } @@ -108,12 +84,10 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) Optional outputDataFormat = default; Optional status = default; Optional creationTime = default; - Optional beginExecutionTime = default; - Optional endExecutionTime = default; - Optional cancellationTime = default; - Optional costEstimate = default; + Optional beginExecutionTime = default; + Optional endExecutionTime = default; + Optional cancellationTime = default; Optional errorData = default; - Optional> tags = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -165,7 +139,7 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - metadata = null; + property.ThrowNonNullablePropertyIsNull(); continue; } Dictionary dictionary = new Dictionary(); @@ -210,7 +184,7 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - beginExecutionTime = null; + property.ThrowNonNullablePropertyIsNull(); continue; } beginExecutionTime = property.Value.GetDateTimeOffset("O"); @@ -220,7 +194,7 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - endExecutionTime = null; + property.ThrowNonNullablePropertyIsNull(); continue; } endExecutionTime = property.Value.GetDateTimeOffset("O"); @@ -230,49 +204,24 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - cancellationTime = null; + property.ThrowNonNullablePropertyIsNull(); continue; } cancellationTime = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("costEstimate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - costEstimate = null; - continue; - } - costEstimate = CostEstimate.DeserializeCostEstimate(property.Value); - continue; - } if (property.NameEquals("errorData")) { if (property.Value.ValueKind == JsonValueKind.Null) { - errorData = null; + property.ThrowNonNullablePropertyIsNull(); continue; } errorData = ErrorData.DeserializeErrorData(property.Value); continue; } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - tags = array; - continue; - } } - return new JobDetails(id.Value, name.Value, containerUri, inputDataUri.Value, inputDataFormat, inputParams.Value, providerId, target, Optional.ToDictionary(metadata), outputDataUri.Value, outputDataFormat.Value, Optional.ToNullable(status), Optional.ToNullable(creationTime), Optional.ToNullable(beginExecutionTime), Optional.ToNullable(endExecutionTime), Optional.ToNullable(cancellationTime), costEstimate.Value, errorData.Value, Optional.ToList(tags)); + return new JobDetails(id.Value, name.Value, containerUri, inputDataUri.Value, inputDataFormat, inputParams.Value, providerId, target, Optional.ToDictionary(metadata), outputDataUri.Value, outputDataFormat.Value, Optional.ToNullable(status), Optional.ToNullable(creationTime), Optional.ToNullable(beginExecutionTime), Optional.ToNullable(endExecutionTime), Optional.ToNullable(cancellationTime), errorData.Value); } } } diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.cs index 4a388316d614..dba27546b511 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.cs +++ b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.cs @@ -44,7 +44,6 @@ public JobDetails(string containerUri, string inputDataFormat, string providerId ProviderId = providerId; Target = target; Metadata = new ChangeTrackingDictionary(); - Tags = new ChangeTrackingList(); } /// Initializes a new instance of JobDetails. @@ -64,10 +63,8 @@ public JobDetails(string containerUri, string inputDataFormat, string providerId /// The time when the job began execution. /// The time when the job finished execution. /// The time when a job was successfully cancelled. - /// The job cost billed by the provider. The final cost on your bill might be slightly different due to added taxes and currency conversion rates. /// The error data for the job. This is expected only when Status 'Failed'. - /// List of user-supplied tags associated with the job. - internal JobDetails(string id, string name, string containerUri, string inputDataUri, string inputDataFormat, object inputParams, string providerId, string target, IDictionary metadata, string outputDataUri, string outputDataFormat, JobStatus? status, DateTimeOffset? creationTime, DateTimeOffset? beginExecutionTime, DateTimeOffset? endExecutionTime, DateTimeOffset? cancellationTime, CostEstimate costEstimate, ErrorData errorData, IList tags) + internal JobDetails(string id, string name, string containerUri, string inputDataUri, string inputDataFormat, object inputParams, string providerId, string target, IDictionary metadata, string outputDataUri, string outputDataFormat, JobStatus? status, DateTimeOffset? creationTime, DateTimeOffset? beginExecutionTime, DateTimeOffset? endExecutionTime, DateTimeOffset? cancellationTime, ErrorData errorData) { Id = id; Name = name; @@ -85,9 +82,7 @@ internal JobDetails(string id, string name, string containerUri, string inputDat BeginExecutionTime = beginExecutionTime; EndExecutionTime = endExecutionTime; CancellationTime = cancellationTime; - CostEstimate = costEstimate; ErrorData = errorData; - Tags = tags; } /// The job id. @@ -107,7 +102,7 @@ internal JobDetails(string id, string name, string containerUri, string inputDat /// The target identifier to run the job. public string Target { get; set; } /// The job metadata. Metadata provides client the ability to store client-specific information. - public IDictionary Metadata { get; set; } + public IDictionary Metadata { get; } /// The output blob SAS uri. When a job finishes successfully, results will be uploaded to this blob. public string OutputDataUri { get; set; } /// The format of the output data. @@ -122,11 +117,7 @@ internal JobDetails(string id, string name, string containerUri, string inputDat public DateTimeOffset? EndExecutionTime { get; } /// The time when a job was successfully cancelled. public DateTimeOffset? CancellationTime { get; } - /// The job cost billed by the provider. The final cost on your bill might be slightly different due to added taxes and currency conversion rates. - public CostEstimate CostEstimate { get; } /// The error data for the job. This is expected only when Status 'Failed'. public ErrorData ErrorData { get; } - /// List of user-supplied tags associated with the job. - public IList Tags { get; set; } } } diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchDocument.Serialization.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchDocument.Serialization.cs deleted file mode 100644 index c7e15d6277a4..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchDocument.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Quantum.Jobs.Models -{ - public partial class JsonPatchDocument : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("op"); - writer.WriteStringValue(Op.ToString()); - writer.WritePropertyName("path"); - writer.WriteStringValue(Path); - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"); - writer.WriteObjectValue(Value); - } - if (Optional.IsDefined(From)) - { - writer.WritePropertyName("from"); - writer.WriteStringValue(From); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchDocument.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchDocument.cs deleted file mode 100644 index 05542e3c4a05..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchDocument.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.Quantum.Jobs.Models -{ - /// A JSONPatch document as defined by RFC 6902. - public partial class JsonPatchDocument - { - /// Initializes a new instance of JsonPatchDocument. - /// The operation to be performed. - /// A JSON-Pointer. - /// is null. - public JsonPatchDocument(JsonPatchOperation op, string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - Op = op; - Path = path; - } - - /// The operation to be performed. - public JsonPatchOperation Op { get; } - /// A JSON-Pointer. - public string Path { get; } - /// A value to be used in the operation on the path. - public object Value { get; set; } - /// Optional field used in copy and move operations. - public string From { get; set; } - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchOperation.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchOperation.cs deleted file mode 100644 index deb45ff6e669..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JsonPatchOperation.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Quantum.Jobs.Models -{ - /// The operation to be performed. - public readonly partial struct JsonPatchOperation : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JsonPatchOperation(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AddValue = "add"; - private const string RemoveValue = "remove"; - private const string ReplaceValue = "replace"; - private const string MoveValue = "move"; - private const string CopyValue = "copy"; - private const string TestValue = "test"; - - /// add. - public static JsonPatchOperation Add { get; } = new JsonPatchOperation(AddValue); - /// remove. - public static JsonPatchOperation Remove { get; } = new JsonPatchOperation(RemoveValue); - /// replace. - public static JsonPatchOperation Replace { get; } = new JsonPatchOperation(ReplaceValue); - /// move. - public static JsonPatchOperation Move { get; } = new JsonPatchOperation(MoveValue); - /// copy. - public static JsonPatchOperation Copy { get; } = new JsonPatchOperation(CopyValue); - /// test. - public static JsonPatchOperation Test { get; } = new JsonPatchOperation(TestValue); - /// Determines if two values are the same. - public static bool operator ==(JsonPatchOperation left, JsonPatchOperation right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JsonPatchOperation left, JsonPatchOperation right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JsonPatchOperation(string value) => new JsonPatchOperation(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JsonPatchOperation other && Equals(other); - /// - public bool Equals(JsonPatchOperation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/UsageEvent.Serialization.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/UsageEvent.Serialization.cs deleted file mode 100644 index 152b5baf99ee..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/UsageEvent.Serialization.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.Quantum.Jobs.Models -{ - public partial class UsageEvent - { - internal static UsageEvent DeserializeUsageEvent(JsonElement element) - { - Optional dimensionId = default; - Optional dimensionName = default; - Optional measureUnit = default; - Optional amountBilled = default; - Optional amountConsumed = default; - Optional unitPrice = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("dimensionId")) - { - dimensionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("dimensionName")) - { - dimensionName = property.Value.GetString(); - continue; - } - if (property.NameEquals("measureUnit")) - { - measureUnit = property.Value.GetString(); - continue; - } - if (property.NameEquals("amountBilled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - amountBilled = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("amountConsumed")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - amountConsumed = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("unitPrice")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - unitPrice = property.Value.GetSingle(); - continue; - } - } - return new UsageEvent(dimensionId.Value, dimensionName.Value, measureUnit.Value, Optional.ToNullable(amountBilled), Optional.ToNullable(amountConsumed), Optional.ToNullable(unitPrice)); - } - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/UsageEvent.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/UsageEvent.cs deleted file mode 100644 index 9708b1457949..000000000000 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/UsageEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Quantum.Jobs.Models -{ - /// Usage event details. - public partial class UsageEvent - { - /// Initializes a new instance of UsageEvent. - internal UsageEvent() - { - } - - /// Initializes a new instance of UsageEvent. - /// The dimension id. - /// The dimension name. - /// The unit of measure. - /// The amount billed. - /// The amount consumed. - /// The unit price. - internal UsageEvent(string dimensionId, string dimensionName, string measureUnit, float? amountBilled, float? amountConsumed, float? unitPrice) - { - DimensionId = dimensionId; - DimensionName = dimensionName; - MeasureUnit = measureUnit; - AmountBilled = amountBilled; - AmountConsumed = amountConsumed; - UnitPrice = unitPrice; - } - - /// The dimension id. - public string DimensionId { get; } - /// The dimension name. - public string DimensionName { get; } - /// The unit of measure. - public string MeasureUnit { get; } - /// The amount billed. - public float? AmountBilled { get; } - /// The amount consumed. - public float? AmountConsumed { get; } - /// The unit price. - public float? UnitPrice { get; } - } -} diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/QuantumModelFactory.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/QuantumModelFactory.cs index 41f4acbc3d03..8bc686c9ad44 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/QuantumModelFactory.cs +++ b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/QuantumModelFactory.cs @@ -31,41 +31,13 @@ public static partial class QuantumModelFactory /// The time when the job began execution. /// The time when the job finished execution. /// The time when a job was successfully cancelled. - /// The job cost billed by the provider. The final cost on your bill might be slightly different due to added taxes and currency conversion rates. /// The error data for the job. This is expected only when Status 'Failed'. - /// List of user-supplied tags associated with the job. /// A new instance for mocking. - public static JobDetails JobDetails(string id = null, string name = null, string containerUri = null, string inputDataUri = null, string inputDataFormat = null, object inputParams = null, string providerId = null, string target = null, IDictionary metadata = null, string outputDataUri = null, string outputDataFormat = null, JobStatus? status = null, DateTimeOffset? creationTime = null, DateTimeOffset? beginExecutionTime = null, DateTimeOffset? endExecutionTime = null, DateTimeOffset? cancellationTime = null, CostEstimate costEstimate = null, ErrorData errorData = null, IEnumerable tags = null) + public static JobDetails JobDetails(string id = null, string name = null, string containerUri = null, string inputDataUri = null, string inputDataFormat = null, object inputParams = null, string providerId = null, string target = null, IDictionary metadata = null, string outputDataUri = null, string outputDataFormat = null, JobStatus? status = null, DateTimeOffset? creationTime = null, DateTimeOffset? beginExecutionTime = null, DateTimeOffset? endExecutionTime = null, DateTimeOffset? cancellationTime = null, ErrorData errorData = null) { metadata ??= new Dictionary(); - tags ??= new List(); - return new JobDetails(id, name, containerUri, inputDataUri, inputDataFormat, inputParams, providerId, target, metadata, outputDataUri, outputDataFormat, status, creationTime, beginExecutionTime, endExecutionTime, cancellationTime, costEstimate, errorData, tags?.ToList()); - } - - /// Initializes a new instance of CostEstimate. - /// The currency code. - /// List of usage events. - /// The estimated total. - /// A new instance for mocking. - public static CostEstimate CostEstimate(string currencyCode = null, IEnumerable events = null, float? estimatedTotal = null) - { - events ??= new List(); - - return new CostEstimate(currencyCode, events?.ToList(), estimatedTotal); - } - - /// Initializes a new instance of UsageEvent. - /// The dimension id. - /// The dimension name. - /// The unit of measure. - /// The amount billed. - /// The amount consumed. - /// The unit price. - /// A new instance for mocking. - public static UsageEvent UsageEvent(string dimensionId = null, string dimensionName = null, string measureUnit = null, float? amountBilled = null, float? amountConsumed = null, float? unitPrice = null) - { - return new UsageEvent(dimensionId, dimensionName, measureUnit, amountBilled, amountConsumed, unitPrice); + return new JobDetails(id, name, containerUri, inputDataUri, inputDataFormat, inputParams, providerId, target, metadata, outputDataUri, outputDataFormat, status, creationTime, beginExecutionTime, endExecutionTime, cancellationTime, errorData); } /// Initializes a new instance of ErrorData. diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/autorest.md b/sdk/quantum/Azure.Quantum.Jobs/src/autorest.md index e174788380ca..55f786ba517e 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/src/autorest.md +++ b/sdk/quantum/Azure.Quantum.Jobs/src/autorest.md @@ -3,5 +3,5 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml -require: https://github.com/Azure/azure-rest-api-specs/blob/50adac0106ba23718cb6b736d69cf834ae37f505/specification/quantum/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/c7484084df2355bf25846558eb15eea585a8be95/specification/quantum/data-plane/readme.md ```