diff --git a/doc/GeneratorMigration/Library_Inventory.md b/doc/GeneratorMigration/Library_Inventory.md index e47442d9be51..b962d8ce0e1b 100644 --- a/doc/GeneratorMigration/Library_Inventory.md +++ b/doc/GeneratorMigration/Library_Inventory.md @@ -207,6 +207,7 @@ Libraries that provide resource management APIs for Azure services and have been | playwright | Azure.ResourceManager.Playwright | ✅ | | portalservices | Azure.ResourceManager.PortalServicesCopilot | ✅ | | purestorageblock | Azure.ResourceManager.PureStorageBlock | ✅ | +| quantum | Azure.ResourceManager.Quantum | ✅ | | qumulo | Azure.ResourceManager.Qumulo | ✅ | | quota | Azure.ResourceManager.Quota | ✅ | | recoveryservices | Azure.ResourceManager.RecoveryServices | ✅ | @@ -345,7 +346,6 @@ Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 14 | privatedns | Azure.ResourceManager.PrivateDns | | providerhub | Azure.ResourceManager.ProviderHub | | purview | Azure.ResourceManager.Purview | -| quantum | Azure.ResourceManager.Quantum | | recoveryservices-backup | Azure.ResourceManager.RecoveryServicesBackup | | recoveryservices-siterecovery | Azure.ResourceManager.RecoveryServicesSiteRecovery | | redis | Azure.ResourceManager.Redis | diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md b/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md index e9e629c3ab38..d52f22d42b9b 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md +++ b/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Update api-version to '2025-12-15-preview'. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net10.0.cs b/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net10.0.cs index 2fd4a9817d8e..319597f6d5b1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net10.0.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net10.0.cs @@ -8,16 +8,18 @@ internal AzureResourceManagerQuantumContext() { } } public static partial class QuantumExtensions { - public static Azure.Response CheckWorkspaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Pageable GetOfferings(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetOfferingsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CheckWorkspaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetProviderOfferings(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetProviderOfferingsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetQuantumWorkspace(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetQuantumWorkspaceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Quantum.QuantumWorkspaceResource GetQuantumWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Quantum.QuantumWorkspaceCollection GetQuantumWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetQuantumWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetQuantumWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetSuiteOffer(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSuiteOfferAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class QuantumWorkspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -39,14 +41,12 @@ protected QuantumWorkspaceCollection() { } public partial class QuantumWorkspaceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QuantumWorkspaceData(Azure.Core.AzureLocation location) { } - public System.Uri EndpointUri { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public bool? IsApiKeyEnabled { get { throw null; } set { } } - public System.Collections.Generic.IList Providers { get { throw null; } } - public Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? ProvisioningState { get { throw null; } } - public string StorageAccount { get { throw null; } set { } } - public Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? Usable { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.QuantumWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.QuantumWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -100,38 +100,63 @@ protected MockableQuantumResourceGroupResource() { } public partial class MockableQuantumSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableQuantumSubscriptionResource() { } - public virtual Azure.Response CheckWorkspaceNameAvailability(string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetOfferings(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetOfferingsAsync(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CheckWorkspaceNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProviderOfferings(Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProviderOfferingsAsync(Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetQuantumWorkspaces(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetQuantumWorkspacesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSuiteOffer(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSuiteOfferAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Quantum.Models { public static partial class ArmQuantumModelFactory { + public static Azure.ResourceManager.Quantum.Models.MoboBrokerInfo MoboBrokerInfo(Azure.Core.ResourceIdentifier id = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderAadInfo ProviderAadInfo(string applicationId = null, System.Guid? tenantId = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo ProviderApplicationInfo(string publisherId = null, string offerId = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderPricingDimension ProviderPricingDimension(string id = null, string name = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderSkuDescription ProviderSkuDescription(string id = null, string name = null, string version = null, string description = null, System.Uri restrictedAccessUri = null, bool? autoAdd = default(bool?), System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDetails = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, System.Collections.Generic.IEnumerable acceptedDataFormats = null, System.Collections.Generic.IEnumerable acceptedContentEncodings = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, System.Collections.Generic.IEnumerable acceptedDataFormats = null, System.Collections.Generic.IEnumerable acceptedContentEncodings = null, int? numQubits = default(int?), string targetProfile = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.QuantumPricingDetail QuantumPricingDetail(string id = null, string value = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.QuantumProviderDescription QuantumProviderDescription(string id = null, string name = null, Azure.ResourceManager.Quantum.Models.QuantumProviderProperties properties = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.QuantumProviderProperties QuantumProviderProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, Azure.ResourceManager.Quantum.Models.ProviderAadInfo aad = null, Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo managedApplication = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable skus = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDimensions = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProviderOffer QuantumProviderOffer(string id = null, string name = null, Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties properties = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties QuantumProviderOfferProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, Azure.ResourceManager.Quantum.Models.ProviderAadInfo aad = null, Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo managedApplication = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable skus = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDimensions = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension QuantumQuotaDimension(string id = null, string scope = null, string period = null, float? quota = default(float?), string name = null, string description = null, string unit = null, string unitPlural = null) { throw null; } - public static Azure.ResourceManager.Quantum.QuantumWorkspaceData QuantumWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable providers = null, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? usable = default(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus?), Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? provisioningState = default(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus?), string storageAccount = null, System.Uri endpointUri = null, bool? isApiKeyEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer QuantumSuiteOffer(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties properties = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties QuantumSuiteOfferProperties(string providerId = null, string providerName = null, string companyName = null, string location = null, string description = null, Azure.Core.AzureLocation? quotas = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Quantum.QuantumWorkspaceData QuantumWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch QuantumWorkspacePatch(System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties QuantumWorkspaceProperties(System.Collections.Generic.IEnumerable providers = null, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? usable = default(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus?), Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? provisioningState = default(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus?), Azure.Core.ResourceIdentifier storageAccount = null, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? workspaceKind = default(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind?), System.Uri endpointUri = null, bool? isApiKeyEnabled = default(bool?), System.Collections.Generic.IEnumerable managedOnBehalfOfMoboBrokerResources = null, Azure.Core.ResourceIdentifier managedStorageAccount = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.WorkspaceApiKey WorkspaceApiKey(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string key = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys WorkspaceApiKeys(System.Collections.Generic.IEnumerable keys = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult WorkspaceKeyListResult(bool? isApiKeyEnabled = default(bool?), Azure.ResourceManager.Quantum.Models.WorkspaceApiKey primaryKey = null, Azure.ResourceManager.Quantum.Models.WorkspaceApiKey secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? reason = default(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason?), string message = null) { throw null; } + } + public partial class MoboBrokerInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MoboBrokerInfo() { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.MoboBrokerInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.MoboBrokerInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.MoboBrokerInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.MoboBrokerInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ProviderAadInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ProviderAadInfo() { } public string ApplicationId { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderAadInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderAadInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderAadInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderAadInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -143,7 +168,10 @@ public partial class ProviderApplicationInfo : System.ClientModel.Primitives.IJs internal ProviderApplicationInfo() { } public string OfferId { get { throw null; } } public string PublisherId { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -155,7 +183,10 @@ public partial class ProviderPricingDimension : System.ClientModel.Primitives.IJ internal ProviderPricingDimension() { } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderPricingDimension JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderPricingDimension PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderPricingDimension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderPricingDimension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -168,17 +199,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public ProviderProvisioningStatus(string value) { throw null; } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Deleted { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Canceled { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Failed { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Launching { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderDeleting { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderLaunching { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderProvisioning { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderUpdating { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Succeeded { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Updating { get { throw null; } } public bool Equals(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus other) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus left, Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus left, Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } @@ -189,12 +222,15 @@ internal ProviderSkuDescription() { } public string Description { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } - public System.Collections.Generic.IReadOnlyList PricingDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList QuotaDimensions { get { throw null; } } + public System.Collections.Generic.IList PricingDetails { get { throw null; } } + public System.Collections.Generic.IList QuotaDimensions { get { throw null; } } public System.Uri RestrictedAccessUri { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderSkuDescription JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderSkuDescription PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderSkuDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderSkuDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -204,12 +240,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ProviderTargetDescription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ProviderTargetDescription() { } - public System.Collections.Generic.IReadOnlyList AcceptedContentEncodings { get { throw null; } } - public System.Collections.Generic.IReadOnlyList AcceptedDataFormats { get { throw null; } } + public System.Collections.Generic.IList AcceptedContentEncodings { get { throw null; } } + public System.Collections.Generic.IList AcceptedDataFormats { get { throw null; } } public string Description { get { throw null; } } public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public string Name { get { throw null; } } + public int? NumQubits { get { throw null; } } + public string TargetProfile { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderTargetDescription JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderTargetDescription PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderTargetDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderTargetDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -221,7 +263,10 @@ public partial class QuantumPricingDetail : System.ClientModel.Primitives.IJsonM internal QuantumPricingDetail() { } public string Id { get { throw null; } } public string Value { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumPricingDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumPricingDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumPricingDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumPricingDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -235,47 +280,57 @@ public QuantumProvider() { } public System.Uri InstanceUri { get { throw null; } set { } } public string ProviderId { get { throw null; } set { } } public string ProviderSku { get { throw null; } set { } } - public Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations Quotas { get { throw null; } set { } } public string ResourceUsageId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProvider JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProvider PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class QuantumProviderDescription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class QuantumProviderOffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal QuantumProviderDescription() { } + internal QuantumProviderOffer() { } public string Id { get { throw null; } } public string Name { get { throw null; } } - public Azure.ResourceManager.Quantum.Models.QuantumProviderProperties Properties { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOffer JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOffer PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumProviderOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumProviderOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class QuantumProviderProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class QuantumProviderOfferProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal QuantumProviderProperties() { } + internal QuantumProviderOfferProperties() { } public Azure.ResourceManager.Quantum.Models.ProviderAadInfo Aad { get { throw null; } } public string Company { get { throw null; } } public string DefaultEndpoint { get { throw null; } } public string Description { get { throw null; } } public Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo ManagedApplication { get { throw null; } } - public System.Collections.Generic.IReadOnlyList PricingDimensions { get { throw null; } } + public System.Collections.Generic.IList PricingDimensions { get { throw null; } } public string ProviderType { get { throw null; } } - public System.Collections.Generic.IReadOnlyList QuotaDimensions { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Skus { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IList QuotaDimensions { get { throw null; } } + public System.Collections.Generic.IList Skus { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct QuantumProvisioningStatus : System.IEquatable @@ -283,20 +338,36 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public QuantumProvisioningStatus(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Deleting { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Failed { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderDeleting { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderLaunching { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderProvisioning { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderUpdating { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Launching { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Updating { get { throw null; } } public bool Equals(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus other) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus left, Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus left, Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class QuantumQuotaAllocations : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public QuantumQuotaAllocations(int standardMinutesLifetime) { } + public int? HighMinutesLifetime { get { throw null; } set { } } + public int StandardMinutesLifetime { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class QuantumQuotaDimension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal QuantumQuotaDimension() { } @@ -308,30 +379,111 @@ internal QuantumQuotaDimension() { } public string Scope { get { throw null; } } public string Unit { get { throw null; } } public string UnitPlural { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class QuantumSuiteOffer : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QuantumSuiteOffer() { } + public Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class QuantumSuiteOfferProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QuantumSuiteOfferProperties() { } + public string CompanyName { get { throw null; } } + public string Description { get { throw null; } } + public string Location { get { throw null; } } + public string ProviderId { get { throw null; } } + public string ProviderName { get { throw null; } } + public Azure.Core.AzureLocation? Quotas { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct QuantumWorkspaceKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public QuantumWorkspaceKind(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind V1 { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind V2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind left, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind right) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind left, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind right) { throw null; } + public override string ToString() { throw null; } + } public partial class QuantumWorkspacePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QuantumWorkspacePatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class QuantumWorkspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public QuantumWorkspaceProperties() { } + public System.Uri EndpointUri { get { throw null; } } + public bool? IsApiKeyEnabled { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ManagedOnBehalfOfMoboBrokerResources { get { throw null; } } + public Azure.Core.ResourceIdentifier ManagedStorageAccount { get { throw null; } } + public System.Collections.Generic.IList Providers { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageAccount { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? Usable { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? WorkspaceKind { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class WorkspaceApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal WorkspaceApiKey() { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public string Key { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKey JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKey PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceApiKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceApiKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -342,7 +494,10 @@ public partial class WorkspaceApiKeys : System.ClientModel.Primitives.IJsonModel { public WorkspaceApiKeys() { } public System.Collections.Generic.IList Keys { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -357,7 +512,10 @@ internal WorkspaceKeyListResult() { } public Azure.ResourceManager.Quantum.Models.WorkspaceApiKey PrimaryKey { get { throw null; } } public string SecondaryConnectionString { get { throw null; } } public Azure.ResourceManager.Quantum.Models.WorkspaceApiKey SecondaryKey { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -377,6 +535,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceKeyType left, Azure.ResourceManager.Quantum.Models.WorkspaceKeyType right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceKeyType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceKeyType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceKeyType left, Azure.ResourceManager.Quantum.Models.WorkspaceKeyType right) { throw null; } public override string ToString() { throw null; } } @@ -385,7 +544,10 @@ public partial class WorkspaceNameAvailabilityContent : System.ClientModel.Primi public WorkspaceNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -397,8 +559,11 @@ public partial class WorkspaceNameAvailabilityResult : System.ClientModel.Primit internal WorkspaceNameAvailabilityResult() { } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } - public string Reason { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? Reason { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -406,6 +571,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WorkspaceNameUnavailableReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WorkspaceNameUnavailableReason(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason left, Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason right) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason left, Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct WorkspaceUsableStatus : System.IEquatable { private readonly object _dummy; @@ -419,6 +601,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus left, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus left, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus right) { throw null; } public override string ToString() { throw null; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net8.0.cs b/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net8.0.cs index 2fd4a9817d8e..319597f6d5b1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net8.0.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.net8.0.cs @@ -8,16 +8,18 @@ internal AzureResourceManagerQuantumContext() { } } public static partial class QuantumExtensions { - public static Azure.Response CheckWorkspaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Pageable GetOfferings(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetOfferingsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CheckWorkspaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetProviderOfferings(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetProviderOfferingsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetQuantumWorkspace(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetQuantumWorkspaceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Quantum.QuantumWorkspaceResource GetQuantumWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Quantum.QuantumWorkspaceCollection GetQuantumWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetQuantumWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetQuantumWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetSuiteOffer(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSuiteOfferAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class QuantumWorkspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -39,14 +41,12 @@ protected QuantumWorkspaceCollection() { } public partial class QuantumWorkspaceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QuantumWorkspaceData(Azure.Core.AzureLocation location) { } - public System.Uri EndpointUri { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public bool? IsApiKeyEnabled { get { throw null; } set { } } - public System.Collections.Generic.IList Providers { get { throw null; } } - public Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? ProvisioningState { get { throw null; } } - public string StorageAccount { get { throw null; } set { } } - public Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? Usable { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.QuantumWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.QuantumWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -100,38 +100,63 @@ protected MockableQuantumResourceGroupResource() { } public partial class MockableQuantumSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableQuantumSubscriptionResource() { } - public virtual Azure.Response CheckWorkspaceNameAvailability(string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetOfferings(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetOfferingsAsync(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CheckWorkspaceNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProviderOfferings(Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProviderOfferingsAsync(Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetQuantumWorkspaces(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetQuantumWorkspacesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSuiteOffer(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSuiteOfferAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Quantum.Models { public static partial class ArmQuantumModelFactory { + public static Azure.ResourceManager.Quantum.Models.MoboBrokerInfo MoboBrokerInfo(Azure.Core.ResourceIdentifier id = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderAadInfo ProviderAadInfo(string applicationId = null, System.Guid? tenantId = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo ProviderApplicationInfo(string publisherId = null, string offerId = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderPricingDimension ProviderPricingDimension(string id = null, string name = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderSkuDescription ProviderSkuDescription(string id = null, string name = null, string version = null, string description = null, System.Uri restrictedAccessUri = null, bool? autoAdd = default(bool?), System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDetails = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, System.Collections.Generic.IEnumerable acceptedDataFormats = null, System.Collections.Generic.IEnumerable acceptedContentEncodings = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, System.Collections.Generic.IEnumerable acceptedDataFormats = null, System.Collections.Generic.IEnumerable acceptedContentEncodings = null, int? numQubits = default(int?), string targetProfile = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.QuantumPricingDetail QuantumPricingDetail(string id = null, string value = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.QuantumProviderDescription QuantumProviderDescription(string id = null, string name = null, Azure.ResourceManager.Quantum.Models.QuantumProviderProperties properties = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.QuantumProviderProperties QuantumProviderProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, Azure.ResourceManager.Quantum.Models.ProviderAadInfo aad = null, Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo managedApplication = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable skus = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDimensions = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProviderOffer QuantumProviderOffer(string id = null, string name = null, Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties properties = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties QuantumProviderOfferProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, Azure.ResourceManager.Quantum.Models.ProviderAadInfo aad = null, Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo managedApplication = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable skus = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDimensions = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension QuantumQuotaDimension(string id = null, string scope = null, string period = null, float? quota = default(float?), string name = null, string description = null, string unit = null, string unitPlural = null) { throw null; } - public static Azure.ResourceManager.Quantum.QuantumWorkspaceData QuantumWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable providers = null, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? usable = default(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus?), Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? provisioningState = default(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus?), string storageAccount = null, System.Uri endpointUri = null, bool? isApiKeyEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer QuantumSuiteOffer(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties properties = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties QuantumSuiteOfferProperties(string providerId = null, string providerName = null, string companyName = null, string location = null, string description = null, Azure.Core.AzureLocation? quotas = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Quantum.QuantumWorkspaceData QuantumWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch QuantumWorkspacePatch(System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties QuantumWorkspaceProperties(System.Collections.Generic.IEnumerable providers = null, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? usable = default(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus?), Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? provisioningState = default(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus?), Azure.Core.ResourceIdentifier storageAccount = null, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? workspaceKind = default(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind?), System.Uri endpointUri = null, bool? isApiKeyEnabled = default(bool?), System.Collections.Generic.IEnumerable managedOnBehalfOfMoboBrokerResources = null, Azure.Core.ResourceIdentifier managedStorageAccount = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.WorkspaceApiKey WorkspaceApiKey(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string key = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys WorkspaceApiKeys(System.Collections.Generic.IEnumerable keys = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult WorkspaceKeyListResult(bool? isApiKeyEnabled = default(bool?), Azure.ResourceManager.Quantum.Models.WorkspaceApiKey primaryKey = null, Azure.ResourceManager.Quantum.Models.WorkspaceApiKey secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? reason = default(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason?), string message = null) { throw null; } + } + public partial class MoboBrokerInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MoboBrokerInfo() { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.MoboBrokerInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.MoboBrokerInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.MoboBrokerInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.MoboBrokerInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ProviderAadInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ProviderAadInfo() { } public string ApplicationId { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderAadInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderAadInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderAadInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderAadInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -143,7 +168,10 @@ public partial class ProviderApplicationInfo : System.ClientModel.Primitives.IJs internal ProviderApplicationInfo() { } public string OfferId { get { throw null; } } public string PublisherId { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -155,7 +183,10 @@ public partial class ProviderPricingDimension : System.ClientModel.Primitives.IJ internal ProviderPricingDimension() { } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderPricingDimension JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderPricingDimension PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderPricingDimension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderPricingDimension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -168,17 +199,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public ProviderProvisioningStatus(string value) { throw null; } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Deleted { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Canceled { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Failed { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Launching { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderDeleting { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderLaunching { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderProvisioning { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderUpdating { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Succeeded { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Updating { get { throw null; } } public bool Equals(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus other) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus left, Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus left, Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } @@ -189,12 +222,15 @@ internal ProviderSkuDescription() { } public string Description { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } - public System.Collections.Generic.IReadOnlyList PricingDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList QuotaDimensions { get { throw null; } } + public System.Collections.Generic.IList PricingDetails { get { throw null; } } + public System.Collections.Generic.IList QuotaDimensions { get { throw null; } } public System.Uri RestrictedAccessUri { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderSkuDescription JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderSkuDescription PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderSkuDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderSkuDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -204,12 +240,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ProviderTargetDescription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ProviderTargetDescription() { } - public System.Collections.Generic.IReadOnlyList AcceptedContentEncodings { get { throw null; } } - public System.Collections.Generic.IReadOnlyList AcceptedDataFormats { get { throw null; } } + public System.Collections.Generic.IList AcceptedContentEncodings { get { throw null; } } + public System.Collections.Generic.IList AcceptedDataFormats { get { throw null; } } public string Description { get { throw null; } } public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public string Name { get { throw null; } } + public int? NumQubits { get { throw null; } } + public string TargetProfile { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderTargetDescription JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderTargetDescription PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderTargetDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderTargetDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -221,7 +263,10 @@ public partial class QuantumPricingDetail : System.ClientModel.Primitives.IJsonM internal QuantumPricingDetail() { } public string Id { get { throw null; } } public string Value { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumPricingDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumPricingDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumPricingDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumPricingDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -235,47 +280,57 @@ public QuantumProvider() { } public System.Uri InstanceUri { get { throw null; } set { } } public string ProviderId { get { throw null; } set { } } public string ProviderSku { get { throw null; } set { } } - public Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations Quotas { get { throw null; } set { } } public string ResourceUsageId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProvider JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProvider PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class QuantumProviderDescription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class QuantumProviderOffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal QuantumProviderDescription() { } + internal QuantumProviderOffer() { } public string Id { get { throw null; } } public string Name { get { throw null; } } - public Azure.ResourceManager.Quantum.Models.QuantumProviderProperties Properties { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOffer JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOffer PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumProviderOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumProviderOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class QuantumProviderProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class QuantumProviderOfferProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal QuantumProviderProperties() { } + internal QuantumProviderOfferProperties() { } public Azure.ResourceManager.Quantum.Models.ProviderAadInfo Aad { get { throw null; } } public string Company { get { throw null; } } public string DefaultEndpoint { get { throw null; } } public string Description { get { throw null; } } public Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo ManagedApplication { get { throw null; } } - public System.Collections.Generic.IReadOnlyList PricingDimensions { get { throw null; } } + public System.Collections.Generic.IList PricingDimensions { get { throw null; } } public string ProviderType { get { throw null; } } - public System.Collections.Generic.IReadOnlyList QuotaDimensions { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Skus { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IList QuotaDimensions { get { throw null; } } + public System.Collections.Generic.IList Skus { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct QuantumProvisioningStatus : System.IEquatable @@ -283,20 +338,36 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public QuantumProvisioningStatus(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Deleting { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Failed { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderDeleting { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderLaunching { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderProvisioning { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderUpdating { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Launching { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Updating { get { throw null; } } public bool Equals(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus other) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus left, Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus left, Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class QuantumQuotaAllocations : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public QuantumQuotaAllocations(int standardMinutesLifetime) { } + public int? HighMinutesLifetime { get { throw null; } set { } } + public int StandardMinutesLifetime { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class QuantumQuotaDimension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal QuantumQuotaDimension() { } @@ -308,30 +379,111 @@ internal QuantumQuotaDimension() { } public string Scope { get { throw null; } } public string Unit { get { throw null; } } public string UnitPlural { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class QuantumSuiteOffer : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QuantumSuiteOffer() { } + public Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class QuantumSuiteOfferProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QuantumSuiteOfferProperties() { } + public string CompanyName { get { throw null; } } + public string Description { get { throw null; } } + public string Location { get { throw null; } } + public string ProviderId { get { throw null; } } + public string ProviderName { get { throw null; } } + public Azure.Core.AzureLocation? Quotas { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct QuantumWorkspaceKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public QuantumWorkspaceKind(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind V1 { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind V2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind left, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind right) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind left, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind right) { throw null; } + public override string ToString() { throw null; } + } public partial class QuantumWorkspacePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QuantumWorkspacePatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class QuantumWorkspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public QuantumWorkspaceProperties() { } + public System.Uri EndpointUri { get { throw null; } } + public bool? IsApiKeyEnabled { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ManagedOnBehalfOfMoboBrokerResources { get { throw null; } } + public Azure.Core.ResourceIdentifier ManagedStorageAccount { get { throw null; } } + public System.Collections.Generic.IList Providers { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageAccount { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? Usable { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? WorkspaceKind { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class WorkspaceApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal WorkspaceApiKey() { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public string Key { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKey JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKey PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceApiKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceApiKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -342,7 +494,10 @@ public partial class WorkspaceApiKeys : System.ClientModel.Primitives.IJsonModel { public WorkspaceApiKeys() { } public System.Collections.Generic.IList Keys { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -357,7 +512,10 @@ internal WorkspaceKeyListResult() { } public Azure.ResourceManager.Quantum.Models.WorkspaceApiKey PrimaryKey { get { throw null; } } public string SecondaryConnectionString { get { throw null; } } public Azure.ResourceManager.Quantum.Models.WorkspaceApiKey SecondaryKey { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -377,6 +535,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceKeyType left, Azure.ResourceManager.Quantum.Models.WorkspaceKeyType right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceKeyType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceKeyType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceKeyType left, Azure.ResourceManager.Quantum.Models.WorkspaceKeyType right) { throw null; } public override string ToString() { throw null; } } @@ -385,7 +544,10 @@ public partial class WorkspaceNameAvailabilityContent : System.ClientModel.Primi public WorkspaceNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -397,8 +559,11 @@ public partial class WorkspaceNameAvailabilityResult : System.ClientModel.Primit internal WorkspaceNameAvailabilityResult() { } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } - public string Reason { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? Reason { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -406,6 +571,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WorkspaceNameUnavailableReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WorkspaceNameUnavailableReason(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason left, Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason right) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason left, Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct WorkspaceUsableStatus : System.IEquatable { private readonly object _dummy; @@ -419,6 +601,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus left, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus left, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus right) { throw null; } public override string ToString() { throw null; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.netstandard2.0.cs b/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.netstandard2.0.cs index 2fd4a9817d8e..319597f6d5b1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.netstandard2.0.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/api/Azure.ResourceManager.Quantum.netstandard2.0.cs @@ -8,16 +8,18 @@ internal AzureResourceManagerQuantumContext() { } } public static partial class QuantumExtensions { - public static Azure.Response CheckWorkspaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Pageable GetOfferings(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetOfferingsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CheckWorkspaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetProviderOfferings(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetProviderOfferingsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetQuantumWorkspace(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetQuantumWorkspaceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Quantum.QuantumWorkspaceResource GetQuantumWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Quantum.QuantumWorkspaceCollection GetQuantumWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetQuantumWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetQuantumWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetSuiteOffer(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetSuiteOfferAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class QuantumWorkspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -39,14 +41,12 @@ protected QuantumWorkspaceCollection() { } public partial class QuantumWorkspaceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QuantumWorkspaceData(Azure.Core.AzureLocation location) { } - public System.Uri EndpointUri { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public bool? IsApiKeyEnabled { get { throw null; } set { } } - public System.Collections.Generic.IList Providers { get { throw null; } } - public Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? ProvisioningState { get { throw null; } } - public string StorageAccount { get { throw null; } set { } } - public Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? Usable { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.QuantumWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.QuantumWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -100,38 +100,63 @@ protected MockableQuantumResourceGroupResource() { } public partial class MockableQuantumSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableQuantumSubscriptionResource() { } - public virtual Azure.Response CheckWorkspaceNameAvailability(string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(string locationName, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetOfferings(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetOfferingsAsync(string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CheckWorkspaceNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckWorkspaceNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProviderOfferings(Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProviderOfferingsAsync(Azure.Core.AzureLocation locationName, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetQuantumWorkspaces(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetQuantumWorkspacesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSuiteOffer(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSuiteOfferAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Quantum.Models { public static partial class ArmQuantumModelFactory { + public static Azure.ResourceManager.Quantum.Models.MoboBrokerInfo MoboBrokerInfo(Azure.Core.ResourceIdentifier id = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderAadInfo ProviderAadInfo(string applicationId = null, System.Guid? tenantId = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo ProviderApplicationInfo(string publisherId = null, string offerId = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderPricingDimension ProviderPricingDimension(string id = null, string name = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.ProviderSkuDescription ProviderSkuDescription(string id = null, string name = null, string version = null, string description = null, System.Uri restrictedAccessUri = null, bool? autoAdd = default(bool?), System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDetails = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, System.Collections.Generic.IEnumerable acceptedDataFormats = null, System.Collections.Generic.IEnumerable acceptedContentEncodings = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, System.Collections.Generic.IEnumerable acceptedDataFormats = null, System.Collections.Generic.IEnumerable acceptedContentEncodings = null, int? numQubits = default(int?), string targetProfile = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.QuantumPricingDetail QuantumPricingDetail(string id = null, string value = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.QuantumProviderDescription QuantumProviderDescription(string id = null, string name = null, Azure.ResourceManager.Quantum.Models.QuantumProviderProperties properties = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.QuantumProviderProperties QuantumProviderProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, Azure.ResourceManager.Quantum.Models.ProviderAadInfo aad = null, Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo managedApplication = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable skus = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDimensions = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProviderOffer QuantumProviderOffer(string id = null, string name = null, Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties properties = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties QuantumProviderOfferProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, Azure.ResourceManager.Quantum.Models.ProviderAadInfo aad = null, Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo managedApplication = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable skus = null, System.Collections.Generic.IEnumerable quotaDimensions = null, System.Collections.Generic.IEnumerable pricingDimensions = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension QuantumQuotaDimension(string id = null, string scope = null, string period = null, float? quota = default(float?), string name = null, string description = null, string unit = null, string unitPlural = null) { throw null; } - public static Azure.ResourceManager.Quantum.QuantumWorkspaceData QuantumWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable providers = null, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? usable = default(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus?), Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? provisioningState = default(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus?), string storageAccount = null, System.Uri endpointUri = null, bool? isApiKeyEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer QuantumSuiteOffer(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties properties = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties QuantumSuiteOfferProperties(string providerId = null, string providerName = null, string companyName = null, string location = null, string description = null, Azure.Core.AzureLocation? quotas = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Quantum.QuantumWorkspaceData QuantumWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch QuantumWorkspacePatch(System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties QuantumWorkspaceProperties(System.Collections.Generic.IEnumerable providers = null, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? usable = default(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus?), Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? provisioningState = default(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus?), Azure.Core.ResourceIdentifier storageAccount = null, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? workspaceKind = default(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind?), System.Uri endpointUri = null, bool? isApiKeyEnabled = default(bool?), System.Collections.Generic.IEnumerable managedOnBehalfOfMoboBrokerResources = null, Azure.Core.ResourceIdentifier managedStorageAccount = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.WorkspaceApiKey WorkspaceApiKey(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string key = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys WorkspaceApiKeys(System.Collections.Generic.IEnumerable keys = null) { throw null; } public static Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult WorkspaceKeyListResult(bool? isApiKeyEnabled = default(bool?), Azure.ResourceManager.Quantum.Models.WorkspaceApiKey primaryKey = null, Azure.ResourceManager.Quantum.Models.WorkspaceApiKey secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } - public static Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? reason = default(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason?), string message = null) { throw null; } + } + public partial class MoboBrokerInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MoboBrokerInfo() { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.MoboBrokerInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.MoboBrokerInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.MoboBrokerInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.MoboBrokerInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ProviderAadInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ProviderAadInfo() { } public string ApplicationId { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderAadInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderAadInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderAadInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderAadInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -143,7 +168,10 @@ public partial class ProviderApplicationInfo : System.ClientModel.Primitives.IJs internal ProviderApplicationInfo() { } public string OfferId { get { throw null; } } public string PublisherId { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -155,7 +183,10 @@ public partial class ProviderPricingDimension : System.ClientModel.Primitives.IJ internal ProviderPricingDimension() { } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderPricingDimension JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderPricingDimension PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderPricingDimension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderPricingDimension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -168,17 +199,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public ProviderProvisioningStatus(string value) { throw null; } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Deleted { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Canceled { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Failed { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Launching { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderDeleting { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderLaunching { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderProvisioning { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus ProviderUpdating { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Succeeded { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus Updating { get { throw null; } } public bool Equals(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus other) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus left, Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus left, Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } @@ -189,12 +222,15 @@ internal ProviderSkuDescription() { } public string Description { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } - public System.Collections.Generic.IReadOnlyList PricingDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList QuotaDimensions { get { throw null; } } + public System.Collections.Generic.IList PricingDetails { get { throw null; } } + public System.Collections.Generic.IList QuotaDimensions { get { throw null; } } public System.Uri RestrictedAccessUri { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderSkuDescription JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderSkuDescription PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderSkuDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderSkuDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -204,12 +240,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ProviderTargetDescription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ProviderTargetDescription() { } - public System.Collections.Generic.IReadOnlyList AcceptedContentEncodings { get { throw null; } } - public System.Collections.Generic.IReadOnlyList AcceptedDataFormats { get { throw null; } } + public System.Collections.Generic.IList AcceptedContentEncodings { get { throw null; } } + public System.Collections.Generic.IList AcceptedDataFormats { get { throw null; } } public string Description { get { throw null; } } public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public string Name { get { throw null; } } + public int? NumQubits { get { throw null; } } + public string TargetProfile { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderTargetDescription JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.ProviderTargetDescription PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.ProviderTargetDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.ProviderTargetDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -221,7 +263,10 @@ public partial class QuantumPricingDetail : System.ClientModel.Primitives.IJsonM internal QuantumPricingDetail() { } public string Id { get { throw null; } } public string Value { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumPricingDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumPricingDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumPricingDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumPricingDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -235,47 +280,57 @@ public QuantumProvider() { } public System.Uri InstanceUri { get { throw null; } set { } } public string ProviderId { get { throw null; } set { } } public string ProviderSku { get { throw null; } set { } } - public Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations Quotas { get { throw null; } set { } } public string ResourceUsageId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProvider JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProvider PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class QuantumProviderDescription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class QuantumProviderOffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal QuantumProviderDescription() { } + internal QuantumProviderOffer() { } public string Id { get { throw null; } } public string Name { get { throw null; } } - public Azure.ResourceManager.Quantum.Models.QuantumProviderProperties Properties { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOffer JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderDescription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderDescription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOffer PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumProviderOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumProviderOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class QuantumProviderProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class QuantumProviderOfferProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal QuantumProviderProperties() { } + internal QuantumProviderOfferProperties() { } public Azure.ResourceManager.Quantum.Models.ProviderAadInfo Aad { get { throw null; } } public string Company { get { throw null; } } public string DefaultEndpoint { get { throw null; } } public string Description { get { throw null; } } public Azure.ResourceManager.Quantum.Models.ProviderApplicationInfo ManagedApplication { get { throw null; } } - public System.Collections.Generic.IReadOnlyList PricingDimensions { get { throw null; } } + public System.Collections.Generic.IList PricingDimensions { get { throw null; } } public string ProviderType { get { throw null; } } - public System.Collections.Generic.IReadOnlyList QuotaDimensions { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Skus { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IList QuotaDimensions { get { throw null; } } + public System.Collections.Generic.IList Skus { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Quantum.Models.QuantumProviderProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumProviderOfferProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct QuantumProvisioningStatus : System.IEquatable @@ -283,20 +338,36 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public QuantumProvisioningStatus(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Deleting { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Failed { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderDeleting { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderLaunching { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderProvisioning { get { throw null; } } - public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus ProviderUpdating { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Launching { get { throw null; } } public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus Updating { get { throw null; } } public bool Equals(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus other) { throw null; } public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus left, Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus left, Azure.ResourceManager.Quantum.Models.QuantumProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class QuantumQuotaAllocations : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public QuantumQuotaAllocations(int standardMinutesLifetime) { } + public int? HighMinutesLifetime { get { throw null; } set { } } + public int StandardMinutesLifetime { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumQuotaAllocations System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class QuantumQuotaDimension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal QuantumQuotaDimension() { } @@ -308,30 +379,111 @@ internal QuantumQuotaDimension() { } public string Scope { get { throw null; } } public string Unit { get { throw null; } } public string UnitPlural { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumQuotaDimension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class QuantumSuiteOffer : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QuantumSuiteOffer() { } + public Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class QuantumSuiteOfferProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QuantumSuiteOfferProperties() { } + public string CompanyName { get { throw null; } } + public string Description { get { throw null; } } + public string Location { get { throw null; } } + public string ProviderId { get { throw null; } } + public string ProviderName { get { throw null; } } + public Azure.Core.AzureLocation? Quotas { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumSuiteOfferProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct QuantumWorkspaceKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public QuantumWorkspaceKind(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind V1 { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind V2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind left, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind right) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind left, Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind right) { throw null; } + public override string ToString() { throw null; } + } public partial class QuantumWorkspacePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QuantumWorkspacePatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.QuantumWorkspacePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class QuantumWorkspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public QuantumWorkspaceProperties() { } + public System.Uri EndpointUri { get { throw null; } } + public bool? IsApiKeyEnabled { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ManagedOnBehalfOfMoboBrokerResources { get { throw null; } } + public Azure.Core.ResourceIdentifier ManagedStorageAccount { get { throw null; } } + public System.Collections.Generic.IList Providers { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.ProviderProvisioningStatus? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageAccount { get { throw null; } set { } } + public Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? Usable { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.QuantumWorkspaceKind? WorkspaceKind { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Quantum.Models.QuantumWorkspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class WorkspaceApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal WorkspaceApiKey() { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public string Key { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKey JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKey PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceApiKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceApiKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -342,7 +494,10 @@ public partial class WorkspaceApiKeys : System.ClientModel.Primitives.IJsonModel { public WorkspaceApiKeys() { } public System.Collections.Generic.IList Keys { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceApiKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -357,7 +512,10 @@ internal WorkspaceKeyListResult() { } public Azure.ResourceManager.Quantum.Models.WorkspaceApiKey PrimaryKey { get { throw null; } } public string SecondaryConnectionString { get { throw null; } } public Azure.ResourceManager.Quantum.Models.WorkspaceApiKey SecondaryKey { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceKeyListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -377,6 +535,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceKeyType left, Azure.ResourceManager.Quantum.Models.WorkspaceKeyType right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceKeyType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceKeyType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceKeyType left, Azure.ResourceManager.Quantum.Models.WorkspaceKeyType right) { throw null; } public override string ToString() { throw null; } } @@ -385,7 +544,10 @@ public partial class WorkspaceNameAvailabilityContent : System.ClientModel.Primi public WorkspaceNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -397,8 +559,11 @@ public partial class WorkspaceNameAvailabilityResult : System.ClientModel.Primit internal WorkspaceNameAvailabilityResult() { } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } - public string Reason { get { throw null; } } + public Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? Reason { get { throw null; } } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Quantum.Models.WorkspaceNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -406,6 +571,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WorkspaceNameUnavailableReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WorkspaceNameUnavailableReason(string value) { throw null; } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason other) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason left, Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason right) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason left, Azure.ResourceManager.Quantum.Models.WorkspaceNameUnavailableReason right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct WorkspaceUsableStatus : System.IEquatable { private readonly object _dummy; @@ -419,6 +601,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus left, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus right) { throw null; } public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus left, Azure.ResourceManager.Quantum.Models.WorkspaceUsableStatus right) { throw null; } public override string ToString() { throw null; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/metadata.json b/sdk/quantum/Azure.ResourceManager.Quantum/metadata.json new file mode 100644 index 000000000000..6d63dd374075 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2025-12-15-preview" +} \ No newline at end of file diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Azure.ResourceManager.Quantum.csproj b/sdk/quantum/Azure.ResourceManager.Quantum/src/Azure.ResourceManager.Quantum.csproj index bc4f932c4171..d8e73012bb29 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Azure.ResourceManager.Quantum.csproj +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Azure.ResourceManager.Quantum.csproj @@ -4,6 +4,5 @@ Azure.ResourceManager.Quantum Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.Quantum. azure;management;arm;resource manager;quantum - true diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ArmQuantumModelFactory.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ArmQuantumModelFactory.cs index 1f7c1205d439..21ee1b39f88c 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ArmQuantumModelFactory.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ArmQuantumModelFactory.cs @@ -8,62 +8,184 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - /// Model factory for models. + /// A factory class for creating instances of the models for mocking. public static partial class ArmQuantumModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Managed Identity information. Current supported identity types: SystemAssigned, None. - /// List of Providers selected for this Workspace. - /// Whether the current workspace is ready to accept Jobs. - /// Provisioning status field. - /// ARM Resource Id of the storage account associated with this workspace. - /// The URI of the workspace endpoint. - /// Indicator of enablement of the Quantum workspace Api keys. + + /// The check availability result. + /// Indicates if the resource name is available. + /// The reason why the given name is not available. + /// Detailed reason why the given name is not available. + /// A new instance for mocking. + public static WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = default, WorkspaceNameUnavailableReason? reason = default, string message = default) + { + return new WorkspaceNameAvailabilityResult(isNameAvailable, reason, message, additionalBinaryDataProperties: null); + } + + /// The resource proxy definition object for Quantum Workspace. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. + /// Gets or sets the properties. Define quantum workspace's specific properties. + /// The managed service identities assigned to this resource. /// A new instance for mocking. - public static QuantumWorkspaceData QuantumWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, IEnumerable providers = null, WorkspaceUsableStatus? usable = null, QuantumProvisioningStatus? provisioningState = null, string storageAccount = null, Uri endpointUri = null, bool? isApiKeyEnabled = null) + public static QuantumWorkspaceData QuantumWorkspaceData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, QuantumWorkspaceProperties properties = default, ManagedServiceIdentity identity = default) { - tags ??= new Dictionary(); - providers ??= new List(); + tags ??= new ChangeTrackingDictionary(); return new QuantumWorkspaceData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, tags, location, - identity, - providers?.ToList(), + properties, + identity); + } + + /// List of Providers selected for this Workspace. + /// Whether the current workspace is ready to accept Jobs. + /// Provisioning status field. + /// ARM Resource Id of the storage account associated with this workspace. + /// Whether this workspace is V1 or V2. + /// The URI of the workspace endpoint. + /// Indicator of enablement of the Quantum workspace Api keys. + /// Managed-On-Behalf-Of broker resources. + /// ARM Resource Id of the managed storage account associated with this workspace. + /// A new instance for mocking. + public static QuantumWorkspaceProperties QuantumWorkspaceProperties(IEnumerable providers = default, WorkspaceUsableStatus? usable = default, ProviderProvisioningStatus? provisioningState = default, ResourceIdentifier storageAccount = default, QuantumWorkspaceKind? workspaceKind = default, Uri endpointUri = default, bool? isApiKeyEnabled = default, IEnumerable managedOnBehalfOfMoboBrokerResources = default, ResourceIdentifier managedStorageAccount = default) + { + providers ??= new ChangeTrackingList(); + + return new QuantumWorkspaceProperties( + providers.ToList(), usable, provisioningState, storageAccount, + workspaceKind, endpointUri, isApiKeyEnabled, - serializedAdditionalRawData: null); + managedOnBehalfOfMoboBrokerResources is null ? default : new ManagedOnBehalfOfConfiguration((managedOnBehalfOfMoboBrokerResources ?? new ChangeTrackingList()).ToList(), null), + managedStorageAccount, + additionalBinaryDataProperties: null); + } + + /// Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user. + /// Resource identifier of a Managed-On-Behalf-Of broker resource. + /// A new instance for mocking. + public static MoboBrokerInfo MoboBrokerInfo(ResourceIdentifier id = default) + { + return new MoboBrokerInfo(id, additionalBinaryDataProperties: null); + } + + /// The type used for updating tags in QuantumWorkspace resources. + /// Resource tags. + /// A new instance for mocking. + public static QuantumWorkspacePatch QuantumWorkspacePatch(IDictionary tags = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new QuantumWorkspacePatch(tags, additionalBinaryDataProperties: null); + } + + /// Result of list Api keys and connection strings. + /// Indicator of enablement of the Quantum workspace Api keys. + /// The quantum workspace primary api key. + /// The quantum workspace secondary api key. + /// The connection string of the primary api key. + /// The connection string of the secondary api key. + /// A new instance for mocking. + public static WorkspaceKeyListResult WorkspaceKeyListResult(bool? isApiKeyEnabled = default, WorkspaceApiKey primaryKey = default, WorkspaceApiKey secondaryKey = default, string primaryConnectionString = default, string secondaryConnectionString = default) + { + return new WorkspaceKeyListResult( + isApiKeyEnabled, + primaryKey, + secondaryKey, + primaryConnectionString, + secondaryConnectionString, + additionalBinaryDataProperties: null); + } + + /// Azure quantum workspace Api key details. + /// The creation time of the api key. + /// The Api key. + /// A new instance for mocking. + public static WorkspaceApiKey WorkspaceApiKey(DateTimeOffset? createdOn = default, string key = default) + { + return new WorkspaceApiKey(createdOn, key, additionalBinaryDataProperties: null); + } + + /// List of api keys to be generated. + /// A list of api key names. + /// A new instance for mocking. + public static WorkspaceApiKeys WorkspaceApiKeys(IEnumerable keys = default) + { + keys ??= new ChangeTrackingList(); + + return new WorkspaceApiKeys(keys.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A Quantum Suite Offer that is available to a subscription. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static QuantumSuiteOffer QuantumSuiteOffer(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, QuantumSuiteOfferProperties properties = default) + { + return new QuantumSuiteOffer( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties: null, + properties); + } + + /// Properties of a Quantum Suite Offer. + /// The provider ID of the offer. + /// The provider name of the offer. + /// The name of the company that is providing this offer. + /// The location where this offer is available. + /// Description of the offer. + /// Quota allocations associated with this offer. + /// A new instance for mocking. + public static QuantumSuiteOfferProperties QuantumSuiteOfferProperties(string providerId = default, string providerName = default, string companyName = default, string location = default, string description = default, AzureLocation? quotas = default) + { + return new QuantumSuiteOfferProperties( + providerId, + providerName, + companyName, + location, + description, + quotas, + additionalBinaryDataProperties: null); + } + + /// Information about an offering. A provider offering is an entity that offers Targets to run Azure Quantum Jobs. /// Unique provider's id. /// Provider's display name. /// Provider properties. - /// A new instance for mocking. - public static QuantumProviderDescription QuantumProviderDescription(string id = null, string name = null, QuantumProviderProperties properties = null) + /// A new instance for mocking. + public static QuantumProviderOffer QuantumProviderOffer(string id = default, string name = default, QuantumProviderOfferProperties properties = default) { - return new QuantumProviderDescription(id, name, properties, serializedAdditionalRawData: null); + return new QuantumProviderOffer(id, name, properties, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Provider properties. /// A description about this provider. /// Provider type. /// Company name. @@ -74,68 +196,75 @@ public static QuantumProviderDescription QuantumProviderDescription(string id = /// The list of skus available from this provider. /// The list of quota dimensions from the provider. /// The list of pricing dimensions from the provider. - /// A new instance for mocking. - public static QuantumProviderProperties QuantumProviderProperties(string description = null, string providerType = null, string company = null, string defaultEndpoint = null, ProviderAadInfo aad = null, ProviderApplicationInfo managedApplication = null, IEnumerable targets = null, IEnumerable skus = null, IEnumerable quotaDimensions = null, IEnumerable pricingDimensions = null) + /// A new instance for mocking. + public static QuantumProviderOfferProperties QuantumProviderOfferProperties(string description = default, string providerType = default, string company = default, string defaultEndpoint = default, ProviderAadInfo aad = default, ProviderApplicationInfo managedApplication = default, IEnumerable targets = default, IEnumerable skus = default, IEnumerable quotaDimensions = default, IEnumerable pricingDimensions = default) { - targets ??= new List(); - skus ??= new List(); - quotaDimensions ??= new List(); - pricingDimensions ??= new List(); + targets ??= new ChangeTrackingList(); + skus ??= new ChangeTrackingList(); + quotaDimensions ??= new ChangeTrackingList(); + pricingDimensions ??= new ChangeTrackingList(); - return new QuantumProviderProperties( + return new QuantumProviderOfferProperties( description, providerType, company, defaultEndpoint, aad, managedApplication, - targets?.ToList(), - skus?.ToList(), - quotaDimensions?.ToList(), - pricingDimensions?.ToList(), - serializedAdditionalRawData: null); + targets.ToList(), + skus.ToList(), + quotaDimensions.ToList(), + pricingDimensions.ToList(), + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Azure Active Directory info. /// Provider's application id. /// Provider's tenant id. /// A new instance for mocking. - public static ProviderAadInfo ProviderAadInfo(string applicationId = null, Guid? tenantId = null) + public static ProviderAadInfo ProviderAadInfo(string applicationId = default, Guid? tenantId = default) { - return new ProviderAadInfo(applicationId, tenantId, serializedAdditionalRawData: null); + return new ProviderAadInfo(applicationId, tenantId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Provider's Managed-Application info. /// Provider's publisher id. /// Provider's offer id. /// A new instance for mocking. - public static ProviderApplicationInfo ProviderApplicationInfo(string publisherId = null, string offerId = null) + public static ProviderApplicationInfo ProviderApplicationInfo(string publisherId = default, string offerId = default) { - return new ProviderApplicationInfo(publisherId, offerId, serializedAdditionalRawData: null); + return new ProviderApplicationInfo(publisherId, offerId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information about a Target. A target is the component that can process a specific type of Job. /// Unique target id. /// Display name of this target. /// A description about this target. /// List of data formats accepted by this target. /// List of content encodings accepted by this target. + /// The qubit number. + /// Target QIR profile. + /// The metadata of this target. /// A new instance for mocking. - public static ProviderTargetDescription ProviderTargetDescription(string id = null, string name = null, string description = null, IEnumerable acceptedDataFormats = null, IEnumerable acceptedContentEncodings = null) + public static ProviderTargetDescription ProviderTargetDescription(string id = default, string name = default, string description = default, IEnumerable acceptedDataFormats = default, IEnumerable acceptedContentEncodings = default, int? numQubits = default, string targetProfile = default, IReadOnlyDictionary metadata = default) { - acceptedDataFormats ??= new List(); - acceptedContentEncodings ??= new List(); + acceptedDataFormats ??= new ChangeTrackingList(); + acceptedContentEncodings ??= new ChangeTrackingList(); + metadata ??= new ChangeTrackingDictionary(); return new ProviderTargetDescription( id, name, description, - acceptedDataFormats?.ToList(), - acceptedContentEncodings?.ToList(), - serializedAdditionalRawData: null); + acceptedDataFormats.ToList(), + acceptedContentEncodings.ToList(), + numQubits, + targetProfile, + metadata, + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information about a specific sku. /// Unique sku id. /// Display name of this sku. /// Display name of this sku. @@ -146,11 +275,11 @@ public static ProviderTargetDescription ProviderTargetDescription(string id = nu /// The list of quota dimensions for this sku. /// The list of pricing details for the sku. /// A new instance for mocking. - public static ProviderSkuDescription ProviderSkuDescription(string id = null, string name = null, string version = null, string description = null, Uri restrictedAccessUri = null, bool? autoAdd = null, IEnumerable targets = null, IEnumerable quotaDimensions = null, IEnumerable pricingDetails = null) + public static ProviderSkuDescription ProviderSkuDescription(string id = default, string name = default, string version = default, string description = default, Uri restrictedAccessUri = default, bool? autoAdd = default, IEnumerable targets = default, IEnumerable quotaDimensions = default, IEnumerable pricingDetails = default) { - targets ??= new List(); - quotaDimensions ??= new List(); - pricingDetails ??= new List(); + targets ??= new ChangeTrackingList(); + quotaDimensions ??= new ChangeTrackingList(); + pricingDetails ??= new ChangeTrackingList(); return new ProviderSkuDescription( id, @@ -159,13 +288,13 @@ public static ProviderSkuDescription ProviderSkuDescription(string id = null, st description, restrictedAccessUri, autoAdd, - targets?.ToList(), - quotaDimensions?.ToList(), - pricingDetails?.ToList(), - serializedAdditionalRawData: null); + targets.ToList(), + quotaDimensions.ToList(), + pricingDetails.ToList(), + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information about a specific quota dimension. /// Unique id of this dimension. /// The scope of this quota dimension. /// The reset period of this quota dimension. @@ -175,7 +304,7 @@ public static ProviderSkuDescription ProviderSkuDescription(string id = null, st /// The standard unit of measurement used for this quota dimension. /// The standard unit of measurement used for this quota dimension in plural form. /// A new instance for mocking. - public static QuantumQuotaDimension QuantumQuotaDimension(string id = null, string scope = null, string period = null, float? quota = null, string name = null, string description = null, string unit = null, string unitPlural = null) + public static QuantumQuotaDimension QuantumQuotaDimension(string id = default, string scope = default, string period = default, float? quota = default, string name = default, string description = default, string unit = default, string unitPlural = default) { return new QuantumQuotaDimension( id, @@ -186,62 +315,25 @@ public static QuantumQuotaDimension QuantumQuotaDimension(string id = null, stri description, unit, unitPlural, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Detailed pricing information for an sku. /// Unique id for this pricing information. /// The unit cost of this sku. /// A new instance for mocking. - public static QuantumPricingDetail QuantumPricingDetail(string id = null, string value = null) + public static QuantumPricingDetail QuantumPricingDetail(string id = default, string value = default) { - return new QuantumPricingDetail(id, value, serializedAdditionalRawData: null); + return new QuantumPricingDetail(id, value, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information about pricing dimension. /// Unique id of this pricing dimension. /// The display name of this pricing dimension. /// A new instance for mocking. - public static ProviderPricingDimension ProviderPricingDimension(string id = null, string name = null) - { - return new ProviderPricingDimension(id, name, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Indicator of availability of the Quantum Workspace resource name. - /// The reason of unavailability. - /// The detailed info regarding the reason associated with the Namespace. - /// A new instance for mocking. - public static WorkspaceNameAvailabilityResult WorkspaceNameAvailabilityResult(bool? isNameAvailable = null, string reason = null, string message = null) - { - return new WorkspaceNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Indicator of enablement of the Quantum workspace Api keys. - /// The quantum workspace primary api key. - /// The quantum workspace secondary api key. - /// The connection string of the primary api key. - /// The connection string of the secondary api key. - /// A new instance for mocking. - public static WorkspaceKeyListResult WorkspaceKeyListResult(bool? isApiKeyEnabled = null, WorkspaceApiKey primaryKey = null, WorkspaceApiKey secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) - { - return new WorkspaceKeyListResult( - isApiKeyEnabled, - primaryKey, - secondaryKey, - primaryConnectionString, - secondaryConnectionString, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The creation time of the api key. - /// The Api key. - /// A new instance for mocking. - public static WorkspaceApiKey WorkspaceApiKey(DateTimeOffset? createdOn = null, string key = null) + public static ProviderPricingDimension ProviderPricingDimension(string id = default, string name = default) { - return new WorkspaceApiKey(createdOn, key, serializedAdditionalRawData: null); + return new ProviderPricingDimension(id, name, additionalBinaryDataProperties: null); } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/OfferingsGetProviderOfferingsAsyncCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/OfferingsGetProviderOfferingsAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..613e0c80a8ba --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/OfferingsGetProviderOfferingsAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class OfferingsGetProviderOfferingsAsyncCollectionResultOfT : AsyncPageable + { + private readonly Offerings _client; + private readonly Guid _subscriptionId; + private readonly AzureLocation _locationName; + private readonly string _filter; + private readonly RequestContext _context; + + /// Initializes a new instance of OfferingsGetProviderOfferingsAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Offerings client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// Location. + /// The filter to apply to the operation. Example: '$filter=kind eq 'v1'. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OfferingsGetProviderOfferingsAsyncCollectionResultOfT(Offerings client, Guid subscriptionId, AzureLocation locationName, string filter, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _locationName = locationName; + _filter = filter; + _context = context; + } + + /// Gets the pages of OfferingsGetProviderOfferingsAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OfferingsGetProviderOfferingsAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + OfferingsListResult result = OfferingsListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetProviderOfferingsRequest(nextLink, _subscriptionId, _locationName, _filter, _context) : _client.CreateGetProviderOfferingsRequest(_subscriptionId, _locationName, _filter, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.GetProviderOfferings"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/OfferingsGetProviderOfferingsCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/OfferingsGetProviderOfferingsCollectionResultOfT.cs new file mode 100644 index 000000000000..1947033a0813 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/OfferingsGetProviderOfferingsCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class OfferingsGetProviderOfferingsCollectionResultOfT : Pageable + { + private readonly Offerings _client; + private readonly Guid _subscriptionId; + private readonly AzureLocation _locationName; + private readonly string _filter; + private readonly RequestContext _context; + + /// Initializes a new instance of OfferingsGetProviderOfferingsCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Offerings client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// Location. + /// The filter to apply to the operation. Example: '$filter=kind eq 'v1'. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OfferingsGetProviderOfferingsCollectionResultOfT(Offerings client, Guid subscriptionId, AzureLocation locationName, string filter, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _locationName = locationName; + _filter = filter; + _context = context; + } + + /// Gets the pages of OfferingsGetProviderOfferingsCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OfferingsGetProviderOfferingsCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + OfferingsListResult result = OfferingsListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetProviderOfferingsRequest(nextLink, _subscriptionId, _locationName, _filter, _context) : _client.CreateGetProviderOfferingsRequest(_subscriptionId, _locationName, _filter, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.GetProviderOfferings"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/SuiteOffersGetSuiteOfferAsyncCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/SuiteOffersGetSuiteOfferAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..32668be81a61 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/SuiteOffersGetSuiteOfferAsyncCollectionResultOfT.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class SuiteOffersGetSuiteOfferAsyncCollectionResultOfT : AsyncPageable + { + private readonly SuiteOffers _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of SuiteOffersGetSuiteOfferAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The SuiteOffers client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public SuiteOffersGetSuiteOfferAsyncCollectionResultOfT(SuiteOffers client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of SuiteOffersGetSuiteOfferAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of SuiteOffersGetSuiteOfferAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + QuantumSuiteOfferListResult result = QuantumSuiteOfferListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetSuiteOfferRequest(nextLink, _subscriptionId, _context) : _client.CreateGetSuiteOfferRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.GetSuiteOffer"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/SuiteOffersGetSuiteOfferCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/SuiteOffersGetSuiteOfferCollectionResultOfT.cs new file mode 100644 index 000000000000..24a216c67650 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/SuiteOffersGetSuiteOfferCollectionResultOfT.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class SuiteOffersGetSuiteOfferCollectionResultOfT : Pageable + { + private readonly SuiteOffers _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of SuiteOffersGetSuiteOfferCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The SuiteOffers client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public SuiteOffersGetSuiteOfferCollectionResultOfT(SuiteOffers client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of SuiteOffersGetSuiteOfferCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of SuiteOffersGetSuiteOfferCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + QuantumSuiteOfferListResult result = QuantumSuiteOfferListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetSuiteOfferRequest(nextLink, _subscriptionId, _context) : _client.CreateGetSuiteOfferRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.GetSuiteOffer"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetByResourceGroupAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..4115d5068fad --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetByResourceGroupAsyncCollectionResultOfT.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class WorkspacesGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable + { + private readonly Workspaces _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of WorkspacesGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Workspaces client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public WorkspacesGetByResourceGroupAsyncCollectionResultOfT(Workspaces client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of WorkspacesGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of WorkspacesGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + QuantumWorkspaceListResult result = QuantumWorkspaceListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("QuantumWorkspaceCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetByResourceGroupCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetByResourceGroupCollectionResultOfT.cs new file mode 100644 index 000000000000..f68c740f3b1c --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetByResourceGroupCollectionResultOfT.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class WorkspacesGetByResourceGroupCollectionResultOfT : Pageable + { + private readonly Workspaces _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of WorkspacesGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Workspaces client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public WorkspacesGetByResourceGroupCollectionResultOfT(Workspaces client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of WorkspacesGetByResourceGroupCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of WorkspacesGetByResourceGroupCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + QuantumWorkspaceListResult result = QuantumWorkspaceListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("QuantumWorkspaceCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetBySubscriptionAsyncCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetBySubscriptionAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..a8bfcc6f09ef --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetBySubscriptionAsyncCollectionResultOfT.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class WorkspacesGetBySubscriptionAsyncCollectionResultOfT : AsyncPageable + { + private readonly Workspaces _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of WorkspacesGetBySubscriptionAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Workspaces client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public WorkspacesGetBySubscriptionAsyncCollectionResultOfT(Workspaces client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of WorkspacesGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of WorkspacesGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + QuantumWorkspaceListResult result = QuantumWorkspaceListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.GetQuantumWorkspaces"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetBySubscriptionCollectionResultOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetBySubscriptionCollectionResultOfT.cs new file mode 100644 index 000000000000..492dea74b11d --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/CollectionResults/WorkspacesGetBySubscriptionCollectionResultOfT.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Quantum.Models; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class WorkspacesGetBySubscriptionCollectionResultOfT : Pageable + { + private readonly Workspaces _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of WorkspacesGetBySubscriptionCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Workspaces client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public WorkspacesGetBySubscriptionCollectionResultOfT(Workspaces client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of WorkspacesGetBySubscriptionCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of WorkspacesGetBySubscriptionCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + QuantumWorkspaceListResult result = QuantumWorkspaceListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.GetQuantumWorkspaces"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumArmClient.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumArmClient.cs index 3613b8101ef8..22e4fe1959c2 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumArmClient.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumArmClient.cs @@ -6,38 +6,27 @@ #nullable disable using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Mocking { - /// A class to add extension methods to ArmClient. + /// A class to add extension methods to . public partial class MockableQuantumArmClient : ArmResource { - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableQuantumArmClient for mocking. protected MockableQuantumArmClient() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableQuantumArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) { } - internal MockableQuantumArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual QuantumWorkspaceResource GetQuantumWorkspaceResource(ResourceIdentifier id) diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumResourceGroupResource.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumResourceGroupResource.cs index 7134f5e63e92..8d4b109842d6 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumResourceGroupResource.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumResourceGroupResource.cs @@ -8,33 +8,31 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Quantum; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Quantum.Mocking { - /// A class to add extension methods to ResourceGroupResource. + /// A class to add extension methods to . public partial class MockableQuantumResourceGroupResource : ArmResource { - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableQuantumResourceGroupResource for mocking. protected MockableQuantumResourceGroupResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableQuantumResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of QuantumWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of QuantumWorkspaceResources and their operations over a QuantumWorkspaceResource. + /// Gets a collection of QuantumWorkspaces in the . + /// An object representing collection of QuantumWorkspaces and their operations over a QuantumWorkspaceResource. public virtual QuantumWorkspaceCollection GetQuantumWorkspaces() { return GetCachedClient(client => new QuantumWorkspaceCollection(client, Id)); @@ -44,20 +42,16 @@ public virtual QuantumWorkspaceCollection GetQuantumWorkspaces() /// Returns the Workspace resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// @@ -68,6 +62,8 @@ public virtual QuantumWorkspaceCollection GetQuantumWorkspaces() [ForwardsClientCalls] public virtual async Task> GetQuantumWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + return await GetQuantumWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); } @@ -75,20 +71,16 @@ public virtual async Task> GetQuantumWorkspac /// Returns the Workspace resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// @@ -99,6 +91,8 @@ public virtual async Task> GetQuantumWorkspac [ForwardsClientCalls] public virtual Response GetQuantumWorkspace(string workspaceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + return GetQuantumWorkspaces().Get(workspaceName, cancellationToken); } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumSubscriptionResource.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumSubscriptionResource.cs index 3322d371c408..191e586b231d 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumSubscriptionResource.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/MockableQuantumSubscriptionResource.cs @@ -8,96 +8,92 @@ using System; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Quantum; using Azure.ResourceManager.Quantum.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Quantum.Mocking { - /// A class to add extension methods to SubscriptionResource. + /// A class to add extension methods to . public partial class MockableQuantumSubscriptionResource : ArmResource { - private ClientDiagnostics _quantumWorkspaceWorkspacesClientDiagnostics; - private WorkspacesRestOperations _quantumWorkspaceWorkspacesRestClient; + private ClientDiagnostics _workspacesClientDiagnostics; + private Workspaces _workspacesRestClient; + private ClientDiagnostics _suiteOffersClientDiagnostics; + private SuiteOffers _suiteOffersRestClient; private ClientDiagnostics _offeringsClientDiagnostics; - private OfferingsRestOperations _offeringsRestClient; - private ClientDiagnostics _workspaceClientDiagnostics; - private WorkspaceRestOperations _workspaceRestClient; + private Offerings _offeringsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableQuantumSubscriptionResource for mocking. protected MockableQuantumSubscriptionResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableQuantumSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private ClientDiagnostics QuantumWorkspaceWorkspacesClientDiagnostics => _quantumWorkspaceWorkspacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Quantum", QuantumWorkspaceResource.ResourceType.Namespace, Diagnostics); - private WorkspacesRestOperations QuantumWorkspaceWorkspacesRestClient => _quantumWorkspaceWorkspacesRestClient ??= new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(QuantumWorkspaceResource.ResourceType)); - private ClientDiagnostics OfferingsClientDiagnostics => _offeringsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Quantum", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private OfferingsRestOperations OfferingsRestClient => _offeringsRestClient ??= new OfferingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics WorkspaceClientDiagnostics => _workspaceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Quantum", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private WorkspaceRestOperations WorkspaceRestClient => _workspaceRestClient ??= new WorkspaceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics WorkspacesClientDiagnostics => _workspacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Quantum.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } + private Workspaces WorkspacesRestClient => _workspacesRestClient ??= new Workspaces(WorkspacesClientDiagnostics, Pipeline, Endpoint, "2025-12-15-preview"); + + private ClientDiagnostics SuiteOffersClientDiagnostics => _suiteOffersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Quantum.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private SuiteOffers SuiteOffersRestClient => _suiteOffersRestClient ??= new SuiteOffers(SuiteOffersClientDiagnostics, Pipeline, Endpoint, "2025-12-15-preview"); + + private ClientDiagnostics OfferingsClientDiagnostics => _offeringsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Quantum.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private Offerings OfferingsRestClient => _offeringsRestClient ??= new Offerings(OfferingsClientDiagnostics, Pipeline, Endpoint, "2025-12-15-preview"); /// /// Gets the list of Workspaces within a Subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces - /// - /// - /// Operation Id - /// Workspaces_ListBySubscription + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_ListBySubscription. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetQuantumWorkspacesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), QuantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableQuantumSubscriptionResource.GetQuantumWorkspaces", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new WorkspacesGetBySubscriptionAsyncCollectionResultOfT(WorkspacesRestClient, Guid.Parse(Id.SubscriptionId), context), data => new QuantumWorkspaceResource(Client, data)); } /// /// Gets the list of Workspaces within a Subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces - /// - /// - /// Operation Id - /// Workspaces_ListBySubscription + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_ListBySubscription. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// @@ -105,105 +101,109 @@ public virtual AsyncPageable GetQuantumWorkspacesAsync /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetQuantumWorkspaces(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), QuantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableQuantumSubscriptionResource.GetQuantumWorkspaces", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new WorkspacesGetBySubscriptionCollectionResultOfT(WorkspacesRestClient, Guid.Parse(Id.SubscriptionId), context), data => new QuantumWorkspaceResource(Client, data)); } /// - /// Returns the list of all provider offerings available for the given location. + /// Returns the SuiteOffer resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/suiteOffers. /// /// - /// Operation Id - /// Offerings_List + /// Operation Id. + /// SuiteOffers_ListBySubscription. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// - /// Location. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetOfferingsAsync(string locationName, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSuiteOfferAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => OfferingsRestClient.CreateListRequest(Id.SubscriptionId, locationName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OfferingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => QuantumProviderDescription.DeserializeQuantumProviderDescription(e), OfferingsClientDiagnostics, Pipeline, "MockableQuantumSubscriptionResource.GetOfferings", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new SuiteOffersGetSuiteOfferAsyncCollectionResultOfT(SuiteOffersRestClient, Guid.Parse(Id.SubscriptionId), context); } /// - /// Returns the list of all provider offerings available for the given location. + /// Returns the SuiteOffer resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/suiteOffers. /// /// - /// Operation Id - /// Offerings_List + /// Operation Id. + /// SuiteOffers_ListBySubscription. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// - /// Location. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetOfferings(string locationName, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSuiteOffer(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => OfferingsRestClient.CreateListRequest(Id.SubscriptionId, locationName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OfferingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => QuantumProviderDescription.DeserializeQuantumProviderDescription(e), OfferingsClientDiagnostics, Pipeline, "MockableQuantumSubscriptionResource.GetOfferings", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new SuiteOffersGetSuiteOfferCollectionResultOfT(SuiteOffersRestClient, Guid.Parse(Id.SubscriptionId), context); } /// - /// Check the availability of the resource name. + /// Check the availability of the resource name for the given location. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/checkNameAvailability + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{location}/checkNameAvailability. /// /// - /// Operation Id - /// Workspace_CheckNameAvailability + /// Operation Id. + /// Workspaces_CheckNameAvailability. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// - /// Location. - /// The name and type of the resource. + /// The name of the Azure region. + /// The CheckAvailability request. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CheckWorkspaceNameAvailabilityAsync(string locationName, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> CheckWorkspaceNameAvailabilityAsync(AzureLocation location, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = WorkspaceClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.CheckWorkspaceNameAvailability"); + using DiagnosticScope scope = WorkspacesClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.CheckWorkspaceNameAvailability"); scope.Start(); try { - var response = await WorkspaceRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, locationName, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = WorkspacesRestClient.CreateCheckWorkspaceNameAvailabilityRequest(Guid.Parse(Id.SubscriptionId), location, WorkspaceNameAvailabilityContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(WorkspaceNameAvailabilityResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -214,37 +214,45 @@ public virtual async Task> CheckWorksp } /// - /// Check the availability of the resource name. + /// Check the availability of the resource name for the given location. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/checkNameAvailability + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{location}/checkNameAvailability. /// /// - /// Operation Id - /// Workspace_CheckNameAvailability + /// Operation Id. + /// Workspaces_CheckNameAvailability. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// - /// Location. - /// The name and type of the resource. + /// The name of the Azure region. + /// The CheckAvailability request. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual Response CheckWorkspaceNameAvailability(string locationName, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual Response CheckWorkspaceNameAvailability(AzureLocation location, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = WorkspaceClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.CheckWorkspaceNameAvailability"); + using DiagnosticScope scope = WorkspacesClientDiagnostics.CreateScope("MockableQuantumSubscriptionResource.CheckWorkspaceNameAvailability"); scope.Start(); try { - var response = WorkspaceRestClient.CheckNameAvailability(Id.SubscriptionId, locationName, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = WorkspacesRestClient.CreateCheckWorkspaceNameAvailabilityRequest(Guid.Parse(Id.SubscriptionId), location, WorkspaceNameAvailabilityContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(WorkspaceNameAvailabilityResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -253,5 +261,65 @@ public virtual Response CheckWorkspaceNameAvail throw; } } + + /// + /// Returns the list of all provider offerings available for the given location. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings. + /// + /// + /// Operation Id. + /// Offerings_List. + /// + /// + /// Default Api Version. + /// 2025-12-15-preview. + /// + /// + /// + /// Location. + /// The filter to apply to the operation. Example: '$filter=kind eq 'v1'. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetProviderOfferingsAsync(AzureLocation locationName, string filter = default, CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new OfferingsGetProviderOfferingsAsyncCollectionResultOfT(OfferingsRestClient, Guid.Parse(Id.SubscriptionId), locationName, filter, context); + } + + /// + /// Returns the list of all provider offerings available for the given location. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings. + /// + /// + /// Operation Id. + /// Offerings_List. + /// + /// + /// Default Api Version. + /// 2025-12-15-preview. + /// + /// + /// + /// Location. + /// The filter to apply to the operation. Example: '$filter=kind eq 'v1'. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetProviderOfferings(AzureLocation locationName, string filter = default, CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new OfferingsGetProviderOfferingsCollectionResultOfT(OfferingsRestClient, Guid.Parse(Id.SubscriptionId), locationName, filter, context); + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs index bd5b3d47c224..9b59c5e80f0d 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs @@ -8,7 +8,9 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; using Azure.ResourceManager.Quantum.Mocking; using Azure.ResourceManager.Quantum.Models; using Azure.ResourceManager.Resources; @@ -18,30 +20,32 @@ namespace Azure.ResourceManager.Quantum /// A class to add extension methods to Azure.ResourceManager.Quantum. public static partial class QuantumExtensions { + /// private static MockableQuantumArmClient GetMockableQuantumArmClient(ArmClient client) { - return client.GetCachedClient(client0 => new MockableQuantumArmClient(client0)); + return client.GetCachedClient(client0 => new MockableQuantumArmClient(client0, ResourceIdentifier.Root)); } - private static MockableQuantumResourceGroupResource GetMockableQuantumResourceGroupResource(ArmResource resource) + /// + private static MockableQuantumResourceGroupResource GetMockableQuantumResourceGroupResource(ResourceGroupResource resourceGroupResource) { - return resource.GetCachedClient(client => new MockableQuantumResourceGroupResource(client, resource.Id)); + return resourceGroupResource.GetCachedClient(client => new MockableQuantumResourceGroupResource(client, resourceGroupResource.Id)); } - private static MockableQuantumSubscriptionResource GetMockableQuantumSubscriptionResource(ArmResource resource) + /// + private static MockableQuantumSubscriptionResource GetMockableQuantumSubscriptionResource(SubscriptionResource subscriptionResource) { - return resource.GetCachedClient(client => new MockableQuantumSubscriptionResource(client, resource.Id)); + return subscriptionResource.GetCachedClient(client => new MockableQuantumSubscriptionResource(client, subscriptionResource.Id)); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -53,15 +57,15 @@ public static QuantumWorkspaceResource GetQuantumWorkspaceResource(this ArmClien } /// - /// Gets a collection of QuantumWorkspaceResources in the ResourceGroupResource. + /// Gets a collection of QuantumWorkspaces in the /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// is null. - /// An object representing collection of QuantumWorkspaceResources and their operations over a QuantumWorkspaceResource. + /// An object representing collection of QuantumWorkspaces and their operations over a QuantumWorkspaceResource. public static QuantumWorkspaceCollection GetQuantumWorkspaces(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); @@ -71,34 +75,15 @@ public static QuantumWorkspaceCollection GetQuantumWorkspaces(this ResourceGroup /// /// Returns the Workspace resource associated with the given name. - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The name of the quantum workspace resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static async Task> GetQuantumWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { @@ -109,34 +94,15 @@ public static async Task> GetQuantumWorkspace /// /// Returns the Workspace resource associated with the given name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The name of the quantum workspace resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static Response GetQuantumWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { @@ -147,33 +113,15 @@ public static Response GetQuantumWorkspace(this Resour /// /// Gets the list of Workspaces within a Subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces - /// - /// - /// Operation Id - /// Workspaces_ListBySubscription - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public static AsyncPageable GetQuantumWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -183,30 +131,12 @@ public static AsyncPageable GetQuantumWorkspacesAsync( /// /// Gets the list of Workspaces within a Subscription. - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces - /// - /// - /// Operation Id - /// Workspaces_ListBySubscription - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The cancellation token to use. /// is null. /// A collection of that may take multiple service requests to iterate over. @@ -218,139 +148,117 @@ public static Pageable GetQuantumWorkspaces(this Subsc } /// - /// Returns the list of all provider offerings available for the given location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings - /// - /// - /// Operation Id - /// Offerings_List - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// + /// Returns the SuiteOffer resource associated with the given name. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. - /// Location. + /// The the method will execute against. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetOfferingsAsync(this SubscriptionResource subscriptionResource, string locationName, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetSuiteOfferAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableQuantumSubscriptionResource(subscriptionResource).GetOfferingsAsync(locationName, cancellationToken); + return GetMockableQuantumSubscriptionResource(subscriptionResource).GetSuiteOfferAsync(cancellationToken); } /// - /// Returns the list of all provider offerings available for the given location. - /// + /// Returns the SuiteOffer resource associated with the given name. /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings - /// - /// - /// Operation Id - /// Offerings_List - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. - /// Location. + /// The the method will execute against. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetOfferings(this SubscriptionResource subscriptionResource, string locationName, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetSuiteOffer(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableQuantumSubscriptionResource(subscriptionResource).GetOfferings(locationName, cancellationToken); + return GetMockableQuantumSubscriptionResource(subscriptionResource).GetSuiteOffer(cancellationToken); } /// - /// Check the availability of the resource name. - /// + /// Check the availability of the resource name for the given location. /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/checkNameAvailability - /// - /// - /// Operation Id - /// Workspace_CheckNameAvailability + /// Mocking. + /// To mock this method, please mock instead. /// + /// + /// The the method will execute against. + /// The name of the Azure region. + /// The CheckAvailability request. + /// The cancellation token to use. + /// is null. + public static async Task> CheckWorkspaceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableQuantumSubscriptionResource(subscriptionResource).CheckWorkspaceNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Check the availability of the resource name for the given location. /// - /// Default Api Version - /// 2023-11-13-preview + /// Mocking. + /// To mock this method, please mock instead. /// - /// + /// + /// The the method will execute against. + /// The name of the Azure region. + /// The CheckAvailability request. + /// The cancellation token to use. + /// is null. + public static Response CheckWorkspaceNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableQuantumSubscriptionResource(subscriptionResource).CheckWorkspaceNameAvailability(location, content, cancellationToken); + } + + /// + /// Returns the list of all provider offerings available for the given location. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// Location. - /// The name and type of the resource. + /// The filter to apply to the operation. Example: '$filter=kind eq 'v1'. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// , or is null. - public static async Task> CheckWorkspaceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, string locationName, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetProviderOfferingsAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string filter = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableQuantumSubscriptionResource(subscriptionResource).CheckWorkspaceNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return GetMockableQuantumSubscriptionResource(subscriptionResource).GetProviderOfferingsAsync(locationName, filter, cancellationToken); } /// - /// Check the availability of the resource name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/checkNameAvailability - /// - /// - /// Operation Id - /// Workspace_CheckNameAvailability - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// + /// Returns the list of all provider offerings available for the given location. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// Location. - /// The name and type of the resource. + /// The filter to apply to the operation. Example: '$filter=kind eq 'v1'. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// , or is null. - public static Response CheckWorkspaceNameAvailability(this SubscriptionResource subscriptionResource, string locationName, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetProviderOfferings(this SubscriptionResource subscriptionResource, AzureLocation locationName, string filter = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableQuantumSubscriptionResource(subscriptionResource).CheckWorkspaceNameAvailability(locationName, content, cancellationToken); + return GetMockableQuantumSubscriptionResource(subscriptionResource).GetProviderOfferings(locationName, filter, cancellationToken); } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Argument.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Argument.cs index b5d0d0f945c6..05f5b0313073 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Argument.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Argument.cs @@ -11,8 +11,10 @@ namespace Azure.ResourceManager.Quantum { - internal static class Argument + internal static partial class Argument { + /// The value. + /// The name. public static void AssertNotNull(T value, string name) { if (value is null) @@ -21,8 +23,10 @@ public static void AssertNotNull(T value, string name) } } + /// The value. + /// The name. public static void AssertNotNull(T? value, string name) - where T : struct + where T : struct { if (!value.HasValue) { @@ -30,6 +34,8 @@ public static void AssertNotNull(T? value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(IEnumerable value, string name) { if (value is null) @@ -51,6 +57,8 @@ public static void AssertNotNullOrEmpty(IEnumerable value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(string value, string name) { if (value is null) @@ -62,68 +70,5 @@ public static void AssertNotNullOrEmpty(string value, string name) throw new ArgumentException("Value cannot be an empty string.", name); } } - - public static void AssertNotNullOrWhiteSpace(string value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); - } - } - - public static void AssertNotDefault(ref T value, string name) - where T : struct, IEquatable - { - if (value.Equals(default)) - { - throw new ArgumentException("Value cannot be empty.", name); - } - } - - public static void AssertInRange(T value, T minimum, T maximum, string name) - where T : notnull, IComparable - { - if (minimum.CompareTo(value) > 0) - { - throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); - } - if (maximum.CompareTo(value) < 0) - { - throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); - } - } - - public static void AssertEnumDefined(Type enumType, object value, string name) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); - } - } - - public static T CheckNotNull(T value, string name) - where T : class - { - AssertNotNull(value, name); - return value; - } - - public static string CheckNotNullOrEmpty(string value, string name) - { - AssertNotNullOrEmpty(value, name); - return value; - } - - public static void AssertNull(T value, string name, string message = null) - { - if (value != null) - { - throw new ArgumentException(message ?? "Value must be null.", name); - } - } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/AsyncPageableWrapper.cs new file mode 100644 index 000000000000..30e2a3629f74 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/AsyncPageableWrapper.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class AsyncPageableWrapper : AsyncPageable + { + /// The source async pageable value of type AsyncPageable<T>. + private AsyncPageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the AsyncPageableWrapper class. + /// The source async pageable value of type AsyncPageable<T>. + /// The converter function from T to U. + public AsyncPageableWrapper(AsyncPageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from AsyncPageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + await foreach (Page page in _source.AsPages(continuationToken, pageSizeHint).ConfigureAwait(false)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingDictionary.cs index cb44e3c6cc84..f4be8f6456d1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -11,7 +11,8 @@ namespace Azure.ResourceManager.Quantum { - internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary + where TKey : notnull { private IDictionary _innerDictionary; @@ -19,6 +20,7 @@ public ChangeTrackingDictionary() { } + /// The inner dictionary. public ChangeTrackingDictionary(IDictionary dictionary) { if (dictionary == null) @@ -28,6 +30,7 @@ public ChangeTrackingDictionary(IDictionary dictionary) _innerDictionary = new Dictionary(dictionary); } + /// The inner dictionary. public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) { if (dictionary == null) @@ -41,16 +44,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerDictionary == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + /// Gets the Keys. public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + /// Gets the Values. public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + /// Gets or sets the value associated with the specified key. public TValue this[TKey key] { get @@ -67,8 +76,10 @@ public TValue this[TKey key] } } + /// Gets the Keys. IEnumerable IReadOnlyDictionary.Keys => Keys; + /// Gets the Values. IEnumerable IReadOnlyDictionary.Values => Values; public IEnumerator> GetEnumerator() @@ -89,6 +100,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(KeyValuePair item) { EnsureDictionary().Add(item); @@ -99,6 +111,7 @@ public void Clear() EnsureDictionary().Clear(); } + /// The item to search for. public bool Contains(KeyValuePair item) { if (IsUndefined) @@ -108,6 +121,8 @@ public bool Contains(KeyValuePair item) return EnsureDictionary().Contains(item); } + /// The array to copy. + /// The index. public void CopyTo(KeyValuePair[] array, int index) { if (IsUndefined) @@ -117,6 +132,7 @@ public void CopyTo(KeyValuePair[] array, int index) EnsureDictionary().CopyTo(array, index); } + /// The item to remove. public bool Remove(KeyValuePair item) { if (IsUndefined) @@ -126,11 +142,14 @@ public bool Remove(KeyValuePair item) return EnsureDictionary().Remove(item); } + /// The key. + /// The value to add. public void Add(TKey key, TValue value) { EnsureDictionary().Add(key, value); } + /// The key to search for. public bool ContainsKey(TKey key) { if (IsUndefined) @@ -140,6 +159,7 @@ public bool ContainsKey(TKey key) return EnsureDictionary().ContainsKey(key); } + /// The key. public bool Remove(TKey key) { if (IsUndefined) @@ -149,6 +169,8 @@ public bool Remove(TKey key) return EnsureDictionary().Remove(key); } + /// The key to search for. + /// The value. public bool TryGetValue(TKey key, out TValue value) { if (IsUndefined) diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingList.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingList.cs index b8b8531d1281..54c89fb0e37c 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingList.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ChangeTrackingList.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Quantum { - internal class ChangeTrackingList : IList, IReadOnlyList + internal partial class ChangeTrackingList : IList, IReadOnlyList { private IList _innerList; @@ -20,6 +20,7 @@ public ChangeTrackingList() { } + /// The inner list. public ChangeTrackingList(IList innerList) { if (innerList != null) @@ -28,6 +29,7 @@ public ChangeTrackingList(IList innerList) } } + /// The inner list. public ChangeTrackingList(IReadOnlyList innerList) { if (innerList != null) @@ -36,12 +38,16 @@ public ChangeTrackingList(IReadOnlyList innerList) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerList == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureList().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + /// Gets or sets the value associated with the specified key. public T this[int index] { get @@ -85,6 +91,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(T item) { EnsureList().Add(item); @@ -95,6 +102,7 @@ public void Clear() EnsureList().Clear(); } + /// The item. public bool Contains(T item) { if (IsUndefined) @@ -104,6 +112,8 @@ public bool Contains(T item) return EnsureList().Contains(item); } + /// The array to copy to. + /// The array index. public void CopyTo(T[] array, int arrayIndex) { if (IsUndefined) @@ -113,6 +123,7 @@ public void CopyTo(T[] array, int arrayIndex) EnsureList().CopyTo(array, arrayIndex); } + /// The item. public bool Remove(T item) { if (IsUndefined) @@ -122,6 +133,7 @@ public bool Remove(T item) return EnsureList().Remove(item); } + /// The item. public int IndexOf(T item) { if (IsUndefined) @@ -131,11 +143,14 @@ public int IndexOf(T item) return EnsureList().IndexOf(item); } + /// The inner list. + /// The item. public void Insert(int index, T item) { EnsureList().Insert(index, item); } + /// The inner list. public void RemoveAt(int index) { if (IsUndefined) diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ClientPipelineExtensions.cs new file mode 100644 index 000000000000..da3982e77a26 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ClientPipelineExtensions.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Quantum +{ + internal static partial class ClientPipelineExtensions + { + public static async ValueTask ProcessMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse(); + await pipeline.SendAsync(message, userCancellationToken).ConfigureAwait(false); + + if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static Response ProcessMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse(); + pipeline.Send(message, userCancellationToken); + + if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static async ValueTask> ProcessHeadAsBoolMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = await pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + + public static Response ProcessHeadAsBoolMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = pipeline.ProcessMessage(message, context); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..72778edeb7e4 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + /// The original name of the member. + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..dfcabf517497 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + /// The property name which these hooks apply to. + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + /// The property name which these hooks apply to. + /// The serialization name of the property. + public CodeGenSerializationAttribute(string propertyName, string serializationName) + { + PropertyName = propertyName; + SerializationName = serializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string SerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..38d536e69173 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + /// The member to suppress. + /// The types of the parameters of the member. + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..f36b5f513173 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + /// The original name of the type. + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ErrorResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ErrorResult.cs new file mode 100644 index 000000000000..152f9c5cfa04 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ErrorResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class ErrorResult : Response + { + private readonly Response _response; + private readonly RequestFailedException _exception; + + public ErrorResult(Response response, RequestFailedException exception) + { + _response = response; + _exception = exception; + } + + /// Gets the Value. + public override T Value => throw _exception; + + /// + public override Response GetRawResponse() + { + return _response; + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ModelSerializationExtensions.cs index 6d34eecd55f6..61534abe2ca8 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/ModelSerializationExtensions.cs @@ -10,19 +10,18 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using System.Runtime.InteropServices; using System.Text.Json; -using System.Xml; -using Azure.Core; namespace Azure.ResourceManager.Quantum { - internal static class ModelSerializationExtensions + internal static partial class ModelSerializationExtensions { - internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); - internal static readonly ModelReaderWriterOptions WireV3Options = new ModelReaderWriterOptions("W|v3"); - internal static readonly ModelReaderWriterOptions JsonV3Options = new ModelReaderWriterOptions("J|v3"); - internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions + { + MaxDepth = 256 + }; public static object GetObject(this JsonElement element) { @@ -48,14 +47,14 @@ public static object GetObject(this JsonElement element) case JsonValueKind.Null: return null; case JsonValueKind.Object: - var dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var jsonProperty in element.EnumerateObject()) { dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); } return dictionary; case JsonValueKind.Array: - var list = new List(); + List list = new List(); foreach (var item in element.EnumerateArray()) { list.Add(item.GetObject()); @@ -93,7 +92,7 @@ public static char GetChar(this JsonElement element) { if (element.ValueKind == JsonValueKind.String) { - var text = element.GetString(); + string text = element.GetString(); if (text == null || text.Length != 1) { throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); @@ -107,14 +106,14 @@ public static char GetChar(this JsonElement element) } [Conditional("DEBUG")] - public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + public static void ThrowNonNullablePropertyIsNull(this JsonProperty @property) { - throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + throw new JsonException($"A property '{@property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); } public static string GetRequiredString(this JsonElement element) { - var value = element.GetString(); + string value = element.GetString(); if (value == null) { throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); @@ -181,9 +180,6 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, T value, Mode case IJsonModel jsonModel: jsonModel.Write(writer, options ?? WireOptions); break; - case IUtf8JsonSerializable serializable: - serializable.Write(writer); - break; case byte[] bytes: writer.WriteBase64StringValue(bytes); break; @@ -260,150 +256,13 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo writer.WriteObjectValue(value, options); } - internal static bool IsSentinelValue(BinaryData value) - { - ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; - ReadOnlySpan valueSpan = value.ToMemory().Span; - return sentinelSpan.SequenceEqual(valueSpan); - } - - internal static class TypeFormatters + public static BinaryData GetUtf8Bytes(this JsonElement element) { - private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; - public const string DefaultNumberFormat = "G"; - - public static string ToString(bool value) => value ? "true" : "false"; - - public static string ToString(DateTime value, string format) => value.Kind switch - { - DateTimeKind.Utc => ToString((DateTimeOffset)value, format), - _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") - }; - - public static string ToString(DateTimeOffset value, string format) => format switch - { - "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), - "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), - "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "R" => value.ToString("r", CultureInfo.InvariantCulture), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(TimeSpan value, string format) => format switch - { - "P" => XmlConvert.ToString(value), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(byte[] value, string format) => format switch - { - "U" => ToBase64UrlString(value), - "D" => Convert.ToBase64String(value), - _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) - }; - - public static string ToBase64UrlString(byte[] value) - { - int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; - int size = checked(numWholeOrPartialInputBlocks * 4); - char[] output = new char[size]; - - int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); - - int i = 0; - for (; i < numBase64Chars; i++) - { - char ch = output[i]; - if (ch == '+') - { - output[i] = '-'; - } - else - { - if (ch == '/') - { - output[i] = '_'; - } - else - { - if (ch == '=') - { - break; - } - } - } - } - - return new string(output, 0, i); - } - - public static byte[] FromBase64UrlString(string value) - { - int paddingCharsToAdd = (value.Length % 4) switch - { - 0 => 0, - 2 => 2, - 3 => 1, - _ => throw new InvalidOperationException("Malformed input") - }; - char[] output = new char[(value.Length + paddingCharsToAdd)]; - int i = 0; - for (; i < value.Length; i++) - { - char ch = value[i]; - if (ch == '-') - { - output[i] = '+'; - } - else - { - if (ch == '_') - { - output[i] = '/'; - } - else - { - output[i] = ch; - } - } - } - - for (; i < output.Length; i++) - { - output[i] = '='; - } - - return Convert.FromBase64CharArray(output, 0, output.Length); - } - - public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch - { - "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), - _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) - }; - - public static TimeSpan ParseTimeSpan(string value, string format) => format switch - { - "P" => XmlConvert.ToTimeSpan(value), - _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) - }; - - public static string ConvertToString(object value, string format = null) => value switch - { - null => "null", - string s => s, - bool b => ToString(b), - int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), - byte[] b0 when format != null => ToString(b0, format), - IEnumerable s0 => string.Join(",", s0), - DateTimeOffset dateTime when format != null => ToString(dateTime, format), - TimeSpan timeSpan when format != null => ToString(timeSpan, format), - TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), - Guid guid => guid.ToString(), - BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), - _ => value.ToString() - }; +#if NET9_0_OR_GREATER + return new global::System.BinaryData(global::System.Runtime.InteropServices.JsonMarshal.GetRawUtf8Value(element).ToArray()); +#else + return BinaryData.FromString(element.GetRawText()); +#endif } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Optional.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Optional.cs index 41a9201f01da..8846d89efa6e 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Optional.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Optional.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Quantum { - internal static class Optional + internal static partial class Optional { public static bool IsCollectionDefined(IEnumerable collection) { @@ -28,7 +28,7 @@ public static bool IsCollectionDefined(IReadOnlyDictionary(T? value) - where T : struct + where T : struct { return value.HasValue; } @@ -38,14 +38,14 @@ public static bool IsDefined(object value) return value != null; } - public static bool IsDefined(JsonElement value) + public static bool IsDefined(string value) { - return value.ValueKind != JsonValueKind.Undefined; + return value != null; } - public static bool IsDefined(string value) + public static bool IsDefined(JsonElement value) { - return value != null; + return value.ValueKind != JsonValueKind.Undefined; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/PageableWrapper.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/PageableWrapper.cs new file mode 100644 index 000000000000..ab851e236650 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/PageableWrapper.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class PageableWrapper : Pageable + { + /// The source pageable value of type Pageable<T>. + private Pageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the PageableWrapper class. + /// The source pageable value of type Pageable<T>. + /// The converter function from T to U. + public PageableWrapper(Pageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from Pageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + foreach (Page page in _source.AsPages(continuationToken, pageSizeHint)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/RawRequestUriBuilderExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/RawRequestUriBuilderExtensions.cs new file mode 100644 index 000000000000..b89352af64fd --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/RawRequestUriBuilderExtensions.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Quantum +{ + internal static partial class RawRequestUriBuilderExtensions + { + public static void AppendQueryDelimited(this RawRequestUriBuilder builder, string name, IEnumerable value, string delimiter, SerializationFormat format = SerializationFormat.Default, bool escape = true) + { + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + builder.AppendQuery(name, string.Join(delimiter, stringValues), escape); + } + + public static void UpdateQuery(this RawRequestUriBuilder builder, string name, string value) + { + string currentQuery = builder.Query; + string searchPattern = string.Concat(name, "="); + int paramStartIndex = -1; + if (currentQuery.StartsWith(string.Concat("?", searchPattern))) + { + paramStartIndex = 1; + } + if (paramStartIndex == -1) + { + string prefixedPattern = string.Concat("&", searchPattern); + int prefixedIndex = currentQuery.IndexOf(prefixedPattern); + if (prefixedIndex >= 0) + { + paramStartIndex = prefixedIndex + 1; + } + } + if (paramStartIndex >= 0) + { + int valueStartIndex = paramStartIndex + searchPattern.Length; + int valueEndIndex = currentQuery.IndexOf('&', valueStartIndex); + if (valueEndIndex == -1) + { + valueEndIndex = currentQuery.Length; + } + string beforeParam = currentQuery.Substring(0, valueStartIndex); + string afterParam = currentQuery.Substring(valueEndIndex); + string newQuery = string.Concat(beforeParam, value, afterParam); + builder.Query = newQuery; + } + else + { + builder.AppendQuery(name, value, true); + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/RequestContextExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/RequestContextExtensions.cs new file mode 100644 index 000000000000..c5818a62b635 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/RequestContextExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Azure; + +namespace Azure.ResourceManager.Quantum +{ + internal static partial class RequestContextExtensions + { + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + public static ValueTuple Parse(this RequestContext context) + { + if (context == null) + { + return (CancellationToken.None, ErrorOptions.Default); + } + return (context.CancellationToken, context.ErrorOptions); + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/SerializationFormat.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/SerializationFormat.cs new file mode 100644 index 000000000000..2fe08d176c66 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/SerializationFormat.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Quantum +{ + internal enum SerializationFormat + { + /// The default serialization format. + Default = 0, + /// The RFC1123 date time format. + DateTime_RFC1123 = 1, + /// The RFC3339 date time format. + DateTime_RFC3339 = 2, + /// The RFC7231 date time format. + DateTime_RFC7231 = 3, + /// The ISO8601 date time format. + DateTime_ISO8601 = 4, + /// The Unix date time format. + DateTime_Unix = 5, + /// The ISO8601 date format. + Date_ISO8601 = 6, + /// The ISO8601 duration format. + Duration_ISO8601 = 7, + /// The constant duration format. + Duration_Constant = 8, + /// The seconds duration format. + Duration_Seconds = 9, + /// The seconds duration format with float precision. + Duration_Seconds_Float = 10, + /// The seconds duration format with double precision. + Duration_Seconds_Double = 11, + /// The milliseconds duration format. + Duration_Milliseconds = 12, + /// The milliseconds duration format with float precision. + Duration_Milliseconds_Float = 13, + /// The milliseconds duration format with double precision. + Duration_Milliseconds_Double = 14, + /// The ISO8601 time format. + Time_ISO8601 = 15, + /// The Base64Url bytes format. + Bytes_Base64Url = 16, + /// The Base64 bytes format. + Bytes_Base64 = 17 + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/TypeFormatters.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000000..7a549a93cf95 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/TypeFormatters.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Xml; + +namespace Azure.ResourceManager.Quantum +{ + internal static partial class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Generated clients require it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked (value.Length + 2) / 3; + int size = checked (numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ToFormatSpecifier(SerializationFormat format) => format switch + { + SerializationFormat.DateTime_RFC1123 => "R", + SerializationFormat.DateTime_RFC3339 => "O", + SerializationFormat.DateTime_RFC7231 => "R", + SerializationFormat.DateTime_ISO8601 => "O", + SerializationFormat.Date_ISO8601 => "D", + SerializationFormat.DateTime_Unix => "U", + SerializationFormat.Bytes_Base64Url => "U", + SerializationFormat.Bytes_Base64 => "D", + SerializationFormat.Duration_ISO8601 => "P", + SerializationFormat.Duration_Constant => "c", + SerializationFormat.Duration_Seconds => "%s", + SerializationFormat.Duration_Seconds_Float => "s\\.FFF", + SerializationFormat.Duration_Seconds_Double => "s\\.FFFFFF", + SerializationFormat.Time_ISO8601 => "T", + _ => null + }; + + public static string ConvertToString(object value, SerializationFormat format = SerializationFormat.Default) + { + string formatSpecifier = ToFormatSpecifier(format); + + return value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when formatSpecifier != null => ToString(b0, formatSpecifier), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when formatSpecifier != null => ToString(dateTime, formatSpecifier), + TimeSpan timeSpan when format == SerializationFormat.Duration_Seconds => Convert.ToInt32(timeSpan.TotalSeconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan0 when format == SerializationFormat.Duration_Seconds_Float || format == SerializationFormat.Duration_Seconds_Double => timeSpan0.TotalSeconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan1 when format == SerializationFormat.Duration_Milliseconds => Convert.ToInt32(timeSpan1.TotalMilliseconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan2 when format == SerializationFormat.Duration_Milliseconds_Float || format == SerializationFormat.Duration_Milliseconds_Double => timeSpan2.TotalMilliseconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan3 when formatSpecifier != null => ToString(timeSpan3, formatSpecifier), + TimeSpan timeSpan4 => XmlConvert.ToString(timeSpan4), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Utf8JsonRequestContent.cs index 1eaee5c2db28..8950e7dedc32 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Utf8JsonRequestContent.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.Quantum { - internal class Utf8JsonRequestContent : RequestContent + internal partial class Utf8JsonRequestContent : RequestContent { private readonly MemoryStream _stream; private readonly RequestContent _content; @@ -25,20 +25,26 @@ public Utf8JsonRequestContent() JsonWriter = new Utf8JsonWriter(_stream); } + /// Gets the JsonWriter. public Utf8JsonWriter JsonWriter { get; } + /// The stream containing the data to be written. + /// The cancellation token to use. public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) { await JsonWriter.FlushAsync().ConfigureAwait(false); await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); } + /// The stream containing the data to be written. + /// The cancellation token to use. public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) { JsonWriter.Flush(); _content.WriteTo(stream, cancellationToken); } + /// public override bool TryComputeLength(out long length) { length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperation.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperation.cs index 97b9a960064c..58957d40a776 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperation.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperation.cs @@ -6,18 +6,16 @@ #nullable disable using System; -using System.ClientModel.Primitives; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.Quantum { -#pragma warning disable SA1649 // File name should match first type name - internal class QuantumArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class QuantumArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected QuantumArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal QuantumArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response); @@ -36,12 +37,20 @@ internal QuantumArmOperation(Response response, RehydrationToken? rehydrationTok _operationId = GetOperationId(rehydrationToken); } + /// + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. internal QuantumArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) { - _nextLinkOperation = nextLinkOperationValue; + _nextLinkOperation = nextLinkOperationImplementation; _operationId = _nextLinkOperation.OperationId; } else @@ -49,48 +58,49 @@ internal QuantumArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline p _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "QuantumArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "QuantumArmOperation", + null, + new SequentialDelayStrategy()); } + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + /// The token to rehydrate a long-running operation. private string GetOperationId(RehydrationToken? rehydrationToken) { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerQuantumContext.Default); - using var document = JsonDocument.Parse(data); - var lroDetails = document.RootElement; - return lroDetails.GetProperty("id").GetString(); + return rehydrationToken?.Id; } - /// - public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - /// + /// public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// + /// public override Response GetRawResponse() => _operation.RawResponse; - /// + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - /// + /// public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - /// + /// public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); - /// + /// public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); - /// + /// public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); - /// + /// public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperationOfT.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperationOfT.cs index 8adc9c6d1569..68ef5c34fda1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperationOfT.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumArmOperationOfT.cs @@ -6,18 +6,16 @@ #nullable disable using System; -using System.ClientModel.Primitives; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.Quantum { -#pragma warning disable SA1649 // File name should match first type name - internal class QuantumArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class QuantumArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected QuantumArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal QuantumArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); @@ -36,12 +37,21 @@ internal QuantumArmOperation(Response response, RehydrationToken? rehydration _operationId = GetOperationId(rehydrationToken); } + /// + /// The instance of . + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. internal QuantumArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) { - _nextLinkOperation = nextLinkOperationValue; + _nextLinkOperation = nextLinkOperationImplementation; _operationId = _nextLinkOperation.OperationId; } else @@ -49,54 +59,55 @@ internal QuantumArmOperation(IOperationSource source, ClientDiagnostics clien _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "QuantumArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + NextLinkOperationImplementation.Create(source, nextLinkOperation), + clientDiagnostics, + response, + "QuantumArmOperation", + null, + new SequentialDelayStrategy()); } - private string GetOperationId(RehydrationToken? rehydrationToken) - { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerQuantumContext.Default); - using var document = JsonDocument.Parse(data); - var lroDetails = document.RootElement; - return lroDetails.GetProperty("id").GetString(); - } - /// + /// Gets the Id. public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - /// - public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - - /// + /// Gets the Value. public override T Value => _operation.Value; - /// + /// Gets the HasValue. public override bool HasValue => _operation.HasValue; - /// + /// Gets the HasCompleted. public override bool HasCompleted => _operation.HasCompleted; - /// + /// The token to rehydrate a long-running operation. + private string GetOperationId(RehydrationToken? rehydrationToken) + { + return rehydrationToken?.Id; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// public override Response GetRawResponse() => _operation.RawResponse; - /// + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - /// + /// public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - /// + /// public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); - /// + /// public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); - /// + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - /// + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumWorkspaceOperationSource.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumWorkspaceOperationSource.cs index 027acd5ae1e7..98ae7316eaa7 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumWorkspaceOperationSource.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/LongRunningOperation/QuantumWorkspaceOperationSource.cs @@ -5,32 +5,45 @@ #nullable disable -using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; namespace Azure.ResourceManager.Quantum { - internal class QuantumWorkspaceOperationSource : IOperationSource + /// + internal partial class QuantumWorkspaceOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal QuantumWorkspaceOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// QuantumWorkspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerQuantumContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + QuantumWorkspaceData data = QuantumWorkspaceData.DeserializeQuantumWorkspaceData(document.RootElement, ModelSerializationExtensions.WireOptions); return new QuantumWorkspaceResource(_client, data); } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerQuantumContext.Default); - return await Task.FromResult(new QuantumWorkspaceResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + QuantumWorkspaceData data = QuantumWorkspaceData.DeserializeQuantumWorkspaceData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new QuantumWorkspaceResource(_client, data); } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/AzureResourceManagerQuantumContext.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/AzureResourceManagerQuantumContext.cs index 441d971c6d9d..2934853b28a1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/AzureResourceManagerQuantumContext.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/AzureResourceManagerQuantumContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; using Azure.ResourceManager.Quantum.Models; @@ -13,9 +14,11 @@ namespace Azure.ResourceManager.Quantum { /// /// Context class which will be filled in by the System.ClientModel.SourceGeneration. - /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// For more information /// + [ModelReaderWriterBuildable(typeof(ManagedOnBehalfOfConfiguration))] [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] + [ModelReaderWriterBuildable(typeof(MoboBrokerInfo))] [ModelReaderWriterBuildable(typeof(OfferingsListResult))] [ModelReaderWriterBuildable(typeof(ProviderAadInfo))] [ModelReaderWriterBuildable(typeof(ProviderApplicationInfo))] @@ -24,18 +27,24 @@ namespace Azure.ResourceManager.Quantum [ModelReaderWriterBuildable(typeof(ProviderTargetDescription))] [ModelReaderWriterBuildable(typeof(QuantumPricingDetail))] [ModelReaderWriterBuildable(typeof(QuantumProvider))] - [ModelReaderWriterBuildable(typeof(QuantumProviderDescription))] - [ModelReaderWriterBuildable(typeof(QuantumProviderProperties))] + [ModelReaderWriterBuildable(typeof(QuantumProviderOffer))] + [ModelReaderWriterBuildable(typeof(QuantumProviderOfferProperties))] + [ModelReaderWriterBuildable(typeof(QuantumQuotaAllocations))] [ModelReaderWriterBuildable(typeof(QuantumQuotaDimension))] + [ModelReaderWriterBuildable(typeof(QuantumSuiteOffer))] + [ModelReaderWriterBuildable(typeof(QuantumSuiteOfferListResult))] + [ModelReaderWriterBuildable(typeof(QuantumSuiteOfferProperties))] [ModelReaderWriterBuildable(typeof(QuantumWorkspaceData))] + [ModelReaderWriterBuildable(typeof(QuantumWorkspaceListResult))] [ModelReaderWriterBuildable(typeof(QuantumWorkspacePatch))] + [ModelReaderWriterBuildable(typeof(QuantumWorkspaceProperties))] [ModelReaderWriterBuildable(typeof(QuantumWorkspaceResource))] [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SystemData))] + [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] [ModelReaderWriterBuildable(typeof(WorkspaceApiKey))] [ModelReaderWriterBuildable(typeof(WorkspaceApiKeys))] [ModelReaderWriterBuildable(typeof(WorkspaceKeyListResult))] - [ModelReaderWriterBuildable(typeof(WorkspaceListResult))] [ModelReaderWriterBuildable(typeof(WorkspaceNameAvailabilityContent))] [ModelReaderWriterBuildable(typeof(WorkspaceNameAvailabilityResult))] public partial class AzureResourceManagerQuantumContext : ModelReaderWriterContext diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ManagedOnBehalfOfConfiguration.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ManagedOnBehalfOfConfiguration.Serialization.cs new file mode 100644 index 000000000000..c9e295cc01d9 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ManagedOnBehalfOfConfiguration.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner. + internal partial class ManagedOnBehalfOfConfiguration : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnBehalfOfConfiguration)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MoboBrokerResources)) + { + writer.WritePropertyName("moboBrokerResources"u8); + writer.WriteStartArray(); + foreach (MoboBrokerInfo item in MoboBrokerResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + ManagedOnBehalfOfConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ManagedOnBehalfOfConfiguration JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnBehalfOfConfiguration)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnBehalfOfConfiguration(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ManagedOnBehalfOfConfiguration DeserializeManagedOnBehalfOfConfiguration(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList moboBrokerResources = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("moboBrokerResources"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(MoboBrokerInfo.DeserializeMoboBrokerInfo(item, options)); + } + moboBrokerResources = array; + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new ManagedOnBehalfOfConfiguration(moboBrokerResources ?? new ChangeTrackingList(), additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(ManagedOnBehalfOfConfiguration)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + ManagedOnBehalfOfConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ManagedOnBehalfOfConfiguration PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeManagedOnBehalfOfConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnBehalfOfConfiguration)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ManagedOnBehalfOfConfiguration.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ManagedOnBehalfOfConfiguration.cs new file mode 100644 index 000000000000..796ba8d34170 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ManagedOnBehalfOfConfiguration.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner. + internal partial class ManagedOnBehalfOfConfiguration + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal ManagedOnBehalfOfConfiguration() + { + MoboBrokerResources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Managed-On-Behalf-Of broker resources. + /// Keeps track of any properties unknown to the library. + internal ManagedOnBehalfOfConfiguration(IReadOnlyList moboBrokerResources, IDictionary additionalBinaryDataProperties) + { + MoboBrokerResources = moboBrokerResources; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Managed-On-Behalf-Of broker resources. + public IReadOnlyList MoboBrokerResources { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/MoboBrokerInfo.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/MoboBrokerInfo.Serialization.cs new file mode 100644 index 000000000000..0396f701d17b --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/MoboBrokerInfo.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user. + public partial class MoboBrokerInfo : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MoboBrokerInfo)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + MoboBrokerInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MoboBrokerInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MoboBrokerInfo)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMoboBrokerInfo(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MoboBrokerInfo DeserializeMoboBrokerInfo(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new MoboBrokerInfo(id, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(MoboBrokerInfo)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + MoboBrokerInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MoboBrokerInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeMoboBrokerInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MoboBrokerInfo)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/MoboBrokerInfo.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/MoboBrokerInfo.cs new file mode 100644 index 000000000000..588e96d19d5f --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/MoboBrokerInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user. + public partial class MoboBrokerInfo + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal MoboBrokerInfo() + { + } + + /// Initializes a new instance of . + /// Resource identifier of a Managed-On-Behalf-Of broker resource. + /// Keeps track of any properties unknown to the library. + internal MoboBrokerInfo(ResourceIdentifier id, IDictionary additionalBinaryDataProperties) + { + Id = id; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Resource identifier of a Managed-On-Behalf-Of broker resource. + public ResourceIdentifier Id { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.Serialization.cs index 31245ee16a47..785d57524eec 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - internal partial class OfferingsListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a list Providers operation. + internal partial class OfferingsListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OfferingsListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,36 +35,32 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(OfferingsListResult)} does not support writing '{format}' format."); } - - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (QuantumProviderOffer item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OfferingsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OfferingsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OfferingsListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(OfferingsListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOfferingsListResult(document.RootElement, options); } - internal static OfferingsListResult DeserializeOfferingsListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OfferingsListResult DeserializeOfferingsListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(QuantumProviderDescription.DeserializeQuantumProviderDescription(item, options)); + array.Add(QuantumProviderOffer.DeserializeQuantumProviderOffer(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new OfferingsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new OfferingsListResult(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - OfferingsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + OfferingsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OfferingsListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeOfferingsListResult(document.RootElement, options); } default: @@ -149,6 +163,14 @@ OfferingsListResult IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static OfferingsListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOfferingsListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.cs index e0a1f06ebe24..b01aa059fcc2 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/OfferingsListResult.cs @@ -7,64 +7,38 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Quantum.Models { /// The response of a list Providers operation. internal partial class OfferingsListResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal OfferingsListResult() + /// The ProviderDescription items on this page. + internal OfferingsListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// Result of a list Providers operation. - /// Link to the next set of results. Not empty if Value contains incomplete list of Providers. - /// Keeps track of any properties unknown to the library. - internal OfferingsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + /// The ProviderDescription items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal OfferingsListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Result of a list Providers operation. - public IReadOnlyList Value { get; } - /// Link to the next set of results. Not empty if Value contains incomplete list of Providers. - public string NextLink { get; } + /// The ProviderDescription items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.Serialization.cs index 7cd2a1e289db..5900b47ffeb6 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class ProviderAadInfo : IUtf8JsonSerializable, IJsonModel + /// Azure Active Directory info. + public partial class ProviderAadInfo : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderAadInfo)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ApplicationId)) { writer.WritePropertyName("applicationId"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("tenantId"u8); writer.WriteStringValue(TenantId.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,59 +61,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProviderAadInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ProviderAadInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ProviderAadInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderAadInfo)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeProviderAadInfo(document.RootElement, options); } - internal static ProviderAadInfo DeserializeProviderAadInfo(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ProviderAadInfo DeserializeProviderAadInfo(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string applicationId = default; Guid? tenantId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("applicationId"u8)) + if (prop.NameEquals("applicationId"u8)) { - applicationId = property.Value.GetString(); + applicationId = prop.Value.GetString(); continue; } - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - tenantId = property.Value.GetGuid(); + tenantId = new Guid(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ProviderAadInfo(applicationId, tenantId, serializedAdditionalRawData); + return new ProviderAadInfo(applicationId, tenantId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +129,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opt } } - ProviderAadInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ProviderAadInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ProviderAadInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeProviderAadInfo(document.RootElement, options); } default: @@ -139,6 +150,7 @@ ProviderAadInfo IPersistableModel.Create(BinaryData data, Model } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.cs index 99549112d32c..0918662d5f2a 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderAadInfo.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Azure Active Directory info. public partial class ProviderAadInfo { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ProviderAadInfo() @@ -53,16 +24,17 @@ internal ProviderAadInfo() /// Initializes a new instance of . /// Provider's application id. /// Provider's tenant id. - /// Keeps track of any properties unknown to the library. - internal ProviderAadInfo(string applicationId, Guid? tenantId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ProviderAadInfo(string applicationId, Guid? tenantId, IDictionary additionalBinaryDataProperties) { ApplicationId = applicationId; TenantId = tenantId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Provider's application id. public string ApplicationId { get; } + /// Provider's tenant id. public Guid? TenantId { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.Serialization.cs index 53c3be5e5148..907f0cdf48a4 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class ProviderApplicationInfo : IUtf8JsonSerializable, IJsonModel + /// Provider's Managed-Application info. + public partial class ProviderApplicationInfo : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderApplicationInfo)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(PublisherId)) { writer.WritePropertyName("publisherId"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("offerId"u8); writer.WriteStringValue(OfferId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProviderApplicationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ProviderApplicationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ProviderApplicationInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderApplicationInfo)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeProviderApplicationInfo(document.RootElement, options); } - internal static ProviderApplicationInfo DeserializeProviderApplicationInfo(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ProviderApplicationInfo DeserializeProviderApplicationInfo(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string publisherId = default; string offerId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("publisherId"u8)) + if (prop.NameEquals("publisherId"u8)) { - publisherId = property.Value.GetString(); + publisherId = prop.Value.GetString(); continue; } - if (property.NameEquals("offerId"u8)) + if (prop.NameEquals("offerId"u8)) { - offerId = property.Value.GetString(); + offerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ProviderApplicationInfo(publisherId, offerId, serializedAdditionalRawData); + return new ProviderApplicationInfo(publisherId, offerId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +125,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - ProviderApplicationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ProviderApplicationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ProviderApplicationInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeProviderApplicationInfo(document.RootElement, options); } default: @@ -135,6 +146,7 @@ ProviderApplicationInfo IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.cs index 1b584df4e525..7e8ea352ea9c 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderApplicationInfo.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Provider's Managed-Application info. public partial class ProviderApplicationInfo { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ProviderApplicationInfo() @@ -53,16 +24,17 @@ internal ProviderApplicationInfo() /// Initializes a new instance of . /// Provider's publisher id. /// Provider's offer id. - /// Keeps track of any properties unknown to the library. - internal ProviderApplicationInfo(string publisherId, string offerId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ProviderApplicationInfo(string publisherId, string offerId, IDictionary additionalBinaryDataProperties) { PublisherId = publisherId; OfferId = offerId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Provider's publisher id. public string PublisherId { get; } + /// Provider's offer id. public string OfferId { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.Serialization.cs index 07262d7853be..8c43dd279d9b 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class ProviderPricingDimension : IUtf8JsonSerializable, IJsonModel + /// Information about pricing dimension. + public partial class ProviderPricingDimension : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderPricingDimension)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProviderPricingDimension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ProviderPricingDimension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ProviderPricingDimension JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderPricingDimension)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeProviderPricingDimension(document.RootElement, options); } - internal static ProviderPricingDimension DeserializeProviderPricingDimension(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ProviderPricingDimension DeserializeProviderPricingDimension(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; string name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ProviderPricingDimension(id, name, serializedAdditionalRawData); + return new ProviderPricingDimension(id, name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +125,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - ProviderPricingDimension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ProviderPricingDimension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ProviderPricingDimension PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeProviderPricingDimension(document.RootElement, options); } default: @@ -135,6 +146,7 @@ ProviderPricingDimension IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.cs index 2c6402eabe49..4e091fd30709 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderPricingDimension.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Information about pricing dimension. public partial class ProviderPricingDimension { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ProviderPricingDimension() @@ -53,16 +24,17 @@ internal ProviderPricingDimension() /// Initializes a new instance of . /// Unique id of this pricing dimension. /// The display name of this pricing dimension. - /// Keeps track of any properties unknown to the library. - internal ProviderPricingDimension(string id, string name, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ProviderPricingDimension(string id, string name, IDictionary additionalBinaryDataProperties) { Id = id; Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique id of this pricing dimension. public string Id { get; } + /// The display name of this pricing dimension. public string Name { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderProvisioningStatus.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderProvisioningStatus.cs index d02eacb389e1..ab19eabb2fdf 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderProvisioningStatus.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderProvisioningStatus.cs @@ -7,57 +7,90 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - /// Provisioning status field. + /// The Workspace provisioning status. public readonly partial struct ProviderProvisioningStatus : IEquatable { private readonly string _value; + /// The Workspace provisioning is succeeded. + private const string SucceededValue = "Succeeded"; + /// The Workspace provisioning failed. + private const string FailedValue = "Failed"; + /// Resource creation was canceled. + private const string CanceledValue = "Canceled"; + /// The Workspace is currently starting to provision a provider. + private const string ProviderLaunchingValue = "ProviderLaunching"; + /// The Workspace is currently updating a provider. + private const string ProviderUpdatingValue = "ProviderUpdating"; + /// The Workspace is currently deleting a provider. + private const string ProviderDeletingValue = "ProviderDeleting"; + /// The Workspace is currently provisioning a provider. + private const string ProviderProvisioningValue = "ProviderProvisioning"; /// Initializes a new instance of . + /// The value. /// is null. public ProviderProvisioningStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string LaunchingValue = "Launching"; - private const string UpdatingValue = "Updating"; - private const string DeletingValue = "Deleting"; - private const string DeletedValue = "Deleted"; - private const string FailedValue = "Failed"; + _value = value; + } - /// Succeeded. + /// The Workspace provisioning is succeeded. public static ProviderProvisioningStatus Succeeded { get; } = new ProviderProvisioningStatus(SucceededValue); - /// Launching. - public static ProviderProvisioningStatus Launching { get; } = new ProviderProvisioningStatus(LaunchingValue); - /// Updating. - public static ProviderProvisioningStatus Updating { get; } = new ProviderProvisioningStatus(UpdatingValue); - /// Deleting. - public static ProviderProvisioningStatus Deleting { get; } = new ProviderProvisioningStatus(DeletingValue); - /// Deleted. - public static ProviderProvisioningStatus Deleted { get; } = new ProviderProvisioningStatus(DeletedValue); - /// Failed. + + /// The Workspace provisioning failed. public static ProviderProvisioningStatus Failed { get; } = new ProviderProvisioningStatus(FailedValue); + + /// Resource creation was canceled. + public static ProviderProvisioningStatus Canceled { get; } = new ProviderProvisioningStatus(CanceledValue); + + /// The Workspace is currently starting to provision a provider. + public static ProviderProvisioningStatus ProviderLaunching { get; } = new ProviderProvisioningStatus(ProviderLaunchingValue); + + /// The Workspace is currently updating a provider. + public static ProviderProvisioningStatus ProviderUpdating { get; } = new ProviderProvisioningStatus(ProviderUpdatingValue); + + /// The Workspace is currently deleting a provider. + public static ProviderProvisioningStatus ProviderDeleting { get; } = new ProviderProvisioningStatus(ProviderDeletingValue); + + /// The Workspace is currently provisioning a provider. + public static ProviderProvisioningStatus ProviderProvisioning { get; } = new ProviderProvisioningStatus(ProviderProvisioningValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ProviderProvisioningStatus left, ProviderProvisioningStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(ProviderProvisioningStatus left, ProviderProvisioningStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ProviderProvisioningStatus(string value) => new ProviderProvisioningStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ProviderProvisioningStatus?(string value) => value == null ? null : new ProviderProvisioningStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ProviderProvisioningStatus other && Equals(other); - /// + + /// public bool Equals(ProviderProvisioningStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.Serialization.cs index 374e2d7529b0..c90360f3c2a1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class ProviderSkuDescription : IUtf8JsonSerializable, IJsonModel + /// Information about a specific sku. + public partial class ProviderSkuDescription : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderSkuDescription)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -68,8 +68,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("targets"u8); writer.WriteStartArray(); - foreach (var item in Targets) + foreach (string item in Targets) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -78,7 +83,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("quotaDimensions"u8); writer.WriteStartArray(); - foreach (var item in QuotaDimensions) + foreach (QuantumQuotaDimension item in QuotaDimensions) { writer.WriteObjectValue(item, options); } @@ -88,21 +93,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("pricingDetails"u8); writer.WriteStartArray(); - foreach (var item in PricingDetails) + foreach (QuantumPricingDetail item in PricingDetails) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -111,22 +116,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProviderSkuDescription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ProviderSkuDescription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ProviderSkuDescription JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderSkuDescription)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeProviderSkuDescription(document.RootElement, options); } - internal static ProviderSkuDescription DeserializeProviderSkuDescription(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ProviderSkuDescription DeserializeProviderSkuDescription(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -137,87 +147,93 @@ internal static ProviderSkuDescription DeserializeProviderSkuDescription(JsonEle string description = default; Uri restrictedAccessUri = default; bool? autoAdd = default; - IReadOnlyList targets = default; - IReadOnlyList quotaDimensions = default; - IReadOnlyList pricingDetails = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList targets = default; + IList quotaDimensions = default; + IList pricingDetails = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("restrictedAccessUri"u8)) + if (prop.NameEquals("restrictedAccessUri"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - restrictedAccessUri = new Uri(property.Value.GetString()); + restrictedAccessUri = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("autoAdd"u8)) + if (prop.NameEquals("autoAdd"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - autoAdd = property.Value.GetBoolean(); + autoAdd = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("targets"u8)) + if (prop.NameEquals("targets"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } targets = array; continue; } - if (property.NameEquals("quotaDimensions"u8)) + if (prop.NameEquals("quotaDimensions"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(QuantumQuotaDimension.DeserializeQuantumQuotaDimension(item, options)); } quotaDimensions = array; continue; } - if (property.NameEquals("pricingDetails"u8)) + if (prop.NameEquals("pricingDetails"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(QuantumPricingDetail.DeserializeQuantumPricingDetail(item, options)); } @@ -226,10 +242,9 @@ internal static ProviderSkuDescription DeserializeProviderSkuDescription(JsonEle } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ProviderSkuDescription( id, name, @@ -240,13 +255,16 @@ internal static ProviderSkuDescription DeserializeProviderSkuDescription(JsonEle targets ?? new ChangeTrackingList(), quotaDimensions ?? new ChangeTrackingList(), pricingDetails ?? new ChangeTrackingList(), - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -256,15 +274,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - ProviderSkuDescription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ProviderSkuDescription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ProviderSkuDescription PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeProviderSkuDescription(document.RootElement, options); } default: @@ -272,6 +295,7 @@ ProviderSkuDescription IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.cs index c4aab9375643..7041f3765074 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderSkuDescription.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { /// Information about a specific sku. public partial class ProviderSkuDescription { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ProviderSkuDescription() @@ -63,8 +35,8 @@ internal ProviderSkuDescription() /// The list of targets available for this sku. /// The list of quota dimensions for this sku. /// The list of pricing details for the sku. - /// Keeps track of any properties unknown to the library. - internal ProviderSkuDescription(string id, string name, string version, string description, Uri restrictedAccessUri, bool? autoAdd, IReadOnlyList targets, IReadOnlyList quotaDimensions, IReadOnlyList pricingDetails, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ProviderSkuDescription(string id, string name, string version, string description, Uri restrictedAccessUri, bool? autoAdd, IList targets, IList quotaDimensions, IList pricingDetails, IDictionary additionalBinaryDataProperties) { Id = id; Name = name; @@ -75,26 +47,34 @@ internal ProviderSkuDescription(string id, string name, string version, string d Targets = targets; QuotaDimensions = quotaDimensions; PricingDetails = pricingDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique sku id. public string Id { get; } + /// Display name of this sku. public string Name { get; } + /// Display name of this sku. public string Version { get; } + /// Description about this sku. public string Description { get; } + /// Uri to subscribe to the restricted access sku. public Uri RestrictedAccessUri { get; } + /// Flag to indicate whether the sku should be automatically added during workspace creation. public bool? AutoAdd { get; } + /// The list of targets available for this sku. - public IReadOnlyList Targets { get; } + public IList Targets { get; } + /// The list of quota dimensions for this sku. - public IReadOnlyList QuotaDimensions { get; } + public IList QuotaDimensions { get; } + /// The list of pricing details for the sku. - public IReadOnlyList PricingDetails { get; } + public IList PricingDetails { get; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.Serialization.cs index 2b2480e7d40d..524811f8836e 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class ProviderTargetDescription : IUtf8JsonSerializable, IJsonModel + /// Information about a Target. A target is the component that can process a specific type of Job. + public partial class ProviderTargetDescription : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderTargetDescription)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -53,8 +53,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("acceptedDataFormats"u8); writer.WriteStartArray(); - foreach (var item in AcceptedDataFormats) + foreach (string item in AcceptedDataFormats) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -63,21 +68,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("acceptedContentEncodings"u8); writer.WriteStartArray(); - foreach (var item in AcceptedContentEncodings) + foreach (string item in AcceptedContentEncodings) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && Optional.IsDefined(NumQubits)) + { + writer.WritePropertyName("numQubits"u8); + writer.WriteNumberValue(NumQubits.Value); + } + if (options.Format != "W" && Optional.IsDefined(TargetProfile)) + { + writer.WritePropertyName("targetProfile"u8); + writer.WriteStringValue(TargetProfile); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +129,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProviderTargetDescription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ProviderTargetDescription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ProviderTargetDescription JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ProviderTargetDescription)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeProviderTargetDescription(document.RootElement, options); } - internal static ProviderTargetDescription DeserializeProviderTargetDescription(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ProviderTargetDescription DeserializeProviderTargetDescription(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -109,74 +157,130 @@ internal static ProviderTargetDescription DeserializeProviderTargetDescription(J string id = default; string name = default; string description = default; - IReadOnlyList acceptedDataFormats = default; - IReadOnlyList acceptedContentEncodings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList acceptedDataFormats = default; + IList acceptedContentEncodings = default; + int? numQubits = default; + string targetProfile = default; + IReadOnlyDictionary metadata = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("acceptedDataFormats"u8)) + if (prop.NameEquals("acceptedDataFormats"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } acceptedDataFormats = array; continue; } - if (property.NameEquals("acceptedContentEncodings"u8)) + if (prop.NameEquals("acceptedContentEncodings"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } acceptedContentEncodings = array; continue; } + if (prop.NameEquals("numQubits"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numQubits = prop.Value.GetInt32(); + continue; + } + if (prop.NameEquals("targetProfile"u8)) + { + targetProfile = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("metadata"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, BinaryData.FromString(prop0.Value.GetRawText())); + } + } + metadata = dictionary; + continue; + } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ProviderTargetDescription( id, name, description, acceptedDataFormats ?? new ChangeTrackingList(), acceptedContentEncodings ?? new ChangeTrackingList(), - serializedAdditionalRawData); + numQubits, + targetProfile, + metadata ?? new ChangeTrackingDictionary(), + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -186,15 +290,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - ProviderTargetDescription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ProviderTargetDescription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ProviderTargetDescription PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeProviderTargetDescription(document.RootElement, options); } default: @@ -202,6 +311,7 @@ ProviderTargetDescription IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.cs index ba5eda20a42d..c4ff05a4376e 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/ProviderTargetDescription.cs @@ -7,49 +7,23 @@ using System; using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { /// Information about a Target. A target is the component that can process a specific type of Job. public partial class ProviderTargetDescription { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ProviderTargetDescription() { AcceptedDataFormats = new ChangeTrackingList(); AcceptedContentEncodings = new ChangeTrackingList(); + Metadata = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -58,26 +32,70 @@ internal ProviderTargetDescription() /// A description about this target. /// List of data formats accepted by this target. /// List of content encodings accepted by this target. - /// Keeps track of any properties unknown to the library. - internal ProviderTargetDescription(string id, string name, string description, IReadOnlyList acceptedDataFormats, IReadOnlyList acceptedContentEncodings, IDictionary serializedAdditionalRawData) + /// The qubit number. + /// Target QIR profile. + /// The metadata of this target. + /// Keeps track of any properties unknown to the library. + internal ProviderTargetDescription(string id, string name, string description, IList acceptedDataFormats, IList acceptedContentEncodings, int? numQubits, string targetProfile, IReadOnlyDictionary metadata, IDictionary additionalBinaryDataProperties) { Id = id; Name = name; Description = description; AcceptedDataFormats = acceptedDataFormats; AcceptedContentEncodings = acceptedContentEncodings; - _serializedAdditionalRawData = serializedAdditionalRawData; + NumQubits = numQubits; + TargetProfile = targetProfile; + Metadata = metadata; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique target id. public string Id { get; } + /// Display name of this target. public string Name { get; } + /// A description about this target. public string Description { get; } + /// List of data formats accepted by this target. - public IReadOnlyList AcceptedDataFormats { get; } + public IList AcceptedDataFormats { get; } + /// List of content encodings accepted by this target. - public IReadOnlyList AcceptedContentEncodings { get; } + public IList AcceptedContentEncodings { get; } + + /// The qubit number. + public int? NumQubits { get; } + + /// Target QIR profile. + public string TargetProfile { get; } + + /// + /// The metadata of this target. + /// To assign an object to the value of this property use . + /// To assign an already formatted json string to this property use . + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo"). + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\""). + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }). + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}"). + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.Serialization.cs index 957daab66513..de38468ebfbf 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class QuantumPricingDetail : IUtf8JsonSerializable, IJsonModel + /// Detailed pricing information for an sku. + public partial class QuantumPricingDetail : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumPricingDetail)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("value"u8); writer.WriteStringValue(Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - QuantumPricingDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + QuantumPricingDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumPricingDetail JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumPricingDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeQuantumPricingDetail(document.RootElement, options); } - internal static QuantumPricingDetail DeserializeQuantumPricingDetail(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumPricingDetail DeserializeQuantumPricingDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; string value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - value = property.Value.GetString(); + value = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new QuantumPricingDetail(id, value, serializedAdditionalRawData); + return new QuantumPricingDetail(id, value, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +125,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - QuantumPricingDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + QuantumPricingDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumPricingDetail PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeQuantumPricingDetail(document.RootElement, options); } default: @@ -135,6 +146,7 @@ QuantumPricingDetail IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.cs index a500905832a5..f70221fc62cd 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumPricingDetail.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Detailed pricing information for an sku. public partial class QuantumPricingDetail { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal QuantumPricingDetail() @@ -53,16 +24,17 @@ internal QuantumPricingDetail() /// Initializes a new instance of . /// Unique id for this pricing information. /// The unit cost of this sku. - /// Keeps track of any properties unknown to the library. - internal QuantumPricingDetail(string id, string value, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal QuantumPricingDetail(string id, string value, IDictionary additionalBinaryDataProperties) { Id = id; Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique id for this pricing information. public string Id { get; } + /// The unit cost of this sku. public string Value { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.Serialization.cs index f6a7a6d029fd..dd2ed577412f 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class QuantumProvider : IUtf8JsonSerializable, IJsonModel + /// Information about a Provider. A Provider is an entity that offers Targets to run Azure Quantum Jobs. + public partial class QuantumProvider : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumProvider)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ProviderId)) { writer.WritePropertyName("providerId"u8); @@ -64,15 +64,20 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourceUsageId"u8); writer.WriteStringValue(ResourceUsageId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (Optional.IsDefined(Quotas)) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("quotas"u8); + writer.WriteObjectValue(Quotas, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -81,22 +86,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - QuantumProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + QuantumProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumProvider JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumProvider)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeQuantumProvider(document.RootElement, options); } - internal static QuantumProvider DeserializeQuantumProvider(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumProvider DeserializeQuantumProvider(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -105,56 +115,64 @@ internal static QuantumProvider DeserializeQuantumProvider(JsonElement element, string providerSku = default; Uri instanceUri = default; string applicationName = default; - ProviderProvisioningStatus? provisioningState = default; + QuantumProvisioningStatus? provisioningState = default; string resourceUsageId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + QuantumQuotaAllocations quotas = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("providerId"u8)) + if (prop.NameEquals("providerId"u8)) { - providerId = property.Value.GetString(); + providerId = prop.Value.GetString(); continue; } - if (property.NameEquals("providerSku"u8)) + if (prop.NameEquals("providerSku"u8)) { - providerSku = property.Value.GetString(); + providerSku = prop.Value.GetString(); continue; } - if (property.NameEquals("instanceUri"u8)) + if (prop.NameEquals("instanceUri"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - instanceUri = new Uri(property.Value.GetString()); + instanceUri = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("applicationName"u8)) + if (prop.NameEquals("applicationName"u8)) { - applicationName = property.Value.GetString(); + applicationName = prop.Value.GetString(); continue; } - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new ProviderProvisioningStatus(property.Value.GetString()); + provisioningState = new QuantumProvisioningStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("resourceUsageId"u8)) + if (prop.NameEquals("resourceUsageId"u8)) { - resourceUsageId = property.Value.GetString(); + resourceUsageId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("quotas"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quotas = QuantumQuotaAllocations.DeserializeQuantumQuotaAllocations(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new QuantumProvider( providerId, providerSku, @@ -162,13 +180,17 @@ internal static QuantumProvider DeserializeQuantumProvider(JsonElement element, applicationName, provisioningState, resourceUsageId, - serializedAdditionalRawData); + quotas, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -178,15 +200,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opt } } - QuantumProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + QuantumProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumProvider PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeQuantumProvider(document.RootElement, options); } default: @@ -194,6 +221,7 @@ QuantumProvider IPersistableModel.Create(BinaryData data, Model } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.cs index 6fc9f25deff6..673bf3b4fa2c 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvider.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Information about a Provider. A Provider is an entity that offers Targets to run Azure Quantum Jobs. public partial class QuantumProvider { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public QuantumProvider() @@ -57,8 +28,9 @@ public QuantumProvider() /// The provider's marketplace application display name. /// Provisioning status field. /// Id to track resource usage for the provider. - /// Keeps track of any properties unknown to the library. - internal QuantumProvider(string providerId, string providerSku, Uri instanceUri, string applicationName, ProviderProvisioningStatus? provisioningState, string resourceUsageId, IDictionary serializedAdditionalRawData) + /// Quota allocations associated with this provider. Available only for special providers. + /// Keeps track of any properties unknown to the library. + internal QuantumProvider(string providerId, string providerSku, Uri instanceUri, string applicationName, QuantumProvisioningStatus? provisioningState, string resourceUsageId, QuantumQuotaAllocations quotas, IDictionary additionalBinaryDataProperties) { ProviderId = providerId; ProviderSku = providerSku; @@ -66,20 +38,29 @@ internal QuantumProvider(string providerId, string providerSku, Uri instanceUri, ApplicationName = applicationName; ProvisioningState = provisioningState; ResourceUsageId = resourceUsageId; - _serializedAdditionalRawData = serializedAdditionalRawData; + Quotas = quotas; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique id of this provider. public string ProviderId { get; set; } + /// The sku associated with pricing information for this provider. public string ProviderSku { get; set; } + /// A Uri identifying the specific instance of this provider. public Uri InstanceUri { get; set; } + /// The provider's marketplace application display name. public string ApplicationName { get; set; } + /// Provisioning status field. - public ProviderProvisioningStatus? ProvisioningState { get; set; } + public QuantumProvisioningStatus? ProvisioningState { get; set; } + /// Id to track resource usage for the provider. public string ResourceUsageId { get; set; } + + /// Quota allocations associated with this provider. Available only for special providers. + public QuantumQuotaAllocations Quotas { get; set; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderDescription.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderDescription.Serialization.cs deleted file mode 100644 index ac3d11918d48..000000000000 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderDescription.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Quantum.Models -{ - public partial class QuantumProviderDescription : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(QuantumProviderDescription)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - QuantumProviderDescription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(QuantumProviderDescription)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeQuantumProviderDescription(document.RootElement, options); - } - - internal static QuantumProviderDescription DeserializeQuantumProviderDescription(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - string name = default; - QuantumProviderProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = QuantumProviderProperties.DeserializeQuantumProviderProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new QuantumProviderDescription(id, name, properties, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); - default: - throw new FormatException($"The model {nameof(QuantumProviderDescription)} does not support writing '{options.Format}' format."); - } - } - - QuantumProviderDescription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeQuantumProviderDescription(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(QuantumProviderDescription)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderDescription.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderDescription.cs deleted file mode 100644 index 5f3297a0275e..000000000000 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderDescription.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.Quantum.Models -{ - /// Information about an offering. A provider offering is an entity that offers Targets to run Azure Quantum Jobs. - public partial class QuantumProviderDescription - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal QuantumProviderDescription() - { - } - - /// Initializes a new instance of . - /// Unique provider's id. - /// Provider's display name. - /// Provider properties. - /// Keeps track of any properties unknown to the library. - internal QuantumProviderDescription(string id, string name, QuantumProviderProperties properties, IDictionary serializedAdditionalRawData) - { - Id = id; - Name = name; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Unique provider's id. - public string Id { get; } - /// Provider's display name. - public string Name { get; } - /// Provider properties. - public QuantumProviderProperties Properties { get; } - } -} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOffer.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOffer.Serialization.cs new file mode 100644 index 000000000000..09e7a475c098 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOffer.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Information about an offering. A provider offering is an entity that offers Targets to run Azure Quantum Jobs. + public partial class QuantumProviderOffer : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumProviderOffer)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumProviderOffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumProviderOffer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumProviderOffer)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumProviderOffer(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumProviderOffer DeserializeQuantumProviderOffer(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + QuantumProviderOfferProperties properties = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + id = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = QuantumProviderOfferProperties.DeserializeQuantumProviderOfferProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumProviderOffer(id, name, properties, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumProviderOffer)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumProviderOffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumProviderOffer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumProviderOffer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumProviderOffer)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOffer.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOffer.cs new file mode 100644 index 000000000000..7b88a52c86e6 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOffer.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Information about an offering. A provider offering is an entity that offers Targets to run Azure Quantum Jobs. + public partial class QuantumProviderOffer + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal QuantumProviderOffer() + { + } + + /// Initializes a new instance of . + /// Unique provider's id. + /// Provider's display name. + /// Provider properties. + /// Keeps track of any properties unknown to the library. + internal QuantumProviderOffer(string id, string name, QuantumProviderOfferProperties properties, IDictionary additionalBinaryDataProperties) + { + Id = id; + Name = name; + Properties = properties; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Unique provider's id. + public string Id { get; } + + /// Provider's display name. + public string Name { get; } + + /// Provider properties. + public QuantumProviderOfferProperties Properties { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderProperties.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOfferProperties.Serialization.cs similarity index 54% rename from sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderProperties.Serialization.cs rename to sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOfferProperties.Serialization.cs index 41e0060e1ea3..f837108e6ad6 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderProperties.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOfferProperties.Serialization.cs @@ -9,15 +9,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class QuantumProviderProperties : IUtf8JsonSerializable, IJsonModel + /// Provider properties. + public partial class QuantumProviderOfferProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(QuantumProviderProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(QuantumProviderOfferProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); @@ -68,7 +68,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("targets"u8); writer.WriteStartArray(); - foreach (var item in Targets) + foreach (ProviderTargetDescription item in Targets) { writer.WriteObjectValue(item, options); } @@ -78,7 +78,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("skus"u8); writer.WriteStartArray(); - foreach (var item in Skus) + foreach (ProviderSkuDescription item in Skus) { writer.WriteObjectValue(item, options); } @@ -88,7 +88,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("quotaDimensions"u8); writer.WriteStartArray(); - foreach (var item in QuotaDimensions) + foreach (QuantumQuotaDimension item in QuotaDimensions) { writer.WriteObjectValue(item, options); } @@ -98,21 +98,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("pricingDimensions"u8); writer.WriteStartArray(); - foreach (var item in PricingDimensions) + foreach (ProviderPricingDimension item in PricingDimensions) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -121,22 +121,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - QuantumProviderProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + QuantumProviderOfferProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumProviderOfferProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(QuantumProviderProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(QuantumProviderOfferProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeQuantumProviderProperties(document.RootElement, options); + return DeserializeQuantumProviderOfferProperties(document.RootElement, options); } - internal static QuantumProviderProperties DeserializeQuantumProviderProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumProviderOfferProperties DeserializeQuantumProviderOfferProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -147,102 +152,101 @@ internal static QuantumProviderProperties DeserializeQuantumProviderProperties(J string defaultEndpoint = default; ProviderAadInfo aad = default; ProviderApplicationInfo managedApplication = default; - IReadOnlyList targets = default; - IReadOnlyList skus = default; - IReadOnlyList quotaDimensions = default; - IReadOnlyList pricingDimensions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList targets = default; + IList skus = default; + IList quotaDimensions = default; + IList pricingDimensions = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("providerType"u8)) + if (prop.NameEquals("providerType"u8)) { - providerType = property.Value.GetString(); + providerType = prop.Value.GetString(); continue; } - if (property.NameEquals("company"u8)) + if (prop.NameEquals("company"u8)) { - company = property.Value.GetString(); + company = prop.Value.GetString(); continue; } - if (property.NameEquals("defaultEndpoint"u8)) + if (prop.NameEquals("defaultEndpoint"u8)) { - defaultEndpoint = property.Value.GetString(); + defaultEndpoint = prop.Value.GetString(); continue; } - if (property.NameEquals("aad"u8)) + if (prop.NameEquals("aad"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - aad = ProviderAadInfo.DeserializeProviderAadInfo(property.Value, options); + aad = ProviderAadInfo.DeserializeProviderAadInfo(prop.Value, options); continue; } - if (property.NameEquals("managedApplication"u8)) + if (prop.NameEquals("managedApplication"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - managedApplication = ProviderApplicationInfo.DeserializeProviderApplicationInfo(property.Value, options); + managedApplication = ProviderApplicationInfo.DeserializeProviderApplicationInfo(prop.Value, options); continue; } - if (property.NameEquals("targets"u8)) + if (prop.NameEquals("targets"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ProviderTargetDescription.DeserializeProviderTargetDescription(item, options)); } targets = array; continue; } - if (property.NameEquals("skus"u8)) + if (prop.NameEquals("skus"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ProviderSkuDescription.DeserializeProviderSkuDescription(item, options)); } skus = array; continue; } - if (property.NameEquals("quotaDimensions"u8)) + if (prop.NameEquals("quotaDimensions"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(QuantumQuotaDimension.DeserializeQuantumQuotaDimension(item, options)); } quotaDimensions = array; continue; } - if (property.NameEquals("pricingDimensions"u8)) + if (prop.NameEquals("pricingDimensions"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ProviderPricingDimension.DeserializeProviderPricingDimension(item, options)); } @@ -251,11 +255,10 @@ internal static QuantumProviderProperties DeserializeQuantumProviderProperties(J } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new QuantumProviderProperties( + return new QuantumProviderOfferProperties( description, providerType, company, @@ -266,38 +269,47 @@ internal static QuantumProviderProperties DeserializeQuantumProviderProperties(J skus ?? new ChangeTrackingList(), quotaDimensions ?? new ChangeTrackingList(), pricingDimensions ?? new ChangeTrackingList(), - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); default: - throw new FormatException($"The model {nameof(QuantumProviderProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(QuantumProviderOfferProperties)} does not support writing '{options.Format}' format."); } } - QuantumProviderProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + QuantumProviderOfferProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumProviderOfferProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeQuantumProviderProperties(document.RootElement, options); + return DeserializeQuantumProviderOfferProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(QuantumProviderProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(QuantumProviderOfferProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderProperties.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOfferProperties.cs similarity index 54% rename from sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderProperties.cs rename to sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOfferProperties.cs index 93cbb7f13a0d..64f4238ae2e5 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderProperties.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProviderOfferProperties.cs @@ -7,46 +7,18 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { /// Provider properties. - public partial class QuantumProviderProperties + public partial class QuantumProviderOfferProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal QuantumProviderProperties() + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal QuantumProviderOfferProperties() { Targets = new ChangeTrackingList(); Skus = new ChangeTrackingList(); @@ -54,7 +26,7 @@ internal QuantumProviderProperties() PricingDimensions = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// A description about this provider. /// Provider type. /// Company name. @@ -65,8 +37,8 @@ internal QuantumProviderProperties() /// The list of skus available from this provider. /// The list of quota dimensions from the provider. /// The list of pricing dimensions from the provider. - /// Keeps track of any properties unknown to the library. - internal QuantumProviderProperties(string description, string providerType, string company, string defaultEndpoint, ProviderAadInfo aad, ProviderApplicationInfo managedApplication, IReadOnlyList targets, IReadOnlyList skus, IReadOnlyList quotaDimensions, IReadOnlyList pricingDimensions, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal QuantumProviderOfferProperties(string description, string providerType, string company, string defaultEndpoint, ProviderAadInfo aad, ProviderApplicationInfo managedApplication, IList targets, IList skus, IList quotaDimensions, IList pricingDimensions, IDictionary additionalBinaryDataProperties) { Description = description; ProviderType = providerType; @@ -78,28 +50,37 @@ internal QuantumProviderProperties(string description, string providerType, stri Skus = skus; QuotaDimensions = quotaDimensions; PricingDimensions = pricingDimensions; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// A description about this provider. public string Description { get; } + /// Provider type. public string ProviderType { get; } + /// Company name. public string Company { get; } + /// Provider's default endpoint. public string DefaultEndpoint { get; } + /// Azure Active Directory info. public ProviderAadInfo Aad { get; } + /// Provider's Managed-Application info. public ProviderApplicationInfo ManagedApplication { get; } + /// The list of targets available from this provider. - public IReadOnlyList Targets { get; } + public IList Targets { get; } + /// The list of skus available from this provider. - public IReadOnlyList Skus { get; } + public IList Skus { get; } + /// The list of quota dimensions from the provider. - public IReadOnlyList QuotaDimensions { get; } + public IList QuotaDimensions { get; } + /// The list of pricing dimensions from the provider. - public IReadOnlyList PricingDimensions { get; } + public IList PricingDimensions { get; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvisioningStatus.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvisioningStatus.cs index cfdb176c3fdb..58d87645c965 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvisioningStatus.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumProvisioningStatus.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { @@ -14,50 +15,77 @@ namespace Azure.ResourceManager.Quantum.Models public readonly partial struct QuantumProvisioningStatus : IEquatable { private readonly string _value; + /// The provider is successfully provisioned. + private const string SucceededValue = "Succeeded"; + /// The provider is starting provisioning. + private const string LaunchingValue = "Launching"; + /// The provider is updating. + private const string UpdatingValue = "Updating"; + /// The provider is deleting. + private const string DeletingValue = "Deleting"; + /// The provider is deleted. + private const string DeletedValue = "Deleted"; + /// The provider is failed. + private const string FailedValue = "Failed"; /// Initializes a new instance of . + /// The value. /// is null. public QuantumProvisioningStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string ProviderLaunchingValue = "ProviderLaunching"; - private const string ProviderUpdatingValue = "ProviderUpdating"; - private const string ProviderDeletingValue = "ProviderDeleting"; - private const string ProviderProvisioningValue = "ProviderProvisioning"; - private const string FailedValue = "Failed"; + _value = value; + } - /// Succeeded. + /// The provider is successfully provisioned. public static QuantumProvisioningStatus Succeeded { get; } = new QuantumProvisioningStatus(SucceededValue); - /// ProviderLaunching. - public static QuantumProvisioningStatus ProviderLaunching { get; } = new QuantumProvisioningStatus(ProviderLaunchingValue); - /// ProviderUpdating. - public static QuantumProvisioningStatus ProviderUpdating { get; } = new QuantumProvisioningStatus(ProviderUpdatingValue); - /// ProviderDeleting. - public static QuantumProvisioningStatus ProviderDeleting { get; } = new QuantumProvisioningStatus(ProviderDeletingValue); - /// ProviderProvisioning. - public static QuantumProvisioningStatus ProviderProvisioning { get; } = new QuantumProvisioningStatus(ProviderProvisioningValue); - /// Failed. + + /// The provider is starting provisioning. + public static QuantumProvisioningStatus Launching { get; } = new QuantumProvisioningStatus(LaunchingValue); + + /// The provider is updating. + public static QuantumProvisioningStatus Updating { get; } = new QuantumProvisioningStatus(UpdatingValue); + + /// The provider is deleting. + public static QuantumProvisioningStatus Deleting { get; } = new QuantumProvisioningStatus(DeletingValue); + + /// The provider is deleted. + public static QuantumProvisioningStatus Deleted { get; } = new QuantumProvisioningStatus(DeletedValue); + + /// The provider is failed. public static QuantumProvisioningStatus Failed { get; } = new QuantumProvisioningStatus(FailedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(QuantumProvisioningStatus left, QuantumProvisioningStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(QuantumProvisioningStatus left, QuantumProvisioningStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator QuantumProvisioningStatus(string value) => new QuantumProvisioningStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator QuantumProvisioningStatus?(string value) => value == null ? null : new QuantumProvisioningStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is QuantumProvisioningStatus other && Equals(other); - /// + + /// public bool Equals(QuantumProvisioningStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaAllocations.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaAllocations.Serialization.cs new file mode 100644 index 000000000000..e36d23d9d3b5 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaAllocations.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Quota allocations with each field representing different quota type. + public partial class QuantumQuotaAllocations : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal QuantumQuotaAllocations() + { + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumQuotaAllocations)} does not support writing '{format}' format."); + } + writer.WritePropertyName("standardMinutesLifetime"u8); + writer.WriteNumberValue(StandardMinutesLifetime); + if (Optional.IsDefined(HighMinutesLifetime)) + { + writer.WritePropertyName("highMinutesLifetime"u8); + writer.WriteNumberValue(HighMinutesLifetime.Value); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumQuotaAllocations IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumQuotaAllocations JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumQuotaAllocations)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumQuotaAllocations(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumQuotaAllocations DeserializeQuantumQuotaAllocations(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int standardMinutesLifetime = default; + int? highMinutesLifetime = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("standardMinutesLifetime"u8)) + { + standardMinutesLifetime = prop.Value.GetInt32(); + continue; + } + if (prop.NameEquals("highMinutesLifetime"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highMinutesLifetime = prop.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumQuotaAllocations(standardMinutesLifetime, highMinutesLifetime, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumQuotaAllocations)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumQuotaAllocations IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumQuotaAllocations PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumQuotaAllocations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumQuotaAllocations)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaAllocations.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaAllocations.cs new file mode 100644 index 000000000000..6999101b7c8b --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaAllocations.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Quota allocations with each field representing different quota type. + public partial class QuantumQuotaAllocations + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// Lifetime limit for standard priority jobs execution in minutes. + public QuantumQuotaAllocations(int standardMinutesLifetime) + { + StandardMinutesLifetime = standardMinutesLifetime; + } + + /// Initializes a new instance of . + /// Lifetime limit for standard priority jobs execution in minutes. + /// Lifetime limit for high priority jobs execution in minutes. + /// Keeps track of any properties unknown to the library. + internal QuantumQuotaAllocations(int standardMinutesLifetime, int? highMinutesLifetime, IDictionary additionalBinaryDataProperties) + { + StandardMinutesLifetime = standardMinutesLifetime; + HighMinutesLifetime = highMinutesLifetime; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Lifetime limit for standard priority jobs execution in minutes. + public int StandardMinutesLifetime { get; set; } + + /// Lifetime limit for high priority jobs execution in minutes. + public int? HighMinutesLifetime { get; set; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.Serialization.cs index a06d704b26a3..12da40014227 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class QuantumQuotaDimension : IUtf8JsonSerializable, IJsonModel + /// Information about a specific quota dimension. + public partial class QuantumQuotaDimension : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumQuotaDimension)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -74,15 +74,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("unitPlural"u8); writer.WriteStringValue(UnitPlural); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -91,22 +91,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - QuantumQuotaDimension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + QuantumQuotaDimension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumQuotaDimension JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumQuotaDimension)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeQuantumQuotaDimension(document.RootElement, options); } - internal static QuantumQuotaDimension DeserializeQuantumQuotaDimension(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumQuotaDimension DeserializeQuantumQuotaDimension(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -119,60 +124,58 @@ internal static QuantumQuotaDimension DeserializeQuantumQuotaDimension(JsonEleme string description = default; string unit = default; string unitPlural = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("scope"u8)) + if (prop.NameEquals("scope"u8)) { - scope = property.Value.GetString(); + scope = prop.Value.GetString(); continue; } - if (property.NameEquals("period"u8)) + if (prop.NameEquals("period"u8)) { - period = property.Value.GetString(); + period = prop.Value.GetString(); continue; } - if (property.NameEquals("quota"u8)) + if (prop.NameEquals("quota"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - quota = property.Value.GetSingle(); + quota = prop.Value.GetSingle(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("unit"u8)) + if (prop.NameEquals("unit"u8)) { - unit = property.Value.GetString(); + unit = prop.Value.GetString(); continue; } - if (property.NameEquals("unitPlural"u8)) + if (prop.NameEquals("unitPlural"u8)) { - unitPlural = property.Value.GetString(); + unitPlural = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new QuantumQuotaDimension( id, scope, @@ -182,13 +185,16 @@ internal static QuantumQuotaDimension DeserializeQuantumQuotaDimension(JsonEleme description, unit, unitPlural, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -198,15 +204,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - QuantumQuotaDimension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + QuantumQuotaDimension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumQuotaDimension PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeQuantumQuotaDimension(document.RootElement, options); } default: @@ -214,6 +225,7 @@ QuantumQuotaDimension IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.cs index 60903a209164..f1faf7c0b0c1 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumQuotaDimension.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Information about a specific quota dimension. public partial class QuantumQuotaDimension { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal QuantumQuotaDimension() @@ -59,8 +30,8 @@ internal QuantumQuotaDimension() /// A description about this quota dimension. /// The standard unit of measurement used for this quota dimension. /// The standard unit of measurement used for this quota dimension in plural form. - /// Keeps track of any properties unknown to the library. - internal QuantumQuotaDimension(string id, string scope, string period, float? quota, string name, string description, string unit, string unitPlural, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal QuantumQuotaDimension(string id, string scope, string period, float? quota, string name, string description, string unit, string unitPlural, IDictionary additionalBinaryDataProperties) { Id = id; Scope = scope; @@ -70,23 +41,30 @@ internal QuantumQuotaDimension(string id, string scope, string period, float? qu Description = description; Unit = unit; UnitPlural = unitPlural; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique id of this dimension. public string Id { get; } + /// The scope of this quota dimension. public string Scope { get; } + /// The reset period of this quota dimension. public string Period { get; } + /// The max limit of this dimension. public float? Quota { get; } + /// The display name of this quota dimension. public string Name { get; } + /// A description about this quota dimension. public string Description { get; } + /// The standard unit of measurement used for this quota dimension. public string Unit { get; } + /// The standard unit of measurement used for this quota dimension in plural form. public string UnitPlural { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOffer.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOffer.Serialization.cs new file mode 100644 index 000000000000..08f2bab9b210 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOffer.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// A Quantum Suite Offer that is available to a subscription. + public partial class QuantumSuiteOffer : ResourceData, IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumSuiteOffer)} does not support writing '{format}' format."); + } + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumSuiteOffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (QuantumSuiteOffer)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumSuiteOffer)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumSuiteOffer(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumSuiteOffer DeserializeQuantumSuiteOffer(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType resourceType = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + QuantumSuiteOfferProperties properties = default; + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerQuantumContext.Default); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = QuantumSuiteOfferProperties.DeserializeQuantumSuiteOfferProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumSuiteOffer( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties, + properties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumSuiteOffer)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumSuiteOffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (QuantumSuiteOffer)PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumSuiteOffer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumSuiteOffer)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOffer.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOffer.cs new file mode 100644 index 000000000000..388fd79676d6 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOffer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// A Quantum Suite Offer that is available to a subscription. + public partial class QuantumSuiteOffer : ResourceData + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal QuantumSuiteOffer() + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// The resource-specific properties for this resource. + internal QuantumSuiteOffer(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, QuantumSuiteOfferProperties properties) : base(id, name, resourceType, systemData) + { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; + } + + /// The resource-specific properties for this resource. + public QuantumSuiteOfferProperties Properties { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferListResult.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferListResult.Serialization.cs new file mode 100644 index 000000000000..cccd6a27921a --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferListResult.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// The response of a QuantumSuiteOffer list operation. + internal partial class QuantumSuiteOfferListResult : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal QuantumSuiteOfferListResult() + { + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumSuiteOfferListResult)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (QuantumSuiteOffer item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumSuiteOfferListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumSuiteOfferListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumSuiteOfferListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumSuiteOfferListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumSuiteOfferListResult DeserializeQuantumSuiteOfferListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(QuantumSuiteOffer.DeserializeQuantumSuiteOffer(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumSuiteOfferListResult(value, nextLink, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumSuiteOfferListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumSuiteOfferListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumSuiteOfferListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumSuiteOfferListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumSuiteOfferListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static QuantumSuiteOfferListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQuantumSuiteOfferListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferListResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferListResult.cs new file mode 100644 index 000000000000..46f5960b8dd8 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferListResult.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// The response of a QuantumSuiteOffer list operation. + internal partial class QuantumSuiteOfferListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The QuantumSuiteOffer items on this page. + internal QuantumSuiteOfferListResult(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The QuantumSuiteOffer items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal QuantumSuiteOfferListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The QuantumSuiteOffer items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferProperties.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferProperties.Serialization.cs new file mode 100644 index 000000000000..98570d31dd1d --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferProperties.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Properties of a Quantum Suite Offer. + public partial class QuantumSuiteOfferProperties : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal QuantumSuiteOfferProperties() + { + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumSuiteOfferProperties)} does not support writing '{format}' format."); + } + writer.WritePropertyName("providerId"u8); + writer.WriteStringValue(ProviderId); + writer.WritePropertyName("providerName"u8); + writer.WriteStringValue(ProviderName); + writer.WritePropertyName("companyName"u8); + writer.WriteStringValue(CompanyName); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + if (Optional.IsDefined(Quotas)) + { + writer.WritePropertyName("quotas"u8); + writer.WriteStringValue(Quotas.Value); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumSuiteOfferProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumSuiteOfferProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumSuiteOfferProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumSuiteOfferProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumSuiteOfferProperties DeserializeQuantumSuiteOfferProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string providerId = default; + string providerName = default; + string companyName = default; + string location = default; + string description = default; + AzureLocation? quotas = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("providerId"u8)) + { + providerId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("providerName"u8)) + { + providerName = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("companyName"u8)) + { + companyName = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("location"u8)) + { + location = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("description"u8)) + { + description = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("quotas"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quotas = new AzureLocation(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumSuiteOfferProperties( + providerId, + providerName, + companyName, + location, + description, + quotas, + additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumSuiteOfferProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumSuiteOfferProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumSuiteOfferProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumSuiteOfferProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumSuiteOfferProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferProperties.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferProperties.cs new file mode 100644 index 000000000000..3afb0e78d87d --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumSuiteOfferProperties.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Properties of a Quantum Suite Offer. + public partial class QuantumSuiteOfferProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The provider ID of the offer. + /// The provider name of the offer. + /// The name of the company that is providing this offer. + /// The location where this offer is available. + /// Description of the offer. + internal QuantumSuiteOfferProperties(string providerId, string providerName, string companyName, string location, string description) + { + ProviderId = providerId; + ProviderName = providerName; + CompanyName = companyName; + Location = location; + Description = description; + } + + /// Initializes a new instance of . + /// The provider ID of the offer. + /// The provider name of the offer. + /// The name of the company that is providing this offer. + /// The location where this offer is available. + /// Description of the offer. + /// Quota allocations associated with this offer. + /// Keeps track of any properties unknown to the library. + internal QuantumSuiteOfferProperties(string providerId, string providerName, string companyName, string location, string description, AzureLocation? quotas, IDictionary additionalBinaryDataProperties) + { + ProviderId = providerId; + ProviderName = providerName; + CompanyName = companyName; + Location = location; + Description = description; + Quotas = quotas; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The provider ID of the offer. + public string ProviderId { get; } + + /// The provider name of the offer. + public string ProviderName { get; } + + /// The name of the company that is providing this offer. + public string CompanyName { get; } + + /// The location where this offer is available. + public string Location { get; } + + /// Description of the offer. + public string Description { get; } + + /// Quota allocations associated with this offer. + public AzureLocation? Quotas { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceKind.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceKind.cs new file mode 100644 index 000000000000..c831b77939a6 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceKind.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// The workspace type. + public readonly partial struct QuantumWorkspaceKind : IEquatable + { + private readonly string _value; + /// The workspace is a general-purpose workspace. + private const string V1Value = "V1"; + /// The workspace is a V2 workspace. + private const string V2Value = "V2"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public QuantumWorkspaceKind(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// The workspace is a general-purpose workspace. + public static QuantumWorkspaceKind V1 { get; } = new QuantumWorkspaceKind(V1Value); + + /// The workspace is a V2 workspace. + public static QuantumWorkspaceKind V2 { get; } = new QuantumWorkspaceKind(V2Value); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(QuantumWorkspaceKind left, QuantumWorkspaceKind right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(QuantumWorkspaceKind left, QuantumWorkspaceKind right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator QuantumWorkspaceKind(string value) => new QuantumWorkspaceKind(value); + + /// Converts a string to a . + /// The value. + public static implicit operator QuantumWorkspaceKind?(string value) => value == null ? null : new QuantumWorkspaceKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is QuantumWorkspaceKind other && Equals(other); + + /// + public bool Equals(QuantumWorkspaceKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + + /// + public override string ToString() => _value; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceListResult.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceListResult.Serialization.cs new file mode 100644 index 000000000000..87082549a2ed --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceListResult.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// The response of a QuantumWorkspace list operation. + internal partial class QuantumWorkspaceListResult : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal QuantumWorkspaceListResult() + { + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumWorkspaceListResult)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (QuantumWorkspaceData item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumWorkspaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumWorkspaceListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumWorkspaceListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumWorkspaceListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumWorkspaceListResult DeserializeQuantumWorkspaceListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(QuantumWorkspaceData.DeserializeQuantumWorkspaceData(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumWorkspaceListResult(value, nextLink, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumWorkspaceListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumWorkspaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumWorkspaceListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumWorkspaceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumWorkspaceListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static QuantumWorkspaceListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQuantumWorkspaceListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceListResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceListResult.cs new file mode 100644 index 000000000000..064c456d1888 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceListResult.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// The response of a QuantumWorkspace list operation. + internal partial class QuantumWorkspaceListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The QuantumWorkspace items on this page. + internal QuantumWorkspaceListResult(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The QuantumWorkspace items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal QuantumWorkspaceListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The QuantumWorkspace items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.Serialization.cs index 2920213ee1e6..4b3f19bdc599 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class QuantumWorkspacePatch : IUtf8JsonSerializable, IJsonModel + /// The type used for updating tags in QuantumWorkspace resources. + public partial class QuantumWorkspacePatch : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumWorkspacePatch)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -41,19 +42,24 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -62,58 +68,71 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - QuantumWorkspacePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + QuantumWorkspacePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumWorkspacePatch JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumWorkspacePatch)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeQuantumWorkspacePatch(document.RootElement, options); } - internal static QuantumWorkspacePatch DeserializeQuantumWorkspacePatch(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumWorkspacePatch DeserializeQuantumWorkspacePatch(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new QuantumWorkspacePatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new QuantumWorkspacePatch(tags ?? new ChangeTrackingDictionary(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - QuantumWorkspacePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + QuantumWorkspacePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumWorkspacePatch PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeQuantumWorkspacePatch(document.RootElement, options); } default: @@ -139,6 +163,19 @@ QuantumWorkspacePatch IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(QuantumWorkspacePatch quantumWorkspacePatch) + { + if (quantumWorkspacePatch == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(quantumWorkspacePatch, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.cs index 2cee0e642cf4..01df73bc6efd 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspacePatch.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - /// Tags object for patch operations. + /// The type used for updating tags in QuantumWorkspace resources. public partial class QuantumWorkspacePatch { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public QuantumWorkspacePatch() @@ -53,11 +25,11 @@ public QuantumWorkspacePatch() /// Initializes a new instance of . /// Resource tags. - /// Keeps track of any properties unknown to the library. - internal QuantumWorkspacePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal QuantumWorkspacePatch(IDictionary tags, IDictionary additionalBinaryDataProperties) { Tags = tags; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Resource tags. diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceProperties.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceProperties.Serialization.cs new file mode 100644 index 000000000000..e4fc99f96392 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceProperties.Serialization.cs @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Properties of a Workspace. + public partial class QuantumWorkspaceProperties : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumWorkspaceProperties)} does not support writing '{format}' format."); + } + if (Optional.IsCollectionDefined(Providers)) + { + writer.WritePropertyName("providers"u8); + writer.WriteStartArray(); + foreach (QuantumProvider item in Providers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Usable)) + { + writer.WritePropertyName("usable"u8); + writer.WriteStringValue(Usable.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(StorageAccount)) + { + writer.WritePropertyName("storageAccount"u8); + writer.WriteStringValue(StorageAccount); + } + if (Optional.IsDefined(WorkspaceKind)) + { + writer.WritePropertyName("workspaceKind"u8); + writer.WriteStringValue(WorkspaceKind.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(IsApiKeyEnabled)) + { + writer.WritePropertyName("apiKeyEnabled"u8); + writer.WriteBooleanValue(IsApiKeyEnabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(ManagedOnBehalfOfConfiguration)) + { + writer.WritePropertyName("managedOnBehalfOfConfiguration"u8); + writer.WriteObjectValue(ManagedOnBehalfOfConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(ManagedStorageAccount)) + { + writer.WritePropertyName("managedStorageAccount"u8); + writer.WriteStringValue(ManagedStorageAccount); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + QuantumWorkspaceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual QuantumWorkspaceProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuantumWorkspaceProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuantumWorkspaceProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumWorkspaceProperties DeserializeQuantumWorkspaceProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList providers = default; + WorkspaceUsableStatus? usable = default; + ProviderProvisioningStatus? provisioningState = default; + ResourceIdentifier storageAccount = default; + QuantumWorkspaceKind? workspaceKind = default; + Uri endpointUri = default; + bool? isApiKeyEnabled = default; + ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration = default; + ResourceIdentifier managedStorageAccount = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("providers"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(QuantumProvider.DeserializeQuantumProvider(item, options)); + } + providers = array; + continue; + } + if (prop.NameEquals("usable"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usable = new WorkspaceUsableStatus(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProviderProvisioningStatus(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("storageAccount"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccount = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("workspaceKind"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workspaceKind = new QuantumWorkspaceKind(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("endpointUri"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = string.IsNullOrEmpty(prop.Value.GetString()) ? null : new Uri(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("apiKeyEnabled"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isApiKeyEnabled = prop.Value.GetBoolean(); + continue; + } + if (prop.NameEquals("managedOnBehalfOfConfiguration"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedOnBehalfOfConfiguration = ManagedOnBehalfOfConfiguration.DeserializeManagedOnBehalfOfConfiguration(prop.Value, options); + continue; + } + if (prop.NameEquals("managedStorageAccount"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedStorageAccount = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new QuantumWorkspaceProperties( + providers ?? new ChangeTrackingList(), + usable, + provisioningState, + storageAccount, + workspaceKind, + endpointUri, + isApiKeyEnabled, + managedOnBehalfOfConfiguration, + managedStorageAccount, + additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); + default: + throw new FormatException($"The model {nameof(QuantumWorkspaceProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + QuantumWorkspaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual QuantumWorkspaceProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeQuantumWorkspaceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuantumWorkspaceProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceProperties.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceProperties.cs new file mode 100644 index 000000000000..a284127fbb81 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/QuantumWorkspaceProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Properties of a Workspace. + public partial class QuantumWorkspaceProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public QuantumWorkspaceProperties() + { + Providers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Providers selected for this Workspace. + /// Whether the current workspace is ready to accept Jobs. + /// Provisioning status field. + /// ARM Resource Id of the storage account associated with this workspace. + /// Whether this workspace is V1 or V2. + /// The URI of the workspace endpoint. + /// Indicator of enablement of the Quantum workspace Api keys. + /// Managed On Behalf Of configuration. + /// ARM Resource Id of the managed storage account associated with this workspace. + /// Keeps track of any properties unknown to the library. + internal QuantumWorkspaceProperties(IList providers, WorkspaceUsableStatus? usable, ProviderProvisioningStatus? provisioningState, ResourceIdentifier storageAccount, QuantumWorkspaceKind? workspaceKind, Uri endpointUri, bool? isApiKeyEnabled, ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration, ResourceIdentifier managedStorageAccount, IDictionary additionalBinaryDataProperties) + { + Providers = providers; + Usable = usable; + ProvisioningState = provisioningState; + StorageAccount = storageAccount; + WorkspaceKind = workspaceKind; + EndpointUri = endpointUri; + IsApiKeyEnabled = isApiKeyEnabled; + ManagedOnBehalfOfConfiguration = managedOnBehalfOfConfiguration; + ManagedStorageAccount = managedStorageAccount; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// List of Providers selected for this Workspace. + public IList Providers { get; } + + /// Whether the current workspace is ready to accept Jobs. + public WorkspaceUsableStatus? Usable { get; } + + /// Provisioning status field. + public ProviderProvisioningStatus? ProvisioningState { get; } + + /// ARM Resource Id of the storage account associated with this workspace. + public ResourceIdentifier StorageAccount { get; set; } + + /// Whether this workspace is V1 or V2. + public QuantumWorkspaceKind? WorkspaceKind { get; set; } + + /// The URI of the workspace endpoint. + public Uri EndpointUri { get; } + + /// Indicator of enablement of the Quantum workspace Api keys. + public bool? IsApiKeyEnabled { get; set; } + + /// Managed On Behalf Of configuration. + internal ManagedOnBehalfOfConfiguration ManagedOnBehalfOfConfiguration { get; } + + /// ARM Resource Id of the managed storage account associated with this workspace. + public ResourceIdentifier ManagedStorageAccount { get; } + + /// Managed-On-Behalf-Of broker resources. + public IReadOnlyList ManagedOnBehalfOfMoboBrokerResources + { + get + { + return ManagedOnBehalfOfConfiguration.MoboBrokerResources; + } + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.Serialization.cs index 35b17b8f698f..d3e2358d6049 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class WorkspaceApiKey : IUtf8JsonSerializable, IJsonModel + /// Azure quantum workspace Api key details. + public partial class WorkspaceApiKey : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceApiKey)} does not support writing '{format}' format."); } - if (Optional.IsDefined(CreatedOn)) { writer.WritePropertyName("createdAt"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,59 +61,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WorkspaceApiKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WorkspaceApiKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WorkspaceApiKey JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceApiKey)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWorkspaceApiKey(document.RootElement, options); } - internal static WorkspaceApiKey DeserializeWorkspaceApiKey(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WorkspaceApiKey DeserializeWorkspaceApiKey(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? createdAt = default; + DateTimeOffset? createdOn = default; string key = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("createdAt"u8)) + if (prop.NameEquals("createdAt"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - createdAt = property.Value.GetDateTimeOffset("O"); + createdOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("key"u8)) + if (prop.NameEquals("key"u8)) { - key = property.Value.GetString(); + key = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WorkspaceApiKey(createdAt, key, serializedAdditionalRawData); + return new WorkspaceApiKey(createdOn, key, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +129,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opt } } - WorkspaceApiKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WorkspaceApiKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WorkspaceApiKey PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWorkspaceApiKey(document.RootElement, options); } default: @@ -139,6 +150,7 @@ WorkspaceApiKey IPersistableModel.Create(BinaryData data, Model } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.cs index b7432eb69732..b39453599b22 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKey.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Azure quantum workspace Api key details. public partial class WorkspaceApiKey { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WorkspaceApiKey() @@ -53,16 +24,17 @@ internal WorkspaceApiKey() /// Initializes a new instance of . /// The creation time of the api key. /// The Api key. - /// Keeps track of any properties unknown to the library. - internal WorkspaceApiKey(DateTimeOffset? createdOn, string key, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WorkspaceApiKey(DateTimeOffset? createdOn, string key, IDictionary additionalBinaryDataProperties) { CreatedOn = createdOn; Key = key; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The creation time of the api key. public DateTimeOffset? CreatedOn { get; } + /// The Api key. public string Key { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.Serialization.cs index 1e78362f6b09..9415f99a2c33 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class WorkspaceApiKeys : IUtf8JsonSerializable, IJsonModel + /// List of api keys to be generated. + public partial class WorkspaceApiKeys : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,31 +30,30 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceApiKeys)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Keys)) { writer.WritePropertyName("keys"u8); writer.WriteStartArray(); - foreach (var item in Keys) + foreach (WorkspaceKeyType item in Keys) { writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,39 +62,43 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WorkspaceApiKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WorkspaceApiKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WorkspaceApiKeys JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceApiKeys)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWorkspaceApiKeys(document.RootElement, options); } - internal static WorkspaceApiKeys DeserializeWorkspaceApiKeys(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WorkspaceApiKeys DeserializeWorkspaceApiKeys(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList keys = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("keys"u8)) + if (prop.NameEquals("keys"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(new WorkspaceKeyType(item.GetString())); } @@ -102,17 +107,19 @@ internal static WorkspaceApiKeys DeserializeWorkspaceApiKeys(JsonElement element } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WorkspaceApiKeys(keys ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new WorkspaceApiKeys(keys ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -122,15 +129,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions op } } - WorkspaceApiKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WorkspaceApiKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WorkspaceApiKeys PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWorkspaceApiKeys(document.RootElement, options); } default: @@ -138,6 +150,19 @@ WorkspaceApiKeys IPersistableModel.Create(BinaryData data, Mod } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(WorkspaceApiKeys workspaceApiKeys) + { + if (workspaceApiKeys == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(workspaceApiKeys, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.cs index 98c88be65809..db3f54d183ca 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceApiKeys.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { /// List of api keys to be generated. public partial class WorkspaceApiKeys { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public WorkspaceApiKeys() @@ -53,11 +25,11 @@ public WorkspaceApiKeys() /// Initializes a new instance of . /// A list of api key names. - /// Keeps track of any properties unknown to the library. - internal WorkspaceApiKeys(IList keys, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WorkspaceApiKeys(IList keys, IDictionary additionalBinaryDataProperties) { Keys = keys; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// A list of api key names. diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.Serialization.cs index d270d32e4edb..cedef5953e15 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.Serialization.cs @@ -9,14 +9,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class WorkspaceKeyListResult : IUtf8JsonSerializable, IJsonModel + /// Result of list Api keys and connection strings. + public partial class WorkspaceKeyListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceKeyListResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IsApiKeyEnabled)) { writer.WritePropertyName("apiKeyEnabled"u8); @@ -59,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("secondaryConnectionString"u8); writer.WriteStringValue(SecondaryConnectionString); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -76,91 +77,97 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WorkspaceKeyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WorkspaceKeyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WorkspaceKeyListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceKeyListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWorkspaceKeyListResult(document.RootElement, options); } - internal static WorkspaceKeyListResult DeserializeWorkspaceKeyListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WorkspaceKeyListResult DeserializeWorkspaceKeyListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - bool? apiKeyEnabled = default; + bool? isApiKeyEnabled = default; WorkspaceApiKey primaryKey = default; WorkspaceApiKey secondaryKey = default; string primaryConnectionString = default; string secondaryConnectionString = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("apiKeyEnabled"u8)) + if (prop.NameEquals("apiKeyEnabled"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - apiKeyEnabled = property.Value.GetBoolean(); + isApiKeyEnabled = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("primaryKey"u8)) + if (prop.NameEquals("primaryKey"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - primaryKey = WorkspaceApiKey.DeserializeWorkspaceApiKey(property.Value, options); + primaryKey = WorkspaceApiKey.DeserializeWorkspaceApiKey(prop.Value, options); continue; } - if (property.NameEquals("secondaryKey"u8)) + if (prop.NameEquals("secondaryKey"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - secondaryKey = WorkspaceApiKey.DeserializeWorkspaceApiKey(property.Value, options); + secondaryKey = WorkspaceApiKey.DeserializeWorkspaceApiKey(prop.Value, options); continue; } - if (property.NameEquals("primaryConnectionString"u8)) + if (prop.NameEquals("primaryConnectionString"u8)) { - primaryConnectionString = property.Value.GetString(); + primaryConnectionString = prop.Value.GetString(); continue; } - if (property.NameEquals("secondaryConnectionString"u8)) + if (prop.NameEquals("secondaryConnectionString"u8)) { - secondaryConnectionString = property.Value.GetString(); + secondaryConnectionString = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WorkspaceKeyListResult( - apiKeyEnabled, + isApiKeyEnabled, primaryKey, secondaryKey, primaryConnectionString, secondaryConnectionString, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -170,15 +177,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - WorkspaceKeyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WorkspaceKeyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WorkspaceKeyListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWorkspaceKeyListResult(document.RootElement, options); } default: @@ -186,6 +198,14 @@ WorkspaceKeyListResult IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static WorkspaceKeyListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWorkspaceKeyListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.cs index 528ffd143045..5d5f8f8129a7 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyListResult.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Quantum.Models /// Result of list Api keys and connection strings. public partial class WorkspaceKeyListResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WorkspaceKeyListResult() @@ -56,25 +27,29 @@ internal WorkspaceKeyListResult() /// The quantum workspace secondary api key. /// The connection string of the primary api key. /// The connection string of the secondary api key. - /// Keeps track of any properties unknown to the library. - internal WorkspaceKeyListResult(bool? isApiKeyEnabled, WorkspaceApiKey primaryKey, WorkspaceApiKey secondaryKey, string primaryConnectionString, string secondaryConnectionString, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WorkspaceKeyListResult(bool? isApiKeyEnabled, WorkspaceApiKey primaryKey, WorkspaceApiKey secondaryKey, string primaryConnectionString, string secondaryConnectionString, IDictionary additionalBinaryDataProperties) { IsApiKeyEnabled = isApiKeyEnabled; PrimaryKey = primaryKey; SecondaryKey = secondaryKey; PrimaryConnectionString = primaryConnectionString; SecondaryConnectionString = secondaryConnectionString; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Indicator of enablement of the Quantum workspace Api keys. public bool? IsApiKeyEnabled { get; } + /// The quantum workspace primary api key. public WorkspaceApiKey PrimaryKey { get; } + /// The quantum workspace secondary api key. public WorkspaceApiKey SecondaryKey { get; } + /// The connection string of the primary api key. public string PrimaryConnectionString { get; } + /// The connection string of the secondary api key. public string SecondaryConnectionString { get; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyType.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyType.cs index 26a425da96d4..4b2ebf951c49 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyType.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceKeyType.cs @@ -7,45 +7,65 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - /// The WorkspaceKeyType. + /// The API key type. public readonly partial struct WorkspaceKeyType : IEquatable { private readonly string _value; + /// The primary API key. + private const string PrimaryValue = "Primary"; + /// The secondary API key. + private const string SecondaryValue = "Secondary"; /// Initializes a new instance of . + /// The value. /// is null. public WorkspaceKeyType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string PrimaryValue = "Primary"; - private const string SecondaryValue = "Secondary"; + _value = value; + } - /// Primary. + /// The primary API key. public static WorkspaceKeyType Primary { get; } = new WorkspaceKeyType(PrimaryValue); - /// Secondary. + + /// The secondary API key. public static WorkspaceKeyType Secondary { get; } = new WorkspaceKeyType(SecondaryValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(WorkspaceKeyType left, WorkspaceKeyType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(WorkspaceKeyType left, WorkspaceKeyType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator WorkspaceKeyType(string value) => new WorkspaceKeyType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator WorkspaceKeyType?(string value) => value == null ? null : new WorkspaceKeyType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is WorkspaceKeyType other && Equals(other); - /// + + /// public bool Equals(WorkspaceKeyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceListResult.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceListResult.Serialization.cs deleted file mode 100644 index fda98e37cb8e..000000000000 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceListResult.Serialization.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Quantum.Models -{ - internal partial class WorkspaceListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(WorkspaceListResult)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - WorkspaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(WorkspaceListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeWorkspaceListResult(document.RootElement, options); - } - - internal static WorkspaceListResult DeserializeWorkspaceListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(QuantumWorkspaceData.DeserializeQuantumWorkspaceData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new WorkspaceListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerQuantumContext.Default); - default: - throw new FormatException($"The model {nameof(WorkspaceListResult)} does not support writing '{options.Format}' format."); - } - } - - WorkspaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWorkspaceListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(WorkspaceListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceListResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceListResult.cs deleted file mode 100644 index ac1f1a851284..000000000000 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.Quantum.Models -{ - /// The response of a list Workspaces operation. - internal partial class WorkspaceListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal WorkspaceListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Result of a list Workspaces operation. - /// Link to the next set of results. Not empty if Value contains incomplete list of Workspaces. - /// Keeps track of any properties unknown to the library. - internal WorkspaceListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Result of a list Workspaces operation. - public IReadOnlyList Value { get; } - /// Link to the next set of results. Not empty if Value contains incomplete list of Workspaces. - public string NextLink { get; } - } -} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.Serialization.cs index 30cc1512a38e..9d2e7a6cf2b6 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class WorkspaceNameAvailabilityContent : IUtf8JsonSerializable, IJsonModel + /// The check availability request body. + public partial class WorkspaceNameAvailabilityContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceNameAvailabilityContent)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -44,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("type"u8); writer.WriteStringValue(ResourceType.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,59 +62,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WorkspaceNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WorkspaceNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WorkspaceNameAvailabilityContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceNameAvailabilityContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWorkspaceNameAvailabilityContent(document.RootElement, options); } - internal static WorkspaceNameAvailabilityContent DeserializeWorkspaceNameAvailabilityContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WorkspaceNameAvailabilityContent DeserializeWorkspaceNameAvailabilityContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - ResourceType? type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + ResourceType? resourceType = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - type = new ResourceType(property.Value.GetString()); + resourceType = new ResourceType(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WorkspaceNameAvailabilityContent(name, type, serializedAdditionalRawData); + return new WorkspaceNameAvailabilityContent(name, resourceType, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +130,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - WorkspaceNameAvailabilityContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WorkspaceNameAvailabilityContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WorkspaceNameAvailabilityContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWorkspaceNameAvailabilityContent(document.RootElement, options); } default: @@ -139,6 +151,19 @@ WorkspaceNameAvailabilityContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(WorkspaceNameAvailabilityContent workspaceNameAvailabilityContent) + { + if (workspaceNameAvailabilityContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(workspaceNameAvailabilityContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.cs index c70bf2f08e13..5161663173bb 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityContent.cs @@ -11,40 +11,11 @@ namespace Azure.ResourceManager.Quantum.Models { - /// Details of check name availability request body. + /// The check availability request body. public partial class WorkspaceNameAvailabilityContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public WorkspaceNameAvailabilityContent() @@ -52,19 +23,20 @@ public WorkspaceNameAvailabilityContent() } /// Initializes a new instance of . - /// Name for checking availability. - /// The resource type of Quantum Workspace. - /// Keeps track of any properties unknown to the library. - internal WorkspaceNameAvailabilityContent(string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData) + /// The name of the resource for which availability needs to be checked. + /// The resource type. + /// Keeps track of any properties unknown to the library. + internal WorkspaceNameAvailabilityContent(string name, ResourceType? resourceType, IDictionary additionalBinaryDataProperties) { Name = name; ResourceType = resourceType; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Name for checking availability. + /// The name of the resource for which availability needs to be checked. public string Name { get; set; } - /// The resource type of Quantum Workspace. + + /// The resource type. public ResourceType? ResourceType { get; set; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.Serialization.cs index 1000b3f72f57..1f4c91b64974 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.Serialization.cs @@ -9,14 +9,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { - public partial class WorkspaceNameAvailabilityResult : IUtf8JsonSerializable, IJsonModel + /// The check availability result. + public partial class WorkspaceNameAvailabilityResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceNameAvailabilityResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IsNameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -42,22 +43,22 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Reason)) { writer.WritePropertyName("reason"u8); - writer.WriteStringValue(Reason); + writer.WriteStringValue(Reason.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(Message)) + if (Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,65 +67,75 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WorkspaceNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WorkspaceNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WorkspaceNameAvailabilityResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WorkspaceNameAvailabilityResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWorkspaceNameAvailabilityResult(document.RootElement, options); } - internal static WorkspaceNameAvailabilityResult DeserializeWorkspaceNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WorkspaceNameAvailabilityResult DeserializeWorkspaceNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - bool? nameAvailable = default; - string reason = default; + bool? isNameAvailable = default; + WorkspaceNameUnavailableReason? reason = default; string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("nameAvailable"u8)) + if (prop.NameEquals("nameAvailable"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nameAvailable = property.Value.GetBoolean(); + isNameAvailable = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("reason"u8)) + if (prop.NameEquals("reason"u8)) { - reason = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reason = new WorkspaceNameUnavailableReason(prop.Value.GetString()); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WorkspaceNameAvailabilityResult(nameAvailable, reason, message, serializedAdditionalRawData); + return new WorkspaceNameAvailabilityResult(isNameAvailable, reason, message, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +145,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - WorkspaceNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WorkspaceNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WorkspaceNameAvailabilityResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWorkspaceNameAvailabilityResult(document.RootElement, options); } default: @@ -150,6 +166,14 @@ WorkspaceNameAvailabilityResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static WorkspaceNameAvailabilityResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWorkspaceNameAvailabilityResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.cs index 9634c251f863..017cb7752bb9 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameAvailabilityResult.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Quantum.Models { - /// Result of check name availability. + /// The check availability result. public partial class WorkspaceNameAvailabilityResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WorkspaceNameAvailabilityResult() @@ -51,23 +22,25 @@ internal WorkspaceNameAvailabilityResult() } /// Initializes a new instance of . - /// Indicator of availability of the Quantum Workspace resource name. - /// The reason of unavailability. - /// The detailed info regarding the reason associated with the Namespace. - /// Keeps track of any properties unknown to the library. - internal WorkspaceNameAvailabilityResult(bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) + /// Indicates if the resource name is available. + /// The reason why the given name is not available. + /// Detailed reason why the given name is not available. + /// Keeps track of any properties unknown to the library. + internal WorkspaceNameAvailabilityResult(bool? isNameAvailable, WorkspaceNameUnavailableReason? reason, string message, IDictionary additionalBinaryDataProperties) { IsNameAvailable = isNameAvailable; Reason = reason; Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Indicator of availability of the Quantum Workspace resource name. + /// Indicates if the resource name is available. public bool? IsNameAvailable { get; } - /// The reason of unavailability. - public string Reason { get; } - /// The detailed info regarding the reason associated with the Namespace. + + /// The reason why the given name is not available. + public WorkspaceNameUnavailableReason? Reason { get; } + + /// Detailed reason why the given name is not available. public string Message { get; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameUnavailableReason.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameUnavailableReason.cs new file mode 100644 index 000000000000..006e5c5b8686 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceNameUnavailableReason.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Models +{ + /// Possible reasons for a name not being available. + public readonly partial struct WorkspaceNameUnavailableReason : IEquatable + { + private readonly string _value; + /// Name is invalid. + private const string InvalidValue = "Invalid"; + /// Name already exists. + private const string AlreadyExistsValue = "AlreadyExists"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public WorkspaceNameUnavailableReason(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Name is invalid. + public static WorkspaceNameUnavailableReason Invalid { get; } = new WorkspaceNameUnavailableReason(InvalidValue); + + /// Name already exists. + public static WorkspaceNameUnavailableReason AlreadyExists { get; } = new WorkspaceNameUnavailableReason(AlreadyExistsValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(WorkspaceNameUnavailableReason left, WorkspaceNameUnavailableReason right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(WorkspaceNameUnavailableReason left, WorkspaceNameUnavailableReason right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator WorkspaceNameUnavailableReason(string value) => new WorkspaceNameUnavailableReason(value); + + /// Converts a string to a . + /// The value. + public static implicit operator WorkspaceNameUnavailableReason?(string value) => value == null ? null : new WorkspaceNameUnavailableReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WorkspaceNameUnavailableReason other && Equals(other); + + /// + public bool Equals(WorkspaceNameUnavailableReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + + /// + public override string ToString() => _value; + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceUsableStatus.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceUsableStatus.cs index a03069ad0041..e81f190e5f36 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceUsableStatus.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Models/WorkspaceUsableStatus.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Quantum; namespace Azure.ResourceManager.Quantum.Models { @@ -14,41 +15,62 @@ namespace Azure.ResourceManager.Quantum.Models public readonly partial struct WorkspaceUsableStatus : IEquatable { private readonly string _value; + /// The workspace is usable and can accept jobs. + private const string YesValue = "Yes"; + /// The workspace is not usable and cannot accept jobs. + private const string NoValue = "No"; + /// The workspace is partially usable. + private const string PartialValue = "Partial"; /// Initializes a new instance of . + /// The value. /// is null. public WorkspaceUsableStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string YesValue = "Yes"; - private const string NoValue = "No"; - private const string PartialValue = "Partial"; + _value = value; + } - /// Yes. + /// The workspace is usable and can accept jobs. public static WorkspaceUsableStatus Yes { get; } = new WorkspaceUsableStatus(YesValue); - /// No. + + /// The workspace is not usable and cannot accept jobs. public static WorkspaceUsableStatus No { get; } = new WorkspaceUsableStatus(NoValue); - /// Partial. + + /// The workspace is partially usable. public static WorkspaceUsableStatus Partial { get; } = new WorkspaceUsableStatus(PartialValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(WorkspaceUsableStatus left, WorkspaceUsableStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(WorkspaceUsableStatus left, WorkspaceUsableStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator WorkspaceUsableStatus(string value) => new WorkspaceUsableStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator WorkspaceUsableStatus?(string value) => value == null ? null : new WorkspaceUsableStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is WorkspaceUsableStatus other && Equals(other); - /// + + /// public bool Equals(WorkspaceUsableStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ProviderConstants.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ProviderConstants.cs index 4d45b817311e..13bcba16711a 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ProviderConstants.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/ProviderConstants.cs @@ -9,8 +9,9 @@ namespace Azure.ResourceManager.Quantum { - internal static class ProviderConstants + internal static partial class ProviderConstants { + /// Gets the DefaultProviderNamespace. public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceCollection.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceCollection.cs index cf0734ac722c..95700111ecb4 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceCollection.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Quantum @@ -25,51 +26,49 @@ namespace Azure.ResourceManager.Quantum /// public partial class QuantumWorkspaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _quantumWorkspaceWorkspacesClientDiagnostics; - private readonly WorkspacesRestOperations _quantumWorkspaceWorkspacesRestClient; + private readonly ClientDiagnostics _workspacesClientDiagnostics; + private readonly Workspaces _workspacesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of QuantumWorkspaceCollection for mocking. protected QuantumWorkspaceCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal QuantumWorkspaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _quantumWorkspaceWorkspacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Quantum", QuantumWorkspaceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(QuantumWorkspaceResource.ResourceType, out string quantumWorkspaceWorkspacesApiVersion); - _quantumWorkspaceWorkspacesRestClient = new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, quantumWorkspaceWorkspacesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(QuantumWorkspaceResource.ResourceType, out string quantumWorkspaceApiVersion); + _workspacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Quantum", QuantumWorkspaceResource.ResourceType.Namespace, Diagnostics); + _workspacesRestClient = new Workspaces(_workspacesClientDiagnostics, Pipeline, Endpoint, quantumWorkspaceApiVersion ?? "2025-12-15-preview"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id); + } } /// - /// Creates or updates a workspace resource. + /// Creates or updates a Workspace resource. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_CreateOrUpdate + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_CreateOrUpdate. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// @@ -77,21 +76,34 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The name of the quantum workspace resource. /// Workspace details. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string workspaceName, QuantumWorkspaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.CreateOrUpdate"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data, cancellationToken).ConfigureAwait(false); - var operation = new QuantumArmOperation(new QuantumWorkspaceOperationSource(Client), _quantumWorkspaceWorkspacesClientDiagnostics, Pipeline, _quantumWorkspaceWorkspacesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, QuantumWorkspaceData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + QuantumArmOperation operation = new QuantumArmOperation( + new QuantumWorkspaceOperationSource(Client), + _workspacesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -102,23 +114,19 @@ public virtual async Task> CreateOrUpdate } /// - /// Creates or updates a workspace resource. + /// Creates or updates a Workspace resource. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_CreateOrUpdate + /// Operation Id. + /// Workspaces_CreateOrUpdate. /// /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// @@ -126,21 +134,34 @@ public virtual async Task> CreateOrUpdate /// The name of the quantum workspace resource. /// Workspace details. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string workspaceName, QuantumWorkspaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.CreateOrUpdate"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data, cancellationToken); - var operation = new QuantumArmOperation(new QuantumWorkspaceOperationSource(Client), _quantumWorkspaceWorkspacesClientDiagnostics, Pipeline, _quantumWorkspaceWorkspacesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, QuantumWorkspaceData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + QuantumArmOperation operation = new QuantumArmOperation( + new QuantumWorkspaceOperationSource(Client), + _workspacesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -154,38 +175,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// Returns the Workspace resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Get + /// Operation Id. + /// Workspaces_Get. /// /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The name of the quantum workspace resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string workspaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Get"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Get"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -199,38 +224,42 @@ public virtual async Task> GetAsync(string wo /// Returns the Workspace resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The name of the quantum workspace resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string workspaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Get"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Get"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -244,50 +273,44 @@ public virtual Response Get(string workspaceName, Canc /// Gets the list of Workspaces within a resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces. /// /// - /// Operation Id - /// Workspaces_ListByResourceGroup + /// Operation Id. + /// Workspaces_ListByResourceGroup. /// /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _quantumWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _quantumWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), _quantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "QuantumWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new WorkspacesGetByResourceGroupAsyncCollectionResultOfT(_workspacesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new QuantumWorkspaceResource(Client, data)); } /// /// Gets the list of Workspaces within a resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces - /// - /// - /// Operation Id - /// Workspaces_ListByResourceGroup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_ListByResourceGroup. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// @@ -295,45 +318,61 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _quantumWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _quantumWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), _quantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "QuantumWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new WorkspacesGetByResourceGroupCollectionResultOfT(_workspacesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new QuantumWorkspaceResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The name of the quantum workspace resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string workspaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Exists"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Exists"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((QuantumWorkspaceData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -347,36 +386,50 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Get + /// Operation Id. + /// Workspaces_Get. /// /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The name of the quantum workspace resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string workspaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Exists"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.Exists"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((QuantumWorkspaceData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -390,38 +443,54 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Operation Id. + /// Workspaces_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The name of the quantum workspace resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string workspaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.GetIfExists"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.GetIfExists"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((QuantumWorkspaceData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -435,38 +504,54 @@ public virtual async Task> GetIfExist /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Get + /// Operation Id. + /// Workspaces_Get. /// /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-12-15-preview. /// /// /// /// The name of the quantum workspace resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string workspaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.GetIfExists"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceCollection.GetIfExists"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, workspaceName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((QuantumWorkspaceData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -486,6 +571,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.Serialization.cs index caf06fc6d562..092f9fbf4504 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.Serialization.cs @@ -10,16 +10,23 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Quantum.Models; namespace Azure.ResourceManager.Quantum { - public partial class QuantumWorkspaceData : IUtf8JsonSerializable, IJsonModel + /// The resource proxy definition object for Quantum Workspace. + public partial class QuantumWorkspaceData : TrackedResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal QuantumWorkspaceData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,241 +38,160 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumWorkspaceData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); ((IJsonModel)Identity).Write(writer, options); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Providers)) - { - writer.WritePropertyName("providers"u8); - writer.WriteStartArray(); - foreach (var item in Providers) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(Usable)) - { - writer.WritePropertyName("usable"u8); - writer.WriteStringValue(Usable.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(StorageAccount)) - { - writer.WritePropertyName("storageAccount"u8); - writer.WriteStringValue(StorageAccount); - } - if (options.Format != "W" && Optional.IsDefined(EndpointUri)) - { - writer.WritePropertyName("endpointUri"u8); - writer.WriteStringValue(EndpointUri.AbsoluteUri); - } - if (Optional.IsDefined(IsApiKeyEnabled)) - { - writer.WritePropertyName("apiKeyEnabled"u8); - writer.WriteBooleanValue(IsApiKeyEnabled.Value); - } - writer.WriteEndObject(); } - QuantumWorkspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + QuantumWorkspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (QuantumWorkspaceData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(QuantumWorkspaceData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeQuantumWorkspaceData(document.RootElement, options); } - internal static QuantumWorkspaceData DeserializeQuantumWorkspaceData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static QuantumWorkspaceData DeserializeQuantumWorkspaceData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IList providers = default; - WorkspaceUsableStatus? usable = default; - QuantumProvisioningStatus? provisioningState = default; - string storageAccount = default; - Uri endpointUri = default; - bool? apiKeyEnabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + QuantumWorkspaceProperties properties = default; + ManagedServiceIdentity identity = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerQuantumContext.Default); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; + name = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("type"u8)) { - location = new AzureLocation(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("systemData"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerQuantumContext.Default); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("tags"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("location"u8)) { - type = new ResourceType(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerQuantumContext.Default); + properties = QuantumWorkspaceProperties.DeserializeQuantumWorkspaceProperties(prop.Value, options); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("identity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("providers"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(QuantumProvider.DeserializeQuantumProvider(item, options)); - } - providers = array; - continue; - } - if (property0.NameEquals("usable"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - usable = new WorkspaceUsableStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new QuantumProvisioningStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("storageAccount"u8)) - { - storageAccount = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("endpointUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endpointUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("apiKeyEnabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - apiKeyEnabled = property0.Value.GetBoolean(); - continue; - } - } + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerQuantumContext.Default); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new QuantumWorkspaceData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, tags ?? new ChangeTrackingDictionary(), location, - identity, - providers ?? new ChangeTrackingList(), - usable, - provisioningState, - storageAccount, - endpointUri, - apiKeyEnabled, - serializedAdditionalRawData); + properties, + identity); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -275,15 +201,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - QuantumWorkspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + QuantumWorkspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (QuantumWorkspaceData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeQuantumWorkspaceData(document.RootElement, options); } default: @@ -291,6 +222,26 @@ QuantumWorkspaceData IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(QuantumWorkspaceData quantumWorkspaceData) + { + if (quantumWorkspaceData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(quantumWorkspaceData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static QuantumWorkspaceData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQuantumWorkspaceData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.cs index 3a93f0592e90..c17a6ec1fb69 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceData.cs @@ -13,96 +13,39 @@ namespace Azure.ResourceManager.Quantum { - /// - /// A class representing the QuantumWorkspace data model. - /// The resource proxy definition object for quantum workspace. - /// + /// The resource proxy definition object for Quantum Workspace. public partial class QuantumWorkspaceData : TrackedResourceData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The location. + /// The geo-location where the resource lives. public QuantumWorkspaceData(AzureLocation location) : base(location) { - Providers = new ChangeTrackingList(); } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Managed Identity information. Current supported identity types: SystemAssigned, None. - /// List of Providers selected for this Workspace. - /// Whether the current workspace is ready to accept Jobs. - /// Provisioning status field. - /// ARM Resource Id of the storage account associated with this workspace. - /// The URI of the workspace endpoint. - /// Indicator of enablement of the Quantum workspace Api keys. - /// Keeps track of any properties unknown to the library. - internal QuantumWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, IList providers, WorkspaceUsableStatus? usable, QuantumProvisioningStatus? provisioningState, string storageAccount, Uri endpointUri, bool? isApiKeyEnabled, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Resource tags. + /// The geo-location where the resource lives. + /// Gets or sets the properties. Define quantum workspace's specific properties. + /// The managed service identities assigned to this resource. + internal QuantumWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, QuantumWorkspaceProperties properties, ManagedServiceIdentity identity) : base(id, name, resourceType, systemData, tags, location) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; Identity = identity; - Providers = providers; - Usable = usable; - ProvisioningState = provisioningState; - StorageAccount = storageAccount; - EndpointUri = endpointUri; - IsApiKeyEnabled = isApiKeyEnabled; - _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal QuantumWorkspaceData() - { - } + /// Gets or sets the properties. Define quantum workspace's specific properties. + public QuantumWorkspaceProperties Properties { get; set; } - /// Managed Identity information. Current supported identity types: SystemAssigned, None. + /// The managed service identities assigned to this resource. public ManagedServiceIdentity Identity { get; set; } - /// List of Providers selected for this Workspace. - public IList Providers { get; } - /// Whether the current workspace is ready to accept Jobs. - public WorkspaceUsableStatus? Usable { get; } - /// Provisioning status field. - public QuantumProvisioningStatus? ProvisioningState { get; } - /// ARM Resource Id of the storage account associated with this workspace. - public string StorageAccount { get; set; } - /// The URI of the workspace endpoint. - public Uri EndpointUri { get; } - /// Indicator of enablement of the Quantum workspace Api keys. - public bool? IsApiKeyEnabled { get; set; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.Serialization.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.Serialization.cs index 966b6f4674df..dc6a5a1c7c7a 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.Serialization.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.Quantum { + /// public partial class QuantumWorkspaceResource : IJsonModel { - private static QuantumWorkspaceData s_dataDeserializationInstance; - private static QuantumWorkspaceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new QuantumWorkspaceData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - QuantumWorkspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + QuantumWorkspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerQuantumContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. QuantumWorkspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerQuantumContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.cs index 5888b4776d66..7c10470bf72d 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/QuantumWorkspaceResource.cs @@ -7,49 +7,37 @@ using System; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Quantum.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Quantum { /// - /// A Class representing a QuantumWorkspace along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetQuantumWorkspaceResource method. - /// Otherwise you can get one from its parent resource using the GetQuantumWorkspace method. + /// A class representing a QuantumWorkspace along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetQuantumWorkspaces method. /// public partial class QuantumWorkspaceResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The workspaceName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _quantumWorkspaceWorkspacesClientDiagnostics; - private readonly WorkspacesRestOperations _quantumWorkspaceWorkspacesRestClient; - private readonly ClientDiagnostics _workspaceClientDiagnostics; - private readonly WorkspaceRestOperations _workspaceRestClient; + private readonly ClientDiagnostics _workspacesClientDiagnostics; + private readonly Workspaces _workspacesRestClient; private readonly QuantumWorkspaceData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Quantum/workspaces"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of QuantumWorkspaceResource for mocking. protected QuantumWorkspaceResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal QuantumWorkspaceResource(ArmClient client, QuantumWorkspaceData data) : this(client, data.Id) @@ -58,73 +46,92 @@ internal QuantumWorkspaceResource(ArmClient client, QuantumWorkspaceData data) : _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal QuantumWorkspaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _quantumWorkspaceWorkspacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Quantum", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string quantumWorkspaceWorkspacesApiVersion); - _quantumWorkspaceWorkspacesRestClient = new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, quantumWorkspaceWorkspacesApiVersion); - _workspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Quantum", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _workspaceRestClient = new WorkspaceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string quantumWorkspaceApiVersion); + _workspacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Quantum", ResourceType.Namespace, Diagnostics); + _workspacesRestClient = new Workspaces(_workspacesClientDiagnostics, Pipeline, Endpoint, quantumWorkspaceApiVersion ?? "2025-12-15-preview"); + ValidateResourceId(id); } /// Gets whether or not the current instance has data. public virtual bool HasData { get; } /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. public virtual QuantumWorkspaceData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Returns the Workspace resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Get + /// Operation Id. + /// Workspaces_Get. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Get"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Get"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -138,33 +145,41 @@ public virtual async Task> GetAsync(Cancellat /// Returns the Workspace resource associated with the given name. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Get + /// Operation Id. + /// Workspaces_Get. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Get"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Get"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -175,39 +190,49 @@ public virtual Response Get(CancellationToken cancella } /// - /// Deletes a Workspace resource. + /// Updates an existing Workspace's tags. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Delete + /// Operation Id. + /// Workspaces_UpdateTags. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to update tags. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(QuantumWorkspacePatch patch, CancellationToken cancellationToken = default) { - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Delete"); + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Update"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new QuantumArmOperation(_quantumWorkspaceWorkspacesClientDiagnostics, Pipeline, _quantumWorkspaceWorkspacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateUpdateTagsRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, QuantumWorkspacePatch.ToRequestContent(patch), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -217,39 +242,49 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a Workspace resource. + /// Updates an existing Workspace's tags. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_Delete + /// Operation Id. + /// Workspaces_UpdateTags. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to update tags. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual Response Update(QuantumWorkspacePatch patch, CancellationToken cancellationToken = default) { - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Delete"); + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Update"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new QuantumArmOperation(_quantumWorkspaceWorkspacesClientDiagnostics, Pipeline, _quantumWorkspaceWorkspacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateUpdateTagsRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, QuantumWorkspacePatch.ToRequestContent(patch), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -259,39 +294,46 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates an existing workspace's tags. + /// Deletes a Workspace resource. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_UpdateTags + /// Operation Id. + /// Workspaces_Delete. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// Parameters supplied to update tags. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(QuantumWorkspacePatch patch, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Update"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Delete"); scope.Start(); try { - var response = await _quantumWorkspaceWorkspacesRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + QuantumArmOperation operation = new QuantumArmOperation(_workspacesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } + return operation; } catch (Exception e) { @@ -301,39 +343,46 @@ public virtual async Task> UpdateAsync(Quantu } /// - /// Updates an existing workspace's tags. + /// Deletes a Workspace resource. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}. /// /// - /// Operation Id - /// Workspaces_UpdateTags + /// Operation Id. + /// Workspaces_Delete. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// Parameters supplied to update tags. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - /// is null. - public virtual Response Update(QuantumWorkspacePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Update"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.Delete"); scope.Start(); try { - var response = _quantumWorkspaceWorkspacesRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + QuantumArmOperation operation = new QuantumArmOperation(_workspacesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletionResponse(cancellationToken); + } + return operation; } catch (Exception e) { @@ -346,27 +395,41 @@ public virtual Response Update(QuantumWorkspacePatch p /// Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/listKeys + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/listKeys. + /// + /// + /// Operation Id. + /// Workspaces_ListKeys. /// /// - /// Operation Id - /// Workspace_ListKeys + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetKeysWorkspaceAsync(CancellationToken cancellationToken = default) { - using var scope = _workspaceClientDiagnostics.CreateScope("QuantumWorkspaceResource.GetKeysWorkspace"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.GetKeysWorkspace"); scope.Start(); try { - var response = await _workspaceRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetKeysWorkspaceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(WorkspaceKeyListResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -380,27 +443,41 @@ public virtual async Task> GetKeysWorkspaceAsyn /// Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/listKeys + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/listKeys. /// /// - /// Operation Id - /// Workspace_ListKeys + /// Operation Id. + /// Workspaces_ListKeys. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Default Api Version. + /// 2025-12-15-preview. + /// + /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response GetKeysWorkspace(CancellationToken cancellationToken = default) { - using var scope = _workspaceClientDiagnostics.CreateScope("QuantumWorkspaceResource.GetKeysWorkspace"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.GetKeysWorkspace"); scope.Start(); try { - var response = _workspaceRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetKeysWorkspaceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(WorkspaceKeyListResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -414,16 +491,20 @@ public virtual Response GetKeysWorkspace(CancellationTok /// Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working immediately. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/regenerateKey + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/regenerateKey. + /// + /// + /// Operation Id. + /// Workspaces_RegenerateKeys. /// /// - /// Operation Id - /// Workspace_RegenerateKeys + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Resource. + /// . /// /// /// @@ -434,11 +515,16 @@ public virtual async Task RegenerateKeysWorkspaceAsync(WorkspaceApiKey { Argument.AssertNotNull(keySpecification, nameof(keySpecification)); - using var scope = _workspaceClientDiagnostics.CreateScope("QuantumWorkspaceResource.RegenerateKeysWorkspace"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.RegenerateKeysWorkspace"); scope.Start(); try { - var response = await _workspaceRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, keySpecification, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateRegenerateKeysWorkspaceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, WorkspaceApiKeys.ToRequestContent(keySpecification), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); return response; } catch (Exception e) @@ -452,16 +538,20 @@ public virtual async Task RegenerateKeysWorkspaceAsync(WorkspaceApiKey /// Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working immediately. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/regenerateKey + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/regenerateKey. + /// + /// + /// Operation Id. + /// Workspaces_RegenerateKeys. /// /// - /// Operation Id - /// Workspace_RegenerateKeys + /// Default Api Version. + /// 2025-12-15-preview. /// /// - /// Default Api Version - /// 2023-11-13-preview + /// Resource. + /// . /// /// /// @@ -472,11 +562,16 @@ public virtual Response RegenerateKeysWorkspace(WorkspaceApiKeys keySpecificatio { Argument.AssertNotNull(keySpecification, nameof(keySpecification)); - using var scope = _workspaceClientDiagnostics.CreateScope("QuantumWorkspaceResource.RegenerateKeysWorkspace"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.RegenerateKeysWorkspace"); scope.Start(); try { - var response = _workspaceRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, keySpecification, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateRegenerateKeysWorkspaceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, WorkspaceApiKeys.ToRequestContent(keySpecification), context); + Response response = Pipeline.ProcessMessage(message, context); return response; } catch (Exception e) @@ -486,27 +581,7 @@ public virtual Response RegenerateKeysWorkspace(WorkspaceApiKeys keySpecificatio } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -516,29 +591,35 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.AddTag"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.AddTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new QuantumWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new QuantumWorkspacePatch(); - foreach (var tag in current.Tags) + QuantumWorkspaceData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + QuantumWorkspacePatch patch = new QuantumWorkspacePatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + Response result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -548,27 +629,7 @@ public virtual async Task> AddTagAsync(string } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -578,29 +639,35 @@ public virtual Response AddTag(string key, string valu Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.AddTag"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.AddTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new QuantumWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new QuantumWorkspacePatch(); - foreach (var tag in current.Tags) + QuantumWorkspaceData current = Get(cancellationToken: cancellationToken).Value.Data; + QuantumWorkspacePatch patch = new QuantumWorkspacePatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; + Response result = Update(patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -610,54 +677,40 @@ public virtual Response AddTag(string key, string valu } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.SetTags"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.SetTags"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new QuantumWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new QuantumWorkspacePatch(); + QuantumWorkspaceData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + QuantumWorkspacePatch patch = new QuantumWorkspacePatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + Response result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -667,54 +720,40 @@ public virtual async Task> SetTagsAsync(IDict } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.SetTags"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.SetTags"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); + GetTagResource().Delete(WaitUntil.Completed, cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new QuantumWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new QuantumWorkspacePatch(); + QuantumWorkspaceData current = Get(cancellationToken: cancellationToken).Value.Data; + QuantumWorkspacePatch patch = new QuantumWorkspacePatch(); patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + Response result = Update(patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -724,27 +763,7 @@ public virtual Response SetTags(IDictionary - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -752,29 +771,35 @@ public virtual async Task> RemoveTagAsync(str { Argument.AssertNotNull(key, nameof(key)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.RemoveTag"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.RemoveTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _quantumWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new QuantumWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new QuantumWorkspacePatch(); - foreach (var tag in current.Tags) + QuantumWorkspaceData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + QuantumWorkspacePatch patch = new QuantumWorkspacePatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + Response result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -784,27 +809,7 @@ public virtual async Task> RemoveTagAsync(str } } - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} - /// - /// - /// Operation Id - /// Workspaces_Get - /// - /// - /// Default Api Version - /// 2023-11-13-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -812,29 +817,35 @@ public virtual Response RemoveTag(string key, Cancella { Argument.AssertNotNull(key, nameof(key)); - using var scope = _quantumWorkspaceWorkspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.RemoveTag"); + using DiagnosticScope scope = _workspacesClientDiagnostics.CreateScope("QuantumWorkspaceResource.RemoveTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _quantumWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new QuantumWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _workspacesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(QuantumWorkspaceData.FromResponse(result), result); + return Response.FromValue(new QuantumWorkspaceResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new QuantumWorkspacePatch(); - foreach (var tag in current.Tags) + QuantumWorkspaceData current = Get(cancellationToken: cancellationToken).Value.Data; + QuantumWorkspacePatch patch = new QuantumWorkspacePatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + Response result = Update(patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/OfferingsRestOperations.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/OfferingsRestOperations.cs index 14c80fde2dc6..d1d8e42af3b2 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/OfferingsRestOperations.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/OfferingsRestOperations.cs @@ -6,200 +6,73 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Quantum.Models; namespace Azure.ResourceManager.Quantum { - internal partial class OfferingsRestOperations + internal partial class Offerings { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of OfferingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public OfferingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of Offerings for mocking. + protected Offerings() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-13-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string locationName) + /// Initializes a new instance of Offerings. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal Offerings(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Quantum/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/offerings", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateListRequest(string subscriptionId, string locationName) + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetProviderOfferingsRequest(Guid subscriptionId, AzureLocation locationName, string filter, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.Quantum/locations/", false); - uri.AppendPath(locationName, true); + uri.AppendPath(locationName.ToString(), true); uri.AppendPath("/offerings", false); uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Returns the list of all provider offerings available for the given location. - /// The ID of the target subscription. The value must be an UUID. - /// Location. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - using var message = CreateListRequest(subscriptionId, locationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OfferingsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OfferingsListResult.DeserializeOfferingsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns the list of all provider offerings available for the given location. - /// The ID of the target subscription. The value must be an UUID. - /// Location. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - using var message = CreateListRequest(subscriptionId, locationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) + if (filter != null) { - case 200: - { - OfferingsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OfferingsListResult.DeserializeOfferingsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); + uri.AppendQuery("filter", filter, true); } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string locationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string locationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// Returns the list of all provider offerings available for the given location. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// Location. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, locationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OfferingsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OfferingsListResult.DeserializeOfferingsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns the list of all provider offerings available for the given location. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// Location. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string locationName, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetProviderOfferingsRequest(Uri nextPage, Guid subscriptionId, AzureLocation locationName, string filter, RequestContext context) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, locationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OfferingsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OfferingsListResult.DeserializeOfferingsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/SuiteOffersRestOperations.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/SuiteOffersRestOperations.cs new file mode 100644 index 000000000000..edca655aed7d --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/SuiteOffersRestOperations.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Quantum +{ + internal partial class SuiteOffers + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SuiteOffers for mocking. + protected SuiteOffers() + { + } + + /// Initializes a new instance of SuiteOffers. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal SuiteOffers(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetSuiteOfferRequest(Guid subscriptionId, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/providers/Microsoft.Quantum/suiteOffers", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetSuiteOfferRequest(Uri nextPage, Guid subscriptionId, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspaceRestOperations.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspaceRestOperations.cs deleted file mode 100644 index 9b032fdae915..000000000000 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspaceRestOperations.cs +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Quantum.Models; - -namespace Azure.ResourceManager.Quantum -{ - internal partial class WorkspaceRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of WorkspaceRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public WorkspaceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-13-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCheckNameAvailabilityRequestUri(string subscriptionId, string locationName, WorkspaceNameAvailabilityContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Quantum/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/checkNameAvailability", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, string locationName, WorkspaceNameAvailabilityContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Quantum/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/checkNameAvailability", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Check the availability of the resource name. - /// The ID of the target subscription. The value must be an UUID. - /// Location. - /// The name and type of the resource. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CheckNameAvailabilityAsync(string subscriptionId, string locationName, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCheckNameAvailabilityRequest(subscriptionId, locationName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceNameAvailabilityResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = WorkspaceNameAvailabilityResult.DeserializeWorkspaceNameAvailabilityResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Check the availability of the resource name. - /// The ID of the target subscription. The value must be an UUID. - /// Location. - /// The name and type of the resource. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response CheckNameAvailability(string subscriptionId, string locationName, WorkspaceNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCheckNameAvailabilityRequest(subscriptionId, locationName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceNameAvailabilityResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = WorkspaceNameAvailabilityResult.DeserializeWorkspaceNameAvailabilityResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/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("/listKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/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("/listKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - - using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceKeyListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = WorkspaceKeyListResult.DeserializeWorkspaceKeyListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListKeys(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - - using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceKeyListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = WorkspaceKeyListResult.DeserializeWorkspaceKeyListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, WorkspaceApiKeys keySpecification) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/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("/regenerateKey", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, WorkspaceApiKeys keySpecification) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/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("/regenerateKey", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(keySpecification, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working immediately. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// Which key to regenerate: primary or secondary. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, WorkspaceApiKeys keySpecification, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNull(keySpecification, nameof(keySpecification)); - - using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, keySpecification); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working immediately. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// Which key to regenerate: primary or secondary. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string workspaceName, WorkspaceApiKeys keySpecification, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNull(keySpecification, nameof(keySpecification)); - - using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, keySpecification); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspacesRestOperations.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspacesRestOperations.cs index 371a91cdb788..4e90202677f3 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspacesRestOperations.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/RestOperations/WorkspacesRestOperations.cs @@ -6,728 +6,237 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Quantum.Models; namespace Azure.ResourceManager.Quantum { - internal partial class WorkspacesRestOperations + internal partial class Workspaces { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of WorkspacesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public WorkspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of Workspaces for mocking. + protected Workspaces() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-13-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + /// Initializes a new instance of Workspaces. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal Workspaces(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/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.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName) + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateCheckWorkspaceNameAvailabilityRequest(Guid subscriptionId, AzureLocation location, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/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(subscriptionId.ToString(), true); + uri.AppendPath("/providers/Microsoft.Quantum/locations/", false); + uri.AppendPath(location.ToString(), true); + uri.AppendPath("/checkNameAvailability", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Post; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - /// Returns the Workspace resource associated with the given name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string workspaceName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - QuantumWorkspaceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = QuantumWorkspaceData.DeserializeQuantumWorkspaceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((QuantumWorkspaceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns the Workspace resource associated with the given name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - QuantumWorkspaceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = QuantumWorkspaceData.DeserializeQuantumWorkspaceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((QuantumWorkspaceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspaceData data) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); uri.AppendPath(workspaceName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspaceData data) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string workspaceName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); uri.AppendPath(workspaceName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Creates or updates a workspace resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// Workspace details. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspaceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a workspace resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// Workspace details. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspaceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspacePatch patch) + internal HttpMessage CreateUpdateTagsRequest(Guid subscriptionId, string resourceGroupName, string workspaceName, RequestContent content, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/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.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspacePatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); uri.AppendPath(workspaceName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Method = RequestMethod.Patch; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Updates an existing workspace's tags. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// Parameters supplied to update tags. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateTagsAsync(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspacePatch patch, CancellationToken cancellationToken = default) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string workspaceName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, workspaceName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - QuantumWorkspaceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = QuantumWorkspaceData.DeserializeQuantumWorkspaceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates an existing workspace's tags. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// Parameters supplied to update tags. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateTags(string subscriptionId, string resourceGroupName, string workspaceName, QuantumWorkspacePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, workspaceName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - QuantumWorkspaceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = QuantumWorkspaceData.DeserializeQuantumWorkspaceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); uri.AppendPath(workspaceName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName) + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); - uri.AppendPath(workspaceName, true); + uri.AppendPath("/providers/Microsoft.Quantum/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// Deletes a Workspace resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a Workspace resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the quantum workspace resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal HttpMessage CreateNextGetByResourceGroupRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, RequestContext context) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Quantum/workspaces", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateGetBySubscriptionRequest(Guid subscriptionId, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.Quantum/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// Gets the list of Workspaces within a Subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetBySubscriptionRequest(Uri nextPage, Guid subscriptionId, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of Workspaces within a Subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateGetKeysWorkspaceRequest(Guid subscriptionId, string resourceGroupName, string workspaceName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Quantum/workspaces", false); + uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Post; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateRegenerateKeysWorkspaceRequest(Guid subscriptionId, string resourceGroupName, string workspaceName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Quantum/workspaces", false); + uri.AppendPath("/providers/Microsoft.Quantum/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/regenerateKey", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of Workspaces within a resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of Workspaces within a resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of Workspaces within a Subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of Workspaces within a Subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Post; + request.Headers.SetValue("Content-Type", "application/json"); + request.Content = content; return message; } - - /// Gets the list of Workspaces within a resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of Workspaces within a resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/autorest.md b/sdk/quantum/Azure.ResourceManager.Quantum/src/autorest.md.bak similarity index 100% rename from sdk/quantum/Azure.ResourceManager.Quantum/src/autorest.md rename to sdk/quantum/Azure.ResourceManager.Quantum/src/autorest.md.bak diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_QuantumWorkspaceCollection.cs b/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_QuantumWorkspaceCollection.cs index 99f7972063d6..f4e4430e0cb5 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_QuantumWorkspaceCollection.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_QuantumWorkspaceCollection.cs @@ -43,20 +43,28 @@ public async Task CreateOrUpdate_QuantumWorkspacesPut() string workspaceName = "quantumworkspace1"; QuantumWorkspaceData data = new QuantumWorkspaceData(new AzureLocation("West US")) { - Providers = {new QuantumProvider -{ -ProviderId = "Honeywell", -ProviderSku = "Basic", -}, new QuantumProvider -{ -ProviderId = "IonQ", -ProviderSku = "Basic", -}, new QuantumProvider -{ -ProviderId = "OneQBit", -ProviderSku = "Basic", -}}, - StorageAccount = "/subscriptions/1C4B2828-7D49-494F-933D-061373BE28C2/resourceGroups/quantumResourcegroup/providers/Microsoft.Storage/storageAccounts/testStorageAccount", + Properties = new QuantumWorkspaceProperties + { + Providers = + { + new QuantumProvider + { + ProviderId = "Honeywell", + ProviderSku = "Basic", + }, + new QuantumProvider + { + ProviderId = "IonQ", + ProviderSku = "Basic", + }, + new QuantumProvider + { + ProviderId = "OneQBit", + ProviderSku = "Basic", + } + }, + StorageAccount = new ResourceIdentifier("/subscriptions/1C4B2828-7D49-494F-933D-061373BE28C2/resourceGroups/quantumResourcegroup/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), + } }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workspaceName, data); QuantumWorkspaceResource result = lro.Value; diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index efd438c32261..5c0b7ed45536 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -68,7 +68,7 @@ public async Task GetOfferings_OfferingsList() // invoke the operation and iterate over the result string locationName = "westus2"; - await foreach (QuantumProviderDescription item in subscriptionResource.GetOfferingsAsync(locationName)) + await foreach (QuantumProviderOffer item in subscriptionResource.GetProviderOfferingsAsync(new AzureLocation(locationName))) { Console.WriteLine($"Succeeded: {item}"); } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/tsp-location.yaml b/sdk/quantum/Azure.ResourceManager.Quantum/tsp-location.yaml new file mode 100644 index 000000000000..12ce03adbfc7 --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/quantum/Microsoft.Quantum.Management +commit: 0aff52cb5343fe4f6f7fdf3036939a05aaf48eb4 +repo: Azure/azure-rest-api-specs +emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json" diff --git a/sdk/quantum/cspell.yaml b/sdk/quantum/cspell.yaml new file mode 100644 index 000000000000..c228dcbbb34d --- /dev/null +++ b/sdk/quantum/cspell.yaml @@ -0,0 +1,7 @@ +import: + - ../../.vscode/cspell.json +overrides: + - filename: '**/sdk/quantum/**/*.cs' + words: + - Mobo + - Qubits \ No newline at end of file