diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net10.0.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net10.0.cs new file mode 100644 index 000000000000..88b7e26e1e50 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net10.0.cs @@ -0,0 +1,1496 @@ +namespace Azure.ResourceManager.ComputeSchedule +{ + public partial class AzureResourceManagerComputeScheduleContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerComputeScheduleContext() { } + public static Azure.ResourceManager.ComputeSchedule.AzureResourceManagerComputeScheduleContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public static partial class ComputeScheduleExtensions + { + public static Azure.Response CancelVirtualMachineOperations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response CancelVirtualMachineOperations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CancelVirtualMachineOperationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> CancelVirtualMachineOperationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response ExecuteVirtualMachineCreateOperation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ExecuteVirtualMachineCreateOperationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response ExecuteVirtualMachineDeallocate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response ExecuteVirtualMachineDeallocate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ExecuteVirtualMachineDeallocateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> ExecuteVirtualMachineDeallocateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response ExecuteVirtualMachineDeleteOperation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ExecuteVirtualMachineDeleteOperationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response ExecuteVirtualMachineHibernate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response ExecuteVirtualMachineHibernate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ExecuteVirtualMachineHibernateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> ExecuteVirtualMachineHibernateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response ExecuteVirtualMachineStart(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response ExecuteVirtualMachineStart(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ExecuteVirtualMachineStartAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> ExecuteVirtualMachineStartAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAssociatedOccurrences(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAssociatedOccurrencesAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAssociatedScheduledActions(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAssociatedScheduledActionsAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAttachedResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAttachedResourcesAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetScheduledAction(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetScheduledActionAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.ScheduledActionResource GetScheduledActionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.ScheduledActionCollection GetScheduledActions(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetScheduledActions(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetScheduledActionsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetVirtualMachineOperationErrors(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response GetVirtualMachineOperationErrors(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetVirtualMachineOperationErrorsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> GetVirtualMachineOperationErrorsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetVirtualMachineOperationStatus(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response GetVirtualMachineOperationStatus(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetVirtualMachineOperationStatusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> GetVirtualMachineOperationStatusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response SubmitVirtualMachineDeallocate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response SubmitVirtualMachineDeallocate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> SubmitVirtualMachineDeallocateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> SubmitVirtualMachineDeallocateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response SubmitVirtualMachineHibernate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response SubmitVirtualMachineHibernate(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> SubmitVirtualMachineHibernateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> SubmitVirtualMachineHibernateAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response SubmitVirtualMachineStart(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Response SubmitVirtualMachineStart(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> SubmitVirtualMachineStartAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static System.Threading.Tasks.Task> SubmitVirtualMachineStartAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ScheduledActionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ScheduledActionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string scheduledActionName, Azure.ResourceManager.ComputeSchedule.ScheduledActionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string scheduledActionName, Azure.ResourceManager.ComputeSchedule.ScheduledActionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ScheduledActionData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.ScheduledActionData 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.ComputeSchedule.ScheduledActionData 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 ScheduledActionOccurrenceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ScheduledActionOccurrenceCollection() { } + public virtual Azure.Response Exists(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ScheduledActionOccurrenceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ScheduledActionOccurrenceData() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.ScheduledActionOccurrenceData 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.ComputeSchedule.ScheduledActionOccurrenceData 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 ScheduledActionOccurrenceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ScheduledActionOccurrenceResource() { } + public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response Cancel(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelAsync(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delay(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DelayAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData 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.ComputeSchedule.ScheduledActionOccurrenceData 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 ScheduledActionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ScheduledActionResource() { } + public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AttachResources(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AttachResourcesAsync(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CancelNextOccurrence(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelNextOccurrenceAsync(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scheduledActionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DetachResources(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DetachResourcesAsync(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Enable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task EnableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAttachedResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAttachedResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetScheduledActionOccurrence(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetScheduledActionOccurrenceAsync(string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceCollection GetScheduledActionOccurrences() { throw null; } + public virtual Azure.Response PatchResources(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PatchResourcesAsync(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ComputeSchedule.ScheduledActionData 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.ComputeSchedule.ScheduledActionData 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 virtual Azure.Response TriggerManualOccurrence(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TriggerManualOccurrenceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ComputeSchedule.Mocking +{ + public partial class MockableComputeScheduleArmClient : Azure.ResourceManager.ArmResource + { + protected MockableComputeScheduleArmClient() { } + public virtual Azure.Pageable GetAssociatedOccurrences(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAssociatedOccurrencesAsync(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAssociatedScheduledActions(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAssociatedScheduledActionsAsync(Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionResource GetScheduledActionResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableComputeScheduleResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableComputeScheduleResourceGroupResource() { } + public virtual Azure.Pageable GetAttachedResources(string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAttachedResourcesAsync(string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetScheduledAction(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetScheduledActionAsync(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionCollection GetScheduledActions() { throw null; } + } + public partial class MockableComputeScheduleSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableComputeScheduleSubscriptionResource() { } + public virtual Azure.Response CancelVirtualMachineOperations(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response CancelVirtualMachineOperations(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelVirtualMachineOperationsAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> CancelVirtualMachineOperationsAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ExecuteVirtualMachineCreateOperation(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineCreateOperationAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ExecuteVirtualMachineDeallocate(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response ExecuteVirtualMachineDeallocate(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineDeallocateAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineDeallocateAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ExecuteVirtualMachineDeleteOperation(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineDeleteOperationAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ExecuteVirtualMachineHibernate(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response ExecuteVirtualMachineHibernate(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineHibernateAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineHibernateAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ExecuteVirtualMachineStart(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response ExecuteVirtualMachineStart(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineStartAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> ExecuteVirtualMachineStartAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetScheduledActions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetScheduledActionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetVirtualMachineOperationErrors(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response GetVirtualMachineOperationErrors(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetVirtualMachineOperationErrorsAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> GetVirtualMachineOperationErrorsAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetVirtualMachineOperationStatus(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response GetVirtualMachineOperationStatus(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetVirtualMachineOperationStatusAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> GetVirtualMachineOperationStatusAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SubmitVirtualMachineDeallocate(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response SubmitVirtualMachineDeallocate(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SubmitVirtualMachineDeallocateAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> SubmitVirtualMachineDeallocateAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SubmitVirtualMachineHibernate(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response SubmitVirtualMachineHibernate(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SubmitVirtualMachineHibernateAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> SubmitVirtualMachineHibernateAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SubmitVirtualMachineStart(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Response SubmitVirtualMachineStart(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SubmitVirtualMachineStartAsync(Azure.Core.AzureLocation locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual System.Threading.Tasks.Task> SubmitVirtualMachineStartAsync(string locationparameter, Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + public static partial class ArmComputeScheduleModelFactory + { + public static Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult CancelOperationsResult(System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.CreateResourceOperationResult CreateResourceOperationResult(string description = null, string type = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult DeallocateResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.DeleteResourceOperationResult DeleteResourceOperationResult(string description = null, string type = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent ExecuteCreateContent(Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload resourceConfigParameters = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent ExecuteDeleteContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null, bool? isForceDeletion = default(bool?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo FallbackOperationInfo(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType lastOpType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType), string status = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError error = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult GetOperationErrorsResult(System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult GetOperationStatusResult(System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult HibernateResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent OccurrenceCancelContent(System.Collections.Generic.IEnumerable resourceIds = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent OccurrenceDelayContent(System.DateTimeOffset delay = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable resourceIds = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties OccurrenceExtensionProperties(Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null, Azure.Core.ResourceIdentifier scheduledActionId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionResourceData OccurrenceExtensionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData OccurrenceResourceData(string name = null, Azure.Core.ResourceIdentifier id = null, string type = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary OccurrenceResultSummary(int total = 0, System.Collections.Generic.IEnumerable statuses = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails OperationErrorDetails(string errorCode = null, string errorDetails = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.DateTimeOffset? errorDetailsTimestamp = default(System.DateTimeOffset?), string azureOperationName = null, string crpOperationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult OperationErrorsResult(string operationId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? activationOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable operationErrors = null, string requestErrorCode = null, string requestErrorDetails = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId = null, Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType?), string subscriptionId = null, System.DateTimeOffset? deadline = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState?), string timezone = null, string operationTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError = null, Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo fallbackOperationInfo = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId, Azure.Core.ResourceIdentifier resourceId, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType, string subscriptionId, System.DateTimeOffset? deadline, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state, string timezone, string operationTimezone, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError, System.DateTimeOffset? completedOn, Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError ResourceOperationError(string errorCode = null, string errorDetails = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult ResourceOperationResult(Azure.Core.ResourceIdentifier resourceId = null, string errorCode = null, string errorDetails = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails operation = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload ResourceProvisionPayload(System.Collections.Generic.IDictionary baseProfile = null, System.Collections.Generic.IEnumerable> resourceOverrides = null, int resourceCount = 0, string resourcePrefix = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceResultSummary ResourceResultSummary(string code = null, int count = 0, Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.ScheduledActionData ScheduledActionData(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.ComputeSchedule.Models.ScheduledActionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData ScheduledActionOccurrenceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties ScheduledActionOccurrenceProperties(System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary resultSummary = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch ScheduledActionPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties ScheduledActionPatchProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties ScheduledActionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent ScheduledActionResourceAttachContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData ScheduledActionResourceData(string name = null, Azure.Core.ResourceIdentifier id = null, string type = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent ScheduledActionResourceDetachContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationResult ScheduledActionResourceOperationResult(int totalResources = 0, System.Collections.Generic.IEnumerable resourcesStatuses = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent ScheduledActionResourcePatchContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResources ScheduledActionResources(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceStatus ScheduledActionResourceStatus(Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus status = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus), Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties ScheduledActionsExtensionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState?), System.Collections.Generic.IEnumerable resourceNotificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule ScheduledActionsSchedule(System.TimeSpan scheduledTime = default(System.TimeSpan), string timeZone = null, System.Collections.Generic.IEnumerable requestedWeekDays = null, System.Collections.Generic.IEnumerable requestedMonths = null, System.Collections.Generic.IEnumerable requestedDaysOfTheMonth = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult StartResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources UserRequestResources(System.Collections.Generic.IEnumerable ids = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule UserRequestSchedule(System.DateTimeOffset? deadline = default(System.DateTimeOffset?), System.DateTimeOffset? userRequestDeadline = default(System.DateTimeOffset?), string timezone = null, string userRequestTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType)) { throw null; } + } + public partial class CancelOperationsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } + public string CorrelationId { get { throw null; } } + public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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 CancelOperationsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CancelOperationsResult() { } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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 CreateResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CreateResourceOperationResult() { } + public string Description { get { throw null; } } + public Azure.Core.AzureLocation Location { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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 DeallocateResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeallocateResourceOperationResult() { } + public string Description { get { throw null; } } + public Azure.Core.AzureLocation Location { get { throw null; } } + public string ResourceType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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 DeleteResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeleteResourceOperationResult() { } + public string Description { get { throw null; } } + public Azure.Core.AzureLocation Location { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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 ExecuteCreateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExecuteCreateContent(Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload resourceConfigParameters, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters) { } + public string CorrelationId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload ResourceConfigParameters { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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 ExecuteDeallocateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources, string correlationId) { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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 ExecuteDeleteContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExecuteDeleteContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources) { } + public string CorrelationId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public bool? IsForceDeletion { get { throw null; } set { } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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 ExecuteHibernateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources, string correlationId) { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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 ExecuteStartContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources, string correlationId) { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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 FallbackOperationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FallbackOperationInfo() { } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError Error { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType LastOpType { get { throw null; } } + public string Status { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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 GetOperationErrorsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds) { } + public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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 GetOperationErrorsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal GetOperationErrorsResult() { } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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 GetOperationStatusContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } + public string CorrelationId { get { throw null; } } + public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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 GetOperationStatusResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal GetOperationStatusResult() { } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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 HibernateResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HibernateResourceOperationResult() { } + public string Description { get { throw null; } } + public Azure.Core.AzureLocation Location { get { throw null; } } + public string ResourceType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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 NotificationLanguage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NotificationLanguage(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage EnUs { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage left, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage left, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NotificationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NotificationSettings(string destination, Azure.ResourceManager.ComputeSchedule.Models.NotificationType type, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage language) { } + public string Destination { get { throw null; } set { } } + public bool? IsDisabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage Language { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.NotificationType Type { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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 NotificationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NotificationType(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.NotificationType Email { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.NotificationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.NotificationType left, Azure.ResourceManager.ComputeSchedule.Models.NotificationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.NotificationType left, Azure.ResourceManager.ComputeSchedule.Models.NotificationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OccurrenceCancelContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OccurrenceCancelContent(System.Collections.Generic.IEnumerable resourceIds) { } + public System.Collections.Generic.IList ResourceIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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 OccurrenceDelayContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OccurrenceDelayContent(System.DateTimeOffset delay, System.Collections.Generic.IEnumerable resourceIds) { } + public System.DateTimeOffset Delay { get { throw null; } } + public System.Collections.Generic.IList ResourceIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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 OccurrenceExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OccurrenceExtensionProperties() { } + public Azure.ResponseError ErrorDetails { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + public Azure.Core.ResourceIdentifier ScheduledActionId { get { throw null; } } + public System.DateTimeOffset ScheduledOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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 OccurrenceExtensionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OccurrenceExtensionResourceData() { } + public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionResourceData 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.ComputeSchedule.Models.OccurrenceExtensionResourceData 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 OccurrenceResourceData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OccurrenceResourceData() { } + public Azure.ResponseError ErrorDetails { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + public System.DateTimeOffset ScheduledOn { get { throw null; } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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 OccurrenceResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OccurrenceResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OccurrenceResultSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OccurrenceResultSummary() { } + public System.Collections.Generic.IList Statuses { get { throw null; } } + public int Total { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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 OperationErrorDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationErrorDetails() { } + public string AzureOperationName { get { throw null; } } + public string CrpOperationId { get { throw null; } } + public string ErrorCode { get { throw null; } } + public string ErrorDetails { get { throw null; } } + public System.DateTimeOffset? ErrorDetailsTimestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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 OperationErrorsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationErrorsResult() { } + public System.DateTimeOffset? ActivationOn { get { throw null; } } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OperationErrors { get { throw null; } } + public string OperationId { get { throw null; } } + public string RequestErrorCode { get { throw null; } } + public string RequestErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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 ResourceOperationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceOperationDetails() { } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public System.DateTimeOffset? Deadline { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? DeadlineType { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo FallbackOperationInfo { get { throw null; } } + public string OperationId { get { throw null; } } + public string OperationTimezone { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? OpType { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError ResourceOperationError { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy RetryPolicy { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? State { get { throw null; } } + public string SubscriptionId { get { throw null; } } + public string Timezone { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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 ResourceOperationError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceOperationError() { } + public string ErrorCode { get { throw null; } } + public string ErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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 ResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceOperationResult() { } + public string ErrorCode { get { throw null; } } + public string ErrorDetails { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails Operation { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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 ResourceOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceOperationType(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType Deallocate { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType Hibernate { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType Start { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType left, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType left, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ResourceProvisionPayload : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceProvisionPayload(int resourceCount) { } + public System.Collections.Generic.IDictionary BaseProfile { get { throw null; } } + public int ResourceCount { get { throw null; } } + public System.Collections.Generic.IList> ResourceOverrides { get { throw null; } } + public string ResourcePrefix { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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 ResourceResultSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceResultSummary() { } + public string Code { get { throw null; } } + public int Count { get { throw null; } } + public Azure.ResponseError ErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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 ScheduledActionDeadlineType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionDeadlineType(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType CompleteBy { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType InitiateAt { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ScheduledActionExecutionParameterDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionExecutionParameterDetail() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? OptimizationPreference { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy RetryPolicy { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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 ScheduledActionOccurrenceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ScheduledActionOccurrenceProperties() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary ResultSummary { get { throw null; } } + public System.DateTimeOffset ScheduledOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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 ScheduledActionOccurrenceState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionOccurrenceState(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Canceled { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Cancelling { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Created { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Rescheduling { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Scheduled { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ScheduledActionOperationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionOperationState(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Blocked { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Cancelled { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Executing { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState PendingExecution { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState PendingScheduling { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Scheduled { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ScheduledActionOptimizationPreference : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionOptimizationPreference(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference Availability { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference Cost { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference CostAvailabilityBalanced { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ScheduledActionPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionPatch() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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 ScheduledActionPatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionPatchProperties() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? ActionType { get { throw null; } set { } } + public bool? Disabled { get { throw null; } set { } } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? ResourceType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } set { } } + public System.DateTimeOffset? StartOn { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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 ScheduledActionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType, System.DateTimeOffset startOn, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule, System.Collections.Generic.IEnumerable notificationSettings) { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType ActionType { get { throw null; } set { } } + public bool? Disabled { get { throw null; } set { } } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType ResourceType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } set { } } + public System.DateTimeOffset StartOn { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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 ScheduledActionResourceAttachContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionResourceAttachContent(System.Collections.Generic.IEnumerable resources) { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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 ScheduledActionResourceData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionResourceData(Azure.Core.ResourceIdentifier resourceId) { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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 ScheduledActionResourceDetachContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionResourceDetachContent(System.Collections.Generic.IEnumerable resources) { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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 ScheduledActionResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ScheduledActionResourceOperationResult() { } + public System.Collections.Generic.IList ResourcesStatuses { get { throw null; } } + public int TotalResources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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 ScheduledActionResourceOperationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionResourceOperationStatus(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ScheduledActionResourcePatchContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionResourcePatchContent(System.Collections.Generic.IEnumerable resources) { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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 ScheduledActionResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ScheduledActionResources : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ScheduledActionResources() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionResources 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.ComputeSchedule.Models.ScheduledActionResources 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 ScheduledActionResourceStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ScheduledActionResourceStatus() { } + public Azure.ResponseError Error { get { throw null; } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus Status { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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 ScheduledActionResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionResourceType(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType VirtualMachine { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType VirtualMachineScaleSet { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ScheduledActionsExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ScheduledActionsExtensionProperties() { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType ActionType { get { throw null; } } + public bool? Disabled { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ResourceNotificationSettings { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType ResourceType { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } } + public System.DateTimeOffset StartOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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 ScheduledActionsSchedule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledActionsSchedule(System.TimeSpan scheduledTime, string timeZone, System.Collections.Generic.IEnumerable requestedWeekDays, System.Collections.Generic.IEnumerable requestedMonths, System.Collections.Generic.IEnumerable requestedDaysOfTheMonth) { } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? DeadlineType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } set { } } + public System.Collections.Generic.IList RequestedDaysOfTheMonth { get { throw null; } } + public System.Collections.Generic.IList RequestedMonths { get { throw null; } } + public System.Collections.Generic.IList RequestedWeekDays { get { throw null; } } + public System.TimeSpan ScheduledTime { get { throw null; } set { } } + public string TimeZone { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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 ScheduledActionsScheduleMonth : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionsScheduleMonth(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth All { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth April { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth August { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth December { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth February { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth January { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth July { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth June { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth March { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth May { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth November { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth October { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth September { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ScheduledActionsScheduleWeekDay : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionsScheduleWeekDay(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay All { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Friday { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Monday { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Saturday { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Sunday { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Thursday { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Tuesday { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay Wednesday { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ScheduledActionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScheduledActionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType Deallocate { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType Hibernate { get { throw null; } } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType Start { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class StartResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StartResourceOperationResult() { } + public string Description { get { throw null; } } + public Azure.Core.AzureLocation Location { get { throw null; } } + public string ResourceType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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 SubmitDeallocateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources, string correlationId) { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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 SubmitHibernateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources, string correlationId) { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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 SubmitStartContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters, Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources resources, string correlationId) { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } + public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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 UserRequestResources : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserRequestResources(System.Collections.Generic.IEnumerable ids) { } + public System.Collections.Generic.IList Ids { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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 UserRequestRetryPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserRequestRetryPolicy() { } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? OnFailureAction { get { throw null; } set { } } + public int? RetryCount { get { throw null; } set { } } + public int? RetryWindowInMinutes { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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 UserRequestSchedule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserRequestSchedule(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType deadlineType) { } + public System.DateTimeOffset? Deadline { get { throw null; } set { } } + public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType DeadlineType { get { throw null; } } + public string Timezone { get { throw null; } set { } } + public System.DateTimeOffset? UserRequestDeadline { get { throw null; } set { } } + public string UserRequestTimezone { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net8.0.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net8.0.cs index 1da10c510f0d..88b7e26e1e50 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net8.0.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.net8.0.cs @@ -40,6 +40,8 @@ public static partial class ComputeScheduleExtensions public static Azure.AsyncPageable GetAssociatedOccurrencesAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetAssociatedScheduledActions(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetAssociatedScheduledActionsAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAttachedResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAttachedResourcesAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetScheduledAction(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetScheduledActionAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -99,7 +101,10 @@ public partial class ScheduledActionData : Azure.ResourceManager.Models.TrackedR { public ScheduledActionData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.ScheduledActionData 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.ComputeSchedule.ScheduledActionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -125,7 +130,10 @@ public partial class ScheduledActionOccurrenceData : Azure.ResourceManager.Model { internal ScheduledActionOccurrenceData() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.ScheduledActionOccurrenceData 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.ComputeSchedule.ScheduledActionOccurrenceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -145,8 +153,6 @@ protected ScheduledActionOccurrenceResource() { } public virtual System.Threading.Tasks.Task> DelayAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAttachedResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAttachedResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData 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.ComputeSchedule.ScheduledActionOccurrenceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -213,6 +219,8 @@ protected MockableComputeScheduleArmClient() { } public partial class MockableComputeScheduleResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableComputeScheduleResourceGroupResource() { } + public virtual Azure.Pageable GetAttachedResources(string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAttachedResourcesAsync(string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetScheduledAction(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetScheduledActionAsync(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionCollection GetScheduledActions() { throw null; } @@ -286,22 +294,32 @@ namespace Azure.ResourceManager.ComputeSchedule.Models { public static partial class ArmComputeScheduleModelFactory { + public static Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds = null, string correlationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult CancelOperationsResult(System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.CreateResourceOperationResult CreateResourceOperationResult(string description = null, string type = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult DeallocateResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.DeleteResourceOperationResult DeleteResourceOperationResult(string description = null, string type = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent ExecuteCreateContent(Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload resourceConfigParameters = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent ExecuteDeleteContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null, bool? isForceDeletion = default(bool?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo FallbackOperationInfo(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType lastOpType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType), string status = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError error = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult GetOperationErrorsResult(System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds = null, string correlationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult GetOperationStatusResult(System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult HibernateResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent OccurrenceCancelContent(System.Collections.Generic.IEnumerable resourceIds = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent OccurrenceDelayContent(System.DateTimeOffset delay = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable resourceIds = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties OccurrenceExtensionProperties(Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null, Azure.Core.ResourceIdentifier scheduledActionId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionResourceData OccurrenceExtensionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties properties = null) { throw null; } - public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData OccurrenceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData OccurrenceResourceData(string name = null, Azure.Core.ResourceIdentifier id = null, string type = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary OccurrenceResultSummary(int total = 0, System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails OperationErrorDetails(string errorCode = null, string errorDetails = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.DateTimeOffset? errorDetailsTimestamp = default(System.DateTimeOffset?), string azureOperationName = null, string crpOperationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult OperationErrorsResult(string operationId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? activationOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable operationErrors = null, string requestErrorCode = null, string requestErrorDetails = null) { throw null; } - public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId = null, Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType?), string subscriptionId = null, System.DateTimeOffset? deadline = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState?), string timezone = null, string operationTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId = null, Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType?), string subscriptionId = null, System.DateTimeOffset? deadline = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState?), string timezone = null, string operationTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError = null, Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo fallbackOperationInfo = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId, Azure.Core.ResourceIdentifier resourceId, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType, string subscriptionId, System.DateTimeOffset? deadline, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state, string timezone, string operationTimezone, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError, System.DateTimeOffset? completedOn, Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError ResourceOperationError(string errorCode = null, string errorDetails = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult ResourceOperationResult(Azure.Core.ResourceIdentifier resourceId = null, string errorCode = null, string errorDetails = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails operation = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload ResourceProvisionPayload(System.Collections.Generic.IDictionary baseProfile = null, System.Collections.Generic.IEnumerable> resourceOverrides = null, int resourceCount = 0, string resourcePrefix = null) { throw null; } @@ -309,13 +327,23 @@ public static partial class ArmComputeScheduleModelFactory public static Azure.ResourceManager.ComputeSchedule.ScheduledActionData ScheduledActionData(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.ComputeSchedule.Models.ScheduledActionProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData ScheduledActionOccurrenceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties ScheduledActionOccurrenceProperties(System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary resultSummary = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch ScheduledActionPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties ScheduledActionPatchProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?)) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties ScheduledActionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData ScheduledActionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent ScheduledActionResourceAttachContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData ScheduledActionResourceData(string name = null, Azure.Core.ResourceIdentifier id = null, string type = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent ScheduledActionResourceDetachContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationResult ScheduledActionResourceOperationResult(int totalResources = 0, System.Collections.Generic.IEnumerable resourcesStatuses = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent ScheduledActionResourcePatchContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResources ScheduledActionResources(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceStatus ScheduledActionResourceStatus(Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus status = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties ScheduledActionsExtensionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState?), System.Collections.Generic.IEnumerable resourceNotificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule ScheduledActionsSchedule(System.TimeSpan scheduledTime = default(System.TimeSpan), string timeZone = null, System.Collections.Generic.IEnumerable requestedWeekDays = null, System.Collections.Generic.IEnumerable requestedMonths = null, System.Collections.Generic.IEnumerable requestedDaysOfTheMonth = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?)) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult StartResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources UserRequestResources(System.Collections.Generic.IEnumerable ids = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule UserRequestSchedule(System.DateTimeOffset? deadline = default(System.DateTimeOffset?), System.DateTimeOffset? userRequestDeadline = default(System.DateTimeOffset?), string timezone = null, string userRequestTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType)) { throw null; } } public partial class CancelOperationsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -323,7 +351,10 @@ public partial class CancelOperationsContent : System.ClientModel.Primitives.IJs public CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } public string CorrelationId { get { throw null; } } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -334,7 +365,10 @@ public partial class CancelOperationsResult : System.ClientModel.Primitives.IJso { internal CancelOperationsResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -348,7 +382,10 @@ internal CreateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -362,7 +399,10 @@ internal DeallocateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -376,7 +416,10 @@ internal DeleteResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -389,7 +432,10 @@ public ExecuteCreateContent(Azure.ResourceManager.ComputeSchedule.Models.Resourc public string CorrelationId { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload ResourceConfigParameters { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -402,7 +448,10 @@ public ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.Sch public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -416,7 +465,10 @@ public ExecuteDeleteContent(Azure.ResourceManager.ComputeSchedule.Models.Schedul public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public bool? IsForceDeletion { get { throw null; } set { } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -429,7 +481,10 @@ public ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.Sche public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -442,18 +497,40 @@ public ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.Schedule public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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 FallbackOperationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FallbackOperationInfo() { } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError Error { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType LastOpType { get { throw null; } } + public string Status { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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 GetOperationErrorsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds) { } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -464,7 +541,10 @@ public partial class GetOperationErrorsResult : System.ClientModel.Primitives.IJ { internal GetOperationErrorsResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -476,7 +556,10 @@ public partial class GetOperationStatusContent : System.ClientModel.Primitives.I public GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } public string CorrelationId { get { throw null; } } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -487,7 +570,10 @@ public partial class GetOperationStatusResult : System.ClientModel.Primitives.IJ { internal GetOperationStatusResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -501,7 +587,10 @@ internal HibernateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -522,6 +611,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage left, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage left, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage right) { throw null; } public override string ToString() { throw null; } } @@ -532,7 +622,10 @@ public NotificationSettings(string destination, Azure.ResourceManager.ComputeSch public bool? IsDisabled { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage Language { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.NotificationType Type { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -553,6 +646,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.NotificationType left, Azure.ResourceManager.ComputeSchedule.Models.NotificationType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.NotificationType left, Azure.ResourceManager.ComputeSchedule.Models.NotificationType right) { throw null; } public override string ToString() { throw null; } } @@ -560,7 +654,10 @@ public partial class OccurrenceCancelContent : System.ClientModel.Primitives.IJs { public OccurrenceCancelContent(System.Collections.Generic.IEnumerable resourceIds) { } public System.Collections.Generic.IList ResourceIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -572,7 +669,10 @@ public partial class OccurrenceDelayContent : System.ClientModel.Primitives.IJso public OccurrenceDelayContent(System.DateTimeOffset delay, System.Collections.Generic.IEnumerable resourceIds) { } public System.DateTimeOffset Delay { get { throw null; } } public System.Collections.Generic.IList ResourceIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -583,12 +683,15 @@ public partial class OccurrenceExtensionProperties : System.ClientModel.Primitiv { internal OccurrenceExtensionProperties() { } public Azure.ResponseError ErrorDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList NotificationSettings { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public Azure.Core.ResourceIdentifier ScheduledActionId { get { throw null; } } public System.DateTimeOffset ScheduledOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -599,22 +702,31 @@ public partial class OccurrenceExtensionResourceData : Azure.ResourceManager.Mod { internal OccurrenceExtensionResourceData() { } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionResourceData 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.ComputeSchedule.Models.OccurrenceExtensionResourceData 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 OccurrenceResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class OccurrenceResourceData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal OccurrenceResourceData() { } public Azure.ResponseError ErrorDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList NotificationSettings { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public System.DateTimeOffset ScheduledOn { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -637,15 +749,19 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } public partial class OccurrenceResultSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal OccurrenceResultSummary() { } - public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } + public System.Collections.Generic.IList Statuses { get { throw null; } } public int Total { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -661,7 +777,10 @@ internal OperationErrorDetails() { } public string ErrorDetails { get { throw null; } } public System.DateTimeOffset? ErrorDetailsTimestamp { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -678,7 +797,10 @@ internal OperationErrorsResult() { } public string OperationId { get { throw null; } } public string RequestErrorCode { get { throw null; } } public string RequestErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -691,6 +813,7 @@ internal ResourceOperationDetails() { } public System.DateTimeOffset? CompletedOn { get { throw null; } } public System.DateTimeOffset? Deadline { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? DeadlineType { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo FallbackOperationInfo { get { throw null; } } public string OperationId { get { throw null; } } public string OperationTimezone { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? OpType { get { throw null; } } @@ -700,7 +823,10 @@ internal ResourceOperationDetails() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? State { get { throw null; } } public string SubscriptionId { get { throw null; } } public string Timezone { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -712,7 +838,10 @@ public partial class ResourceOperationError : System.ClientModel.Primitives.IJso internal ResourceOperationError() { } public string ErrorCode { get { throw null; } } public string ErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -726,7 +855,10 @@ internal ResourceOperationResult() { } public string ErrorDetails { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails Operation { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -750,6 +882,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType left, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType left, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType right) { throw null; } public override string ToString() { throw null; } } @@ -760,7 +893,10 @@ public ResourceProvisionPayload(int resourceCount) { } public int ResourceCount { get { throw null; } } public System.Collections.Generic.IList> ResourceOverrides { get { throw null; } } public string ResourcePrefix { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -773,7 +909,10 @@ internal ResourceResultSummary() { } public string Code { get { throw null; } } public int Count { get { throw null; } } public Azure.ResponseError ErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -796,6 +935,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType right) { throw null; } public override string ToString() { throw null; } } @@ -804,7 +944,10 @@ public partial class ScheduledActionExecutionParameterDetail : System.ClientMode public ScheduledActionExecutionParameterDetail() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? OptimizationPreference { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy RetryPolicy { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -817,7 +960,10 @@ internal ScheduledActionOccurrenceProperties() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary ResultSummary { get { throw null; } } public System.DateTimeOffset ScheduledOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -844,6 +990,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState right) { throw null; } public override string ToString() { throw null; } } @@ -869,6 +1016,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState right) { throw null; } public override string ToString() { throw null; } } @@ -888,6 +1036,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference right) { throw null; } public override string ToString() { throw null; } } @@ -896,7 +1045,10 @@ public partial class ScheduledActionPatch : System.ClientModel.Primitives.IJsonM public ScheduledActionPatch() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -913,7 +1065,10 @@ public ScheduledActionPatchProperties() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? ResourceType { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } set { } } public System.DateTimeOffset? StartOn { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -931,7 +1086,10 @@ public ScheduledActionProperties(Azure.ResourceManager.ComputeSchedule.Models.Sc public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType ResourceType { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } set { } } public System.DateTimeOffset StartOn { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -942,19 +1100,28 @@ public partial class ScheduledActionResourceAttachContent : System.ClientModel.P { public ScheduledActionResourceAttachContent(System.Collections.Generic.IEnumerable resources) { } public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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 ScheduledActionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ScheduledActionResourceData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ScheduledActionResourceData(Azure.Core.ResourceIdentifier resourceId) { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -965,7 +1132,10 @@ public partial class ScheduledActionResourceDetachContent : System.ClientModel.P { public ScheduledActionResourceDetachContent(System.Collections.Generic.IEnumerable resources) { } public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -975,9 +1145,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ScheduledActionResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ScheduledActionResourceOperationResult() { } - public System.Collections.Generic.IReadOnlyList ResourcesStatuses { get { throw null; } } + public System.Collections.Generic.IList ResourcesStatuses { get { throw null; } } public int TotalResources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -999,6 +1172,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1006,7 +1180,10 @@ public partial class ScheduledActionResourcePatchContent : System.ClientModel.Pr { public ScheduledActionResourcePatchContent(System.Collections.Generic.IEnumerable resources) { } public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1030,6 +1207,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -1037,7 +1215,10 @@ public partial class ScheduledActionResources : Azure.ResourceManager.Models.Res { internal ScheduledActionResources() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionResources 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.ComputeSchedule.Models.ScheduledActionResources System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1050,7 +1231,10 @@ internal ScheduledActionResourceStatus() { } public Azure.ResponseError Error { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus Status { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1072,6 +1256,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType right) { throw null; } public override string ToString() { throw null; } } @@ -1081,13 +1266,16 @@ internal ScheduledActionsExtensionProperties() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType ActionType { get { throw null; } } public bool? Disabled { get { throw null; } } public System.DateTimeOffset? EndOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList NotificationSettings { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? ProvisioningState { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceNotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType ResourceType { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } } public System.DateTimeOffset StartOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1104,7 +1292,10 @@ public ScheduledActionsSchedule(System.TimeSpan scheduledTime, string timeZone, public System.Collections.Generic.IList RequestedWeekDays { get { throw null; } } public System.TimeSpan ScheduledTime { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1137,6 +1328,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth right) { throw null; } public override string ToString() { throw null; } } @@ -1161,6 +1353,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay right) { throw null; } public override string ToString() { throw null; } } @@ -1180,6 +1373,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType right) { throw null; } public override string ToString() { throw null; } } @@ -1190,7 +1384,10 @@ internal StartResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1204,7 +1401,10 @@ public SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.User public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1218,7 +1418,10 @@ public SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserR public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1232,7 +1435,10 @@ public SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserReque public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1243,7 +1449,10 @@ public partial class UserRequestResources : System.ClientModel.Primitives.IJsonM { public UserRequestResources(System.Collections.Generic.IEnumerable ids) { } public System.Collections.Generic.IList Ids { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1253,9 +1462,13 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class UserRequestRetryPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public UserRequestRetryPolicy() { } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? OnFailureAction { get { throw null; } set { } } public int? RetryCount { get { throw null; } set { } } public int? RetryWindowInMinutes { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1270,7 +1483,10 @@ public UserRequestSchedule(Azure.ResourceManager.ComputeSchedule.Models.Schedule public string Timezone { get { throw null; } set { } } public System.DateTimeOffset? UserRequestDeadline { get { throw null; } set { } } public string UserRequestTimezone { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs index 1da10c510f0d..88b7e26e1e50 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/api/Azure.ResourceManager.ComputeSchedule.netstandard2.0.cs @@ -40,6 +40,8 @@ public static partial class ComputeScheduleExtensions public static Azure.AsyncPageable GetAssociatedOccurrencesAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetAssociatedScheduledActions(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetAssociatedScheduledActionsAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetAttachedResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetAttachedResourcesAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetScheduledAction(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetScheduledActionAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -99,7 +101,10 @@ public partial class ScheduledActionData : Azure.ResourceManager.Models.TrackedR { public ScheduledActionData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.ScheduledActionData 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.ComputeSchedule.ScheduledActionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -125,7 +130,10 @@ public partial class ScheduledActionOccurrenceData : Azure.ResourceManager.Model { internal ScheduledActionOccurrenceData() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.ScheduledActionOccurrenceData 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.ComputeSchedule.ScheduledActionOccurrenceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -145,8 +153,6 @@ protected ScheduledActionOccurrenceResource() { } public virtual System.Threading.Tasks.Task> DelayAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAttachedResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAttachedResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData 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.ComputeSchedule.ScheduledActionOccurrenceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -213,6 +219,8 @@ protected MockableComputeScheduleArmClient() { } public partial class MockableComputeScheduleResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableComputeScheduleResourceGroupResource() { } + public virtual Azure.Pageable GetAttachedResources(string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAttachedResourcesAsync(string scheduledActionName, string occurrenceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetScheduledAction(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetScheduledActionAsync(string scheduledActionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ComputeSchedule.ScheduledActionCollection GetScheduledActions() { throw null; } @@ -286,22 +294,32 @@ namespace Azure.ResourceManager.ComputeSchedule.Models { public static partial class ArmComputeScheduleModelFactory { + public static Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds = null, string correlationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult CancelOperationsResult(System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.CreateResourceOperationResult CreateResourceOperationResult(string description = null, string type = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult DeallocateResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.DeleteResourceOperationResult DeleteResourceOperationResult(string description = null, string type = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent ExecuteCreateContent(Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload resourceConfigParameters = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent ExecuteDeleteContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null, bool? isForceDeletion = default(bool?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo FallbackOperationInfo(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType lastOpType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType), string status = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError error = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult GetOperationErrorsResult(System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds = null, string correlationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult GetOperationStatusResult(System.Collections.Generic.IEnumerable results = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult HibernateResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent OccurrenceCancelContent(System.Collections.Generic.IEnumerable resourceIds = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent OccurrenceDelayContent(System.DateTimeOffset delay = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable resourceIds = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties OccurrenceExtensionProperties(Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null, Azure.Core.ResourceIdentifier scheduledActionId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionResourceData OccurrenceExtensionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties properties = null) { throw null; } - public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData OccurrenceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData OccurrenceResourceData(string name = null, Azure.Core.ResourceIdentifier id = null, string type = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState?), Azure.ResponseError errorDetails = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary OccurrenceResultSummary(int total = 0, System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails OperationErrorDetails(string errorCode = null, string errorDetails = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.DateTimeOffset? errorDetailsTimestamp = default(System.DateTimeOffset?), string azureOperationName = null, string crpOperationId = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult OperationErrorsResult(string operationId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? activationOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable operationErrors = null, string requestErrorCode = null, string requestErrorDetails = null) { throw null; } - public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId = null, Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType?), string subscriptionId = null, System.DateTimeOffset? deadline = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState?), string timezone = null, string operationTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId = null, Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType = default(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType?), string subscriptionId = null, System.DateTimeOffset? deadline = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState?), string timezone = null, string operationTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError = null, Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo fallbackOperationInfo = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails ResourceOperationDetails(string operationId, Azure.Core.ResourceIdentifier resourceId, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? opType, string subscriptionId, System.DateTimeOffset? deadline, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? state, string timezone, string operationTimezone, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError resourceOperationError, System.DateTimeOffset? completedOn, Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy retryPolicy = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError ResourceOperationError(string errorCode = null, string errorDetails = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult ResourceOperationResult(Azure.Core.ResourceIdentifier resourceId = null, string errorCode = null, string errorDetails = null, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails operation = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload ResourceProvisionPayload(System.Collections.Generic.IDictionary baseProfile = null, System.Collections.Generic.IEnumerable> resourceOverrides = null, int resourceCount = 0, string resourcePrefix = null) { throw null; } @@ -309,13 +327,23 @@ public static partial class ArmComputeScheduleModelFactory public static Azure.ResourceManager.ComputeSchedule.ScheduledActionData ScheduledActionData(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.ComputeSchedule.Models.ScheduledActionProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.ScheduledActionOccurrenceData ScheduledActionOccurrenceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties ScheduledActionOccurrenceProperties(System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary resultSummary = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState?)) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch ScheduledActionPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties ScheduledActionPatchProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?)) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties ScheduledActionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData ScheduledActionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent ScheduledActionResourceAttachContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData ScheduledActionResourceData(string name = null, Azure.Core.ResourceIdentifier id = null, string type = null, Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable notificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent ScheduledActionResourceDetachContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationResult ScheduledActionResourceOperationResult(int totalResources = 0, System.Collections.Generic.IEnumerable resourcesStatuses = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent ScheduledActionResourcePatchContent(System.Collections.Generic.IEnumerable resources = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResources ScheduledActionResources(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceStatus ScheduledActionResourceStatus(Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus status = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties ScheduledActionsExtensionProperties(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType resourceType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType actionType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType), System.DateTimeOffset startOn = default(System.DateTimeOffset), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule schedule = null, System.Collections.Generic.IEnumerable notificationSettings = null, bool? disabled = default(bool?), Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState?), System.Collections.Generic.IEnumerable resourceNotificationSettings = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule ScheduledActionsSchedule(System.TimeSpan scheduledTime = default(System.TimeSpan), string timeZone = null, System.Collections.Generic.IEnumerable requestedWeekDays = null, System.Collections.Generic.IEnumerable requestedMonths = null, System.Collections.Generic.IEnumerable requestedDaysOfTheMonth = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType?)) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult StartResourceOperationResult(string description = null, string resourceType = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable results = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule schedule = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail executionParameters = null, System.Collections.Generic.IEnumerable resourcesIds = null, string correlationId = null) { throw null; } + public static Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources UserRequestResources(System.Collections.Generic.IEnumerable ids = null) { throw null; } public static Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule UserRequestSchedule(System.DateTimeOffset? deadline = default(System.DateTimeOffset?), System.DateTimeOffset? userRequestDeadline = default(System.DateTimeOffset?), string timezone = null, string userRequestTimezone = null, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType deadlineType = default(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType)) { throw null; } } public partial class CancelOperationsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -323,7 +351,10 @@ public partial class CancelOperationsContent : System.ClientModel.Primitives.IJs public CancelOperationsContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } public string CorrelationId { get { throw null; } } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent 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.ComputeSchedule.Models.CancelOperationsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -334,7 +365,10 @@ public partial class CancelOperationsResult : System.ClientModel.Primitives.IJso { internal CancelOperationsResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult 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.ComputeSchedule.Models.CancelOperationsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -348,7 +382,10 @@ internal CreateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult 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.ComputeSchedule.Models.CreateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -362,7 +399,10 @@ internal DeallocateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult 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.ComputeSchedule.Models.DeallocateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -376,7 +416,10 @@ internal DeleteResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult 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.ComputeSchedule.Models.DeleteResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -389,7 +432,10 @@ public ExecuteCreateContent(Azure.ResourceManager.ComputeSchedule.Models.Resourc public string CorrelationId { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload ResourceConfigParameters { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent 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.ComputeSchedule.Models.ExecuteCreateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -402,7 +448,10 @@ public ExecuteDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.Sch public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent 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.ComputeSchedule.Models.ExecuteDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -416,7 +465,10 @@ public ExecuteDeleteContent(Azure.ResourceManager.ComputeSchedule.Models.Schedul public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public bool? IsForceDeletion { get { throw null; } set { } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent 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.ComputeSchedule.Models.ExecuteDeleteContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -429,7 +481,10 @@ public ExecuteHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.Sche public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent 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.ComputeSchedule.Models.ExecuteHibernateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -442,18 +497,40 @@ public ExecuteStartContent(Azure.ResourceManager.ComputeSchedule.Models.Schedule public string CorrelationId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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.ComputeSchedule.Models.ExecuteStartContent 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 FallbackOperationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FallbackOperationInfo() { } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError Error { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType LastOpType { get { throw null; } } + public string Status { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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.ComputeSchedule.Models.FallbackOperationInfo 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 GetOperationErrorsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GetOperationErrorsContent(System.Collections.Generic.IEnumerable operationIds) { } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent 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.ComputeSchedule.Models.GetOperationErrorsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -464,7 +541,10 @@ public partial class GetOperationErrorsResult : System.ClientModel.Primitives.IJ { internal GetOperationErrorsResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult 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.ComputeSchedule.Models.GetOperationErrorsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -476,7 +556,10 @@ public partial class GetOperationStatusContent : System.ClientModel.Primitives.I public GetOperationStatusContent(System.Collections.Generic.IEnumerable operationIds, string correlationId) { } public string CorrelationId { get { throw null; } } public System.Collections.Generic.IList OperationIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent 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.ComputeSchedule.Models.GetOperationStatusContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -487,7 +570,10 @@ public partial class GetOperationStatusResult : System.ClientModel.Primitives.IJ { internal GetOperationStatusResult() { } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult 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.ComputeSchedule.Models.GetOperationStatusResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -501,7 +587,10 @@ internal HibernateResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult 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.ComputeSchedule.Models.HibernateResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -522,6 +611,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage left, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage left, Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage right) { throw null; } public override string ToString() { throw null; } } @@ -532,7 +622,10 @@ public NotificationSettings(string destination, Azure.ResourceManager.ComputeSch public bool? IsDisabled { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.NotificationLanguage Language { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.NotificationType Type { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings 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.ComputeSchedule.Models.NotificationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -553,6 +646,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.NotificationType left, Azure.ResourceManager.ComputeSchedule.Models.NotificationType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.NotificationType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.NotificationType left, Azure.ResourceManager.ComputeSchedule.Models.NotificationType right) { throw null; } public override string ToString() { throw null; } } @@ -560,7 +654,10 @@ public partial class OccurrenceCancelContent : System.ClientModel.Primitives.IJs { public OccurrenceCancelContent(System.Collections.Generic.IEnumerable resourceIds) { } public System.Collections.Generic.IList ResourceIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent 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.ComputeSchedule.Models.OccurrenceCancelContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -572,7 +669,10 @@ public partial class OccurrenceDelayContent : System.ClientModel.Primitives.IJso public OccurrenceDelayContent(System.DateTimeOffset delay, System.Collections.Generic.IEnumerable resourceIds) { } public System.DateTimeOffset Delay { get { throw null; } } public System.Collections.Generic.IList ResourceIds { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent 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.ComputeSchedule.Models.OccurrenceDelayContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -583,12 +683,15 @@ public partial class OccurrenceExtensionProperties : System.ClientModel.Primitiv { internal OccurrenceExtensionProperties() { } public Azure.ResponseError ErrorDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList NotificationSettings { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public Azure.Core.ResourceIdentifier ScheduledActionId { get { throw null; } } public System.DateTimeOffset ScheduledOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -599,22 +702,31 @@ public partial class OccurrenceExtensionResourceData : Azure.ResourceManager.Mod { internal OccurrenceExtensionResourceData() { } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceExtensionProperties 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.ComputeSchedule.Models.OccurrenceExtensionResourceData 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.ComputeSchedule.Models.OccurrenceExtensionResourceData 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 OccurrenceResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class OccurrenceResourceData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal OccurrenceResourceData() { } public Azure.ResponseError ErrorDetails { get { throw null; } } - public System.Collections.Generic.IReadOnlyList NotificationSettings { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public System.DateTimeOffset ScheduledOn { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData 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.ComputeSchedule.Models.OccurrenceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -637,15 +749,19 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } public partial class OccurrenceResultSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal OccurrenceResultSummary() { } - public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } + public System.Collections.Generic.IList Statuses { get { throw null; } } public int Total { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary 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.ComputeSchedule.Models.OccurrenceResultSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -661,7 +777,10 @@ internal OperationErrorDetails() { } public string ErrorDetails { get { throw null; } } public System.DateTimeOffset? ErrorDetailsTimestamp { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails 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.ComputeSchedule.Models.OperationErrorDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -678,7 +797,10 @@ internal OperationErrorsResult() { } public string OperationId { get { throw null; } } public string RequestErrorCode { get { throw null; } } public string RequestErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult 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.ComputeSchedule.Models.OperationErrorsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -691,6 +813,7 @@ internal ResourceOperationDetails() { } public System.DateTimeOffset? CompletedOn { get { throw null; } } public System.DateTimeOffset? Deadline { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? DeadlineType { get { throw null; } } + public Azure.ResourceManager.ComputeSchedule.Models.FallbackOperationInfo FallbackOperationInfo { get { throw null; } } public string OperationId { get { throw null; } } public string OperationTimezone { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? OpType { get { throw null; } } @@ -700,7 +823,10 @@ internal ResourceOperationDetails() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? State { get { throw null; } } public string SubscriptionId { get { throw null; } } public string Timezone { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails 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.ComputeSchedule.Models.ResourceOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -712,7 +838,10 @@ public partial class ResourceOperationError : System.ClientModel.Primitives.IJso internal ResourceOperationError() { } public string ErrorCode { get { throw null; } } public string ErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError 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.ComputeSchedule.Models.ResourceOperationError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -726,7 +855,10 @@ internal ResourceOperationResult() { } public string ErrorDetails { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationDetails Operation { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult 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.ComputeSchedule.Models.ResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -750,6 +882,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType left, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType left, Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType right) { throw null; } public override string ToString() { throw null; } } @@ -760,7 +893,10 @@ public ResourceProvisionPayload(int resourceCount) { } public int ResourceCount { get { throw null; } } public System.Collections.Generic.IList> ResourceOverrides { get { throw null; } } public string ResourcePrefix { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload 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.ComputeSchedule.Models.ResourceProvisionPayload System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -773,7 +909,10 @@ internal ResourceResultSummary() { } public string Code { get { throw null; } } public int Count { get { throw null; } } public Azure.ResponseError ErrorDetails { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary 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.ComputeSchedule.Models.ResourceResultSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -796,6 +935,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionDeadlineType right) { throw null; } public override string ToString() { throw null; } } @@ -804,7 +944,10 @@ public partial class ScheduledActionExecutionParameterDetail : System.ClientMode public ScheduledActionExecutionParameterDetail() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? OptimizationPreference { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy RetryPolicy { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail 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.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -817,7 +960,10 @@ internal ScheduledActionOccurrenceProperties() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResultSummary ResultSummary { get { throw null; } } public System.DateTimeOffset ScheduledOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties 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.ComputeSchedule.Models.ScheduledActionOccurrenceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -844,6 +990,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOccurrenceState right) { throw null; } public override string ToString() { throw null; } } @@ -869,6 +1016,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOperationState right) { throw null; } public override string ToString() { throw null; } } @@ -888,6 +1036,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionOptimizationPreference right) { throw null; } public override string ToString() { throw null; } } @@ -896,7 +1045,10 @@ public partial class ScheduledActionPatch : System.ClientModel.Primitives.IJsonM public ScheduledActionPatch() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch 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.ComputeSchedule.Models.ScheduledActionPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -913,7 +1065,10 @@ public ScheduledActionPatchProperties() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? ResourceType { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } set { } } public System.DateTimeOffset? StartOn { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties 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.ComputeSchedule.Models.ScheduledActionPatchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -931,7 +1086,10 @@ public ScheduledActionProperties(Azure.ResourceManager.ComputeSchedule.Models.Sc public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType ResourceType { get { throw null; } set { } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } set { } } public System.DateTimeOffset StartOn { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties 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.ComputeSchedule.Models.ScheduledActionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -942,19 +1100,28 @@ public partial class ScheduledActionResourceAttachContent : System.ClientModel.P { public ScheduledActionResourceAttachContent(System.Collections.Generic.IEnumerable resources) { } public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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.ComputeSchedule.Models.ScheduledActionResourceAttachContent 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 ScheduledActionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ScheduledActionResourceData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ScheduledActionResourceData(Azure.Core.ResourceIdentifier resourceId) { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } } public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData 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.ComputeSchedule.Models.ScheduledActionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -965,7 +1132,10 @@ public partial class ScheduledActionResourceDetachContent : System.ClientModel.P { public ScheduledActionResourceDetachContent(System.Collections.Generic.IEnumerable resources) { } public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent 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.ComputeSchedule.Models.ScheduledActionResourceDetachContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -975,9 +1145,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ScheduledActionResourceOperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ScheduledActionResourceOperationResult() { } - public System.Collections.Generic.IReadOnlyList ResourcesStatuses { get { throw null; } } + public System.Collections.Generic.IList ResourcesStatuses { get { throw null; } } public int TotalResources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult 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.ComputeSchedule.Models.ScheduledActionResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -999,6 +1172,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1006,7 +1180,10 @@ public partial class ScheduledActionResourcePatchContent : System.ClientModel.Pr { public ScheduledActionResourcePatchContent(System.Collections.Generic.IEnumerable resources) { } public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent 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.ComputeSchedule.Models.ScheduledActionResourcePatchContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1030,6 +1207,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -1037,7 +1215,10 @@ public partial class ScheduledActionResources : Azure.ResourceManager.Models.Res { internal ScheduledActionResources() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionResources 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.ComputeSchedule.Models.ScheduledActionResources System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1050,7 +1231,10 @@ internal ScheduledActionResourceStatus() { } public Azure.ResponseError Error { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceOperationStatus Status { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus 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.ComputeSchedule.Models.ScheduledActionResourceStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1072,6 +1256,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType right) { throw null; } public override string ToString() { throw null; } } @@ -1081,13 +1266,16 @@ internal ScheduledActionsExtensionProperties() { } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType ActionType { get { throw null; } } public bool? Disabled { get { throw null; } } public System.DateTimeOffset? EndOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList NotificationSettings { get { throw null; } } + public System.Collections.Generic.IList NotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceProvisioningState? ProvisioningState { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceNotificationSettings { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceType ResourceType { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule Schedule { get { throw null; } } public System.DateTimeOffset StartOn { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties 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.ComputeSchedule.Models.ScheduledActionsExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1104,7 +1292,10 @@ public ScheduledActionsSchedule(System.TimeSpan scheduledTime, string timeZone, public System.Collections.Generic.IList RequestedWeekDays { get { throw null; } } public System.TimeSpan ScheduledTime { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule 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.ComputeSchedule.Models.ScheduledActionsSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1137,6 +1328,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleMonth right) { throw null; } public override string ToString() { throw null; } } @@ -1161,6 +1353,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionsScheduleWeekDay right) { throw null; } public override string ToString() { throw null; } } @@ -1180,6 +1373,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType right) { throw null; } public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType left, Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionType right) { throw null; } public override string ToString() { throw null; } } @@ -1190,7 +1384,10 @@ internal StartResourceOperationResult() { } public Azure.Core.AzureLocation Location { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Results { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult 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.ComputeSchedule.Models.StartResourceOperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1204,7 +1401,10 @@ public SubmitDeallocateContent(Azure.ResourceManager.ComputeSchedule.Models.User public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent 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.ComputeSchedule.Models.SubmitDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1218,7 +1418,10 @@ public SubmitHibernateContent(Azure.ResourceManager.ComputeSchedule.Models.UserR public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent 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.ComputeSchedule.Models.SubmitHibernateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1232,7 +1435,10 @@ public SubmitStartContent(Azure.ResourceManager.ComputeSchedule.Models.UserReque public Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionExecutionParameterDetail ExecutionParameters { get { throw null; } } public System.Collections.Generic.IList ResourcesIds { get { throw null; } } public Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule Schedule { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent 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.ComputeSchedule.Models.SubmitStartContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1243,7 +1449,10 @@ public partial class UserRequestResources : System.ClientModel.Primitives.IJsonM { public UserRequestResources(System.Collections.Generic.IEnumerable ids) { } public System.Collections.Generic.IList Ids { get { throw null; } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources 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.ComputeSchedule.Models.UserRequestResources System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1253,9 +1462,13 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class UserRequestRetryPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public UserRequestRetryPolicy() { } + public Azure.ResourceManager.ComputeSchedule.Models.ResourceOperationType? OnFailureAction { get { throw null; } set { } } public int? RetryCount { get { throw null; } set { } } public int? RetryWindowInMinutes { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy 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.ComputeSchedule.Models.UserRequestRetryPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1270,7 +1483,10 @@ public UserRequestSchedule(Azure.ResourceManager.ComputeSchedule.Models.Schedule public string Timezone { get { throw null; } set { } } public System.DateTimeOffset? UserRequestDeadline { get { throw null; } set { } } public string UserRequestTimezone { get { throw null; } set { } } + protected virtual Azure.ResourceManager.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule 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.ComputeSchedule.Models.UserRequestSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj index d9180c2b6b59..f8eae31681ba 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj @@ -6,6 +6,5 @@ Azure.ResourceManager.ComputeSchedule Azure Resource Manager client SDK for Azure resource provider ComputeSchedule. azure;management;arm;resource manager;computeschedule - true diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/ArmComputeScheduleModelFactory.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/ArmComputeScheduleModelFactory.cs new file mode 100644 index 000000000000..16cff4c39c02 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/ArmComputeScheduleModelFactory.cs @@ -0,0 +1,41 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// A factory class for creating instances of the models for mocking. + public static partial class ArmComputeScheduleModelFactory + { + /// The details of a response from an operation on a resource. + /// Operation identifier for the unique operation. + /// Unique identifier for the resource involved in the operation, eg ArmId. + /// Type of operation performed on the resources. + /// Subscription id attached to the request. + /// Deadline for the operation. + /// Type of deadline of the operation. + /// Current state of the operation. + /// Timezone for the operation. + /// Timezone for the operation. + /// Operation level errors if they exist. + /// Time the operation was complete if errors are null. + /// Retry policy the user can pass. + /// A new instance for mocking. + public static ResourceOperationDetails ResourceOperationDetails(string operationId, ResourceIdentifier resourceId, ResourceOperationType? opType, string subscriptionId, DateTimeOffset? deadline, ScheduledActionDeadlineType? deadlineType, ScheduledActionOperationState? state, string timezone, string operationTimezone, ResourceOperationError resourceOperationError, DateTimeOffset? completedOn, UserRequestRetryPolicy retryPolicy = default) + { + return ResourceOperationDetails( + operationId, resourceId, opType, subscriptionId, deadline, deadlineType, state, timezone, operationTimezone, resourceOperationError, null, completedOn, retryPolicy); + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/Models/ScheduledActionPatchProperties.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/Models/ScheduledActionPatchProperties.cs index 89a1ccb87516..f5cf3ec822ff 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/Models/ScheduledActionPatchProperties.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Custom/Models/ScheduledActionPatchProperties.cs @@ -5,11 +5,12 @@ #nullable disable -using Azure.Core; +using Microsoft.TypeSpec.Generator.Customizations; namespace Azure.ResourceManager.ComputeSchedule.Models { - [CodeGenModel("ScheduledActionUpdateProperties")] + /// The updatable properties of the ScheduledAction. + [CodeGenType("ScheduledActionUpdateProperties")] public partial class ScheduledActionPatchProperties { } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs index 375eb20cf773..369abbe2e6de 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs @@ -8,22 +8,35 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ComputeSchedule.Models { - /// Model factory for models. + /// A factory class for creating instances of the models for mocking. public static partial class ArmComputeScheduleModelFactory { - /// Initializes a new instance of . + + /// The schedule for the request. + /// The execution parameters for the request. + /// The resource ids used for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static SubmitDeallocateContent SubmitDeallocateContent(UserRequestSchedule schedule = default, ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default) + { + return new SubmitDeallocateContent(schedule, executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, additionalBinaryDataProperties: null); + } + + /// The schedule details for the user request. /// The deadline for the operation. /// The deadline for the operation. /// The timezone for the operation. /// The timezone for the operation. /// The deadlinetype of the operation, this can either be InitiateAt or CompleteBy. /// A new instance for mocking. - public static UserRequestSchedule UserRequestSchedule(DateTimeOffset? deadline = null, DateTimeOffset? userRequestDeadline = null, string timezone = null, string userRequestTimezone = null, ScheduledActionDeadlineType deadlineType = default) + public static UserRequestSchedule UserRequestSchedule(DateTimeOffset? deadline = default, DateTimeOffset? userRequestDeadline = default, string timezone = default, string userRequestTimezone = default, ScheduledActionDeadlineType deadlineType = default) { return new UserRequestSchedule( deadline, @@ -31,34 +44,44 @@ public static UserRequestSchedule UserRequestSchedule(DateTimeOffset? deadline = timezone, userRequestTimezone, deadlineType, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); + } + + /// The resources needed for the user request. + /// The resource ids used for the request. + /// A new instance for mocking. + public static UserRequestResources UserRequestResources(IEnumerable ids = default) + { + ids ??= new ChangeTrackingList(); + + return new UserRequestResources(ids.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The response from a deallocate request. /// The description of the operation response. /// The type of resources used in the deallocate request eg virtual machines. /// The location of the deallocate request eg westus. /// The results from the deallocate request if no errors exist. /// A new instance for mocking. - public static DeallocateResourceOperationResult DeallocateResourceOperationResult(string description = null, string resourceType = null, AzureLocation location = default, IEnumerable results = null) + public static DeallocateResourceOperationResult DeallocateResourceOperationResult(string description = default, string resourceType = default, AzureLocation location = default, IEnumerable results = default) { - results ??= new List(); + results ??= new ChangeTrackingList(); - return new DeallocateResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null); + return new DeallocateResourceOperationResult(description, resourceType, location, results.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// High level response from an operation on a resource. /// Unique identifier for the resource involved in the operation, eg ArmId. /// Resource level error code if it exists. /// Resource level error details if they exist. /// Details of the operation performed on a resource. /// A new instance for mocking. - public static ResourceOperationResult ResourceOperationResult(ResourceIdentifier resourceId = null, string errorCode = null, string errorDetails = null, ResourceOperationDetails operation = null) + public static ResourceOperationResult ResourceOperationResult(ResourceIdentifier resourceId = default, string errorCode = default, string errorDetails = default, ResourceOperationDetails operation = default) { - return new ResourceOperationResult(resourceId, errorCode, errorDetails, operation, serializedAdditionalRawData: null); + return new ResourceOperationResult(resourceId, errorCode, errorDetails, operation, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The details of a response from an operation on a resource. /// Operation identifier for the unique operation. /// Unique identifier for the resource involved in the operation, eg ArmId. /// Type of operation performed on the resources. @@ -69,10 +92,11 @@ public static ResourceOperationResult ResourceOperationResult(ResourceIdentifier /// Timezone for the operation. /// Timezone for the operation. /// Operation level errors if they exist. + /// Fallback operation details if a fallback was performed. /// Time the operation was complete if errors are null. /// Retry policy the user can pass. /// A new instance for mocking. - public static ResourceOperationDetails ResourceOperationDetails(string operationId = null, ResourceIdentifier resourceId = null, ResourceOperationType? opType = null, string subscriptionId = null, DateTimeOffset? deadline = null, ScheduledActionDeadlineType? deadlineType = null, ScheduledActionOperationState? state = null, string timezone = null, string operationTimezone = null, ResourceOperationError resourceOperationError = null, DateTimeOffset? completedOn = null, UserRequestRetryPolicy retryPolicy = null) + public static ResourceOperationDetails ResourceOperationDetails(string operationId = default, ResourceIdentifier resourceId = default, ResourceOperationType? opType = default, string subscriptionId = default, DateTimeOffset? deadline = default, ScheduledActionDeadlineType? deadlineType = default, ScheduledActionOperationState? state = default, string timezone = default, string operationTimezone = default, ResourceOperationError resourceOperationError = default, FallbackOperationInfo fallbackOperationInfo = default, DateTimeOffset? completedOn = default, UserRequestRetryPolicy retryPolicy = default) { return new ResourceOperationDetails( operationId, @@ -85,140 +109,227 @@ public static ResourceOperationDetails ResourceOperationDetails(string operation timezone, operationTimezone, resourceOperationError, + fallbackOperationInfo, completedOn, retryPolicy, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// These describe errors that occur at the resource level. /// Code for the error eg 404, 500. /// Detailed message about the error. /// A new instance for mocking. - public static ResourceOperationError ResourceOperationError(string errorCode = null, string errorDetails = null) + public static ResourceOperationError ResourceOperationError(string errorCode = default, string errorDetails = default) { - return new ResourceOperationError(errorCode, errorDetails, serializedAdditionalRawData: null); + return new ResourceOperationError(errorCode, errorDetails, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Describes the fallback operation that was performed. + /// The last operation type that was performed as a fallback. + /// The status of the fallback operation. + /// The error code if the fallback operation failed. + /// A new instance for mocking. + public static FallbackOperationInfo FallbackOperationInfo(ResourceOperationType lastOpType = default, string status = default, ResourceOperationError error = default) + { + return new FallbackOperationInfo(lastOpType, status, error, additionalBinaryDataProperties: null); + } + + /// The schedule for the request. + /// The execution parameters for the request. + /// The resource ids used for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static SubmitHibernateContent SubmitHibernateContent(UserRequestSchedule schedule = default, ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default) + { + return new SubmitHibernateContent(schedule, executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, additionalBinaryDataProperties: null); + } + + /// The response from a Hibernate request. /// The description of the operation response. /// The type of resources used in the Hibernate request eg virtual machines. /// The location of the Hibernate request eg westus. /// The results from the Hibernate request if no errors exist. /// A new instance for mocking. - public static HibernateResourceOperationResult HibernateResourceOperationResult(string description = null, string resourceType = null, AzureLocation location = default, IEnumerable results = null) + public static HibernateResourceOperationResult HibernateResourceOperationResult(string description = default, string resourceType = default, AzureLocation location = default, IEnumerable results = default) { - results ??= new List(); + results ??= new ChangeTrackingList(); - return new HibernateResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null); + return new HibernateResourceOperationResult(description, resourceType, location, results.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The schedule for the request. + /// The execution parameters for the request. + /// The resource ids used for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static SubmitStartContent SubmitStartContent(UserRequestSchedule schedule = default, ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default) + { + return new SubmitStartContent(schedule, executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, additionalBinaryDataProperties: null); + } + + /// The response from a start request. /// The description of the operation response. /// The type of resources used in the start request eg virtual machines. /// The location of the start request eg westus. /// The results from the start request if no errors exist. /// A new instance for mocking. - public static StartResourceOperationResult StartResourceOperationResult(string description = null, string resourceType = null, AzureLocation location = default, IEnumerable results = null) + public static StartResourceOperationResult StartResourceOperationResult(string description = default, string resourceType = default, AzureLocation location = default, IEnumerable results = default) + { + results ??= new ChangeTrackingList(); + + return new StartResourceOperationResult(description, resourceType, location, results.ToList(), additionalBinaryDataProperties: null); + } + + /// The execution parameters for the request. + /// The resource ids used for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static ExecuteDeallocateContent ExecuteDeallocateContent(ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default) + { + return new ExecuteDeallocateContent(executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, additionalBinaryDataProperties: null); + } + + /// The execution parameters for the request. + /// The resource ids used for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static ExecuteHibernateContent ExecuteHibernateContent(ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default) { - results ??= new List(); + return new ExecuteHibernateContent(executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, additionalBinaryDataProperties: null); + } - return new StartResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null); + /// The execution parameters for the request. + /// The resource ids used for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static ExecuteStartContent ExecuteStartContent(ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default) + { + return new ExecuteStartContent(executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The ExecuteCreateRequest request for create operations. /// resource creation payload. /// The execution parameters for the request. /// CorrelationId item. /// A new instance for mocking. - public static ExecuteCreateContent ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters = null, ScheduledActionExecutionParameterDetail executionParameters = null, string correlationId = null) + public static ExecuteCreateContent ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters = default, ScheduledActionExecutionParameterDetail executionParameters = default, string correlationId = default) { - return new ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationId, serializedAdditionalRawData: null); + return new ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Resource creation data model. /// JSON object that contains VM properties that are common across all VMs in this batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in baseProfile). /// JSON array, that contains VM properties that should to be overridden for each VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and create a merged VMProfile. /// Number of VMs to be created. /// if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. /// A new instance for mocking. - public static ResourceProvisionPayload ResourceProvisionPayload(IDictionary baseProfile = null, IEnumerable> resourceOverrides = null, int resourceCount = default, string resourcePrefix = null) + public static ResourceProvisionPayload ResourceProvisionPayload(IDictionary baseProfile = default, IEnumerable> resourceOverrides = default, int resourceCount = default, string resourcePrefix = default) { - baseProfile ??= new Dictionary(); - resourceOverrides ??= new List>(); + baseProfile ??= new ChangeTrackingDictionary(); + resourceOverrides ??= new ChangeTrackingList>(); - return new ResourceProvisionPayload(baseProfile, resourceOverrides?.ToList(), resourceCount, resourcePrefix, serializedAdditionalRawData: null); + return new ResourceProvisionPayload(baseProfile, resourceOverrides.ToList(), resourceCount, resourcePrefix, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The response from a create request. /// The description of the operation response. /// The type of resources used in the create request eg virtual machines. /// The location of the start request eg westus. /// The results from the start request if no errors exist. /// A new instance for mocking. - public static CreateResourceOperationResult CreateResourceOperationResult(string description = null, string type = null, AzureLocation location = default, IEnumerable results = null) + public static CreateResourceOperationResult CreateResourceOperationResult(string description = default, string @type = default, AzureLocation location = default, IEnumerable results = default) { - results ??= new List(); + results ??= new ChangeTrackingList(); - return new CreateResourceOperationResult(description, type, location, results?.ToList(), serializedAdditionalRawData: null); + return new CreateResourceOperationResult(description, @type, location, results.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . /// The execution parameters for the request. - /// The resources for the request. + /// The resource ids used for the request. /// CorrelationId item. /// Forced delete resource item. /// A new instance for mocking. - public static ExecuteDeleteContent ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters = null, IEnumerable resourcesIds = null, string correlationId = null, bool? isForceDeletion = null) + public static ExecuteDeleteContent ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters = default, IEnumerable resourcesIds = default, string correlationId = default, bool? isForceDeletion = default) { - resourcesIds ??= new List(); - - return new ExecuteDeleteContent(executionParameters, resourcesIds != null ? new UserRequestResources(resourcesIds?.ToList(), serializedAdditionalRawData: null) : null, correlationId, isForceDeletion, serializedAdditionalRawData: null); + return new ExecuteDeleteContent(executionParameters, resourcesIds is null ? default : new UserRequestResources((resourcesIds ?? new ChangeTrackingList()).ToList(), null), correlationId, isForceDeletion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The response from a delete request. /// The description of the operation response. /// The type of resources used in the delete request eg virtual machines. /// The location of the start request eg westus. /// The results from the start request if no errors exist. /// A new instance for mocking. - public static DeleteResourceOperationResult DeleteResourceOperationResult(string description = null, string type = null, AzureLocation location = default, IEnumerable results = null) + public static DeleteResourceOperationResult DeleteResourceOperationResult(string description = default, string @type = default, AzureLocation location = default, IEnumerable results = default) { - results ??= new List(); + results ??= new ChangeTrackingList(); - return new DeleteResourceOperationResult(description, type, location, results?.ToList(), serializedAdditionalRawData: null); + return new DeleteResourceOperationResult(description, @type, location, results.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// This is the request to get operation status using operationids. + /// The list of operation ids to get the status of. + /// CorrelationId item. + /// A new instance for mocking. + public static GetOperationStatusContent GetOperationStatusContent(IEnumerable operationIds = default, string correlationId = default) + { + operationIds ??= new ChangeTrackingList(); + + return new GetOperationStatusContent(operationIds.ToList(), correlationId, additionalBinaryDataProperties: null); + } + + /// This is the response from a get operations status request. /// An array of resource operations based on their operation ids. /// A new instance for mocking. - public static GetOperationStatusResult GetOperationStatusResult(IEnumerable results = null) + public static GetOperationStatusResult GetOperationStatusResult(IEnumerable results = default) { - results ??= new List(); + results ??= new ChangeTrackingList(); - return new GetOperationStatusResult(results?.ToList(), serializedAdditionalRawData: null); + return new GetOperationStatusResult(results.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// This is the request to cancel running operations in scheduled actions using the operation ids. + /// The list of operation ids to cancel operations on. + /// CorrelationId item. + /// A new instance for mocking. + public static CancelOperationsContent CancelOperationsContent(IEnumerable operationIds = default, string correlationId = default) + { + operationIds ??= new ChangeTrackingList(); + + return new CancelOperationsContent(operationIds.ToList(), correlationId, additionalBinaryDataProperties: null); + } + + /// This is the response from a cancel operations request. /// An array of resource operations that were successfully cancelled. /// A new instance for mocking. - public static CancelOperationsResult CancelOperationsResult(IEnumerable results = null) + public static CancelOperationsResult CancelOperationsResult(IEnumerable results = default) + { + results ??= new ChangeTrackingList(); + + return new CancelOperationsResult(results.ToList(), additionalBinaryDataProperties: null); + } + + /// This is the request to get errors per vm operations. + /// The list of operation ids to query errors of. + /// A new instance for mocking. + public static GetOperationErrorsContent GetOperationErrorsContent(IEnumerable operationIds = default) { - results ??= new List(); + operationIds ??= new ChangeTrackingList(); - return new CancelOperationsResult(results?.ToList(), serializedAdditionalRawData: null); + return new GetOperationErrorsContent(operationIds.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// This is the response from a get operations errors request. /// An array of operationids and their corresponding errors if any. /// A new instance for mocking. - public static GetOperationErrorsResult GetOperationErrorsResult(IEnumerable results = null) + public static GetOperationErrorsResult GetOperationErrorsResult(IEnumerable results = default) { - results ??= new List(); + results ??= new ChangeTrackingList(); - return new GetOperationErrorsResult(results?.ToList(), serializedAdditionalRawData: null); + return new GetOperationErrorsResult(results.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// This is the first level of operation errors from the request when clients get errors per vm operation. /// The operationId identifying a vm operation. /// The creation time of the error result. /// The activation time of a vm operation. @@ -227,22 +338,22 @@ public static GetOperationErrorsResult GetOperationErrorsResult(IEnumerable Request level error code. /// Request level error details. /// A new instance for mocking. - public static OperationErrorsResult OperationErrorsResult(string operationId = null, DateTimeOffset? createdOn = null, DateTimeOffset? activationOn = null, DateTimeOffset? completedOn = null, IEnumerable operationErrors = null, string requestErrorCode = null, string requestErrorDetails = null) + public static OperationErrorsResult OperationErrorsResult(string operationId = default, DateTimeOffset? createdOn = default, DateTimeOffset? activationOn = default, DateTimeOffset? completedOn = default, IEnumerable operationErrors = default, string requestErrorCode = default, string requestErrorDetails = default) { - operationErrors ??= new List(); + operationErrors ??= new ChangeTrackingList(); return new OperationErrorsResult( operationId, createdOn, activationOn, completedOn, - operationErrors?.ToList(), + operationErrors.ToList(), requestErrorCode, requestErrorDetails, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// This defines a list of operation errors associated with a unique operationId. /// The error code of the operation. /// The error details of the operation. /// The timestamp of the error occurence. @@ -250,7 +361,7 @@ public static OperationErrorsResult OperationErrorsResult(string operationId = n /// The compute operationid of the Start/Deallocate/Hibernate request. /// The compute operationid of the Start/Deallocate/Hibernate request. /// A new instance for mocking. - public static OperationErrorDetails OperationErrorDetails(string errorCode = null, string errorDetails = null, DateTimeOffset? timestamp = null, DateTimeOffset? errorDetailsTimestamp = null, string azureOperationName = null, string crpOperationId = null) + public static OperationErrorDetails OperationErrorDetails(string errorCode = default, string errorDetails = default, DateTimeOffset? timestamp = default, DateTimeOffset? errorDetailsTimestamp = default, string azureOperationName = default, string crpOperationId = default) { return new OperationErrorDetails( errorCode, @@ -259,34 +370,34 @@ public static OperationErrorDetails OperationErrorDetails(string errorCode = nul errorDetailsTimestamp, azureOperationName, crpOperationId, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// The scheduled action resource. + /// 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. /// The resource-specific properties for this resource. /// A new instance for mocking. - public static ScheduledActionData ScheduledActionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ScheduledActionProperties properties = null) + public static ScheduledActionData ScheduledActionData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, ScheduledActionProperties properties = default) { - tags ??= new Dictionary(); + tags ??= new ChangeTrackingDictionary(); return new ScheduledActionData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, tags, location, - properties, - serializedAdditionalRawData: null); + properties); } - /// Initializes a new instance of . + /// Scheduled action properties. /// The type of resource the scheduled action is targeting. /// The action the scheduled action should perform in the resources. /// The time which the scheduled action is supposed to start running. @@ -296,9 +407,9 @@ public static ScheduledActionData ScheduledActionData(ResourceIdentifier id = nu /// Tell if the scheduled action is disabled or not. /// The status of the last provisioning operation performed on the resource. /// A new instance for mocking. - public static ScheduledActionProperties ScheduledActionProperties(ScheduledActionResourceType resourceType = default, ScheduledActionType actionType = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = null, ScheduledActionsSchedule schedule = null, IEnumerable notificationSettings = null, bool? disabled = null, ScheduledActionResourceProvisioningState? provisioningState = null) + public static ScheduledActionProperties ScheduledActionProperties(ScheduledActionResourceType resourceType = default, ScheduledActionType actionType = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = default, ScheduledActionsSchedule schedule = default, IEnumerable notificationSettings = default, bool? disabled = default, ScheduledActionResourceProvisioningState? provisioningState = default) { - notificationSettings ??= new List(); + notificationSettings ??= new ChangeTrackingList(); return new ScheduledActionProperties( resourceType, @@ -306,126 +417,225 @@ public static ScheduledActionProperties ScheduledActionProperties(ScheduledActio startOn, endOn, schedule, - notificationSettings?.ToList(), + notificationSettings.ToList(), disabled, provisioningState, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Specify the schedule in which the scheduled action is supposed to follow. + /// The time the scheduled action is supposed to run on. + /// The timezone the scheduled time is specified on. + /// The week days the scheduled action is supposed to run on. + /// The months the scheduled action is supposed to run on. + /// The days of the month the scheduled action is supposed to run on. If empty, it means it will run on every day of the month. + /// The execution parameters the scheduled action is supposed to follow. + /// The type of deadline the scheduled action is supposed to follow for the schedule. If no value is passed, it will default to InitiateAt. + /// A new instance for mocking. + public static ScheduledActionsSchedule ScheduledActionsSchedule(TimeSpan scheduledTime = default, string timeZone = default, IEnumerable requestedWeekDays = default, IEnumerable requestedMonths = default, IEnumerable requestedDaysOfTheMonth = default, ScheduledActionExecutionParameterDetail executionParameters = default, ScheduledActionDeadlineType? deadlineType = default) + { + requestedWeekDays ??= new ChangeTrackingList(); + requestedMonths ??= new ChangeTrackingList(); + requestedDaysOfTheMonth ??= new ChangeTrackingList(); + + return new ScheduledActionsSchedule( + scheduledTime, + timeZone, + requestedWeekDays.ToList(), + requestedMonths.ToList(), + requestedDaysOfTheMonth.ToList(), + executionParameters, + deadlineType, + additionalBinaryDataProperties: null); + } + + /// The type used for update operations of the ScheduledAction. + /// Resource tags. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static ScheduledActionPatch ScheduledActionPatch(IDictionary tags = default, ScheduledActionPatchProperties properties = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new ScheduledActionPatch(tags, properties, additionalBinaryDataProperties: null); + } + + /// The updatable properties of the ScheduledAction. + /// The type of resource the scheduled action is targeting. + /// The action the scheduled action should perform in the resources. + /// The time which the scheduled action is supposed to start running. + /// The time when the scheduled action is supposed to stop scheduling. + /// The schedule the scheduled action is supposed to follow. + /// The notification settings for the scheduled action. + /// Tell if the scheduled action is disabled or not. + /// A new instance for mocking. + public static ScheduledActionPatchProperties ScheduledActionPatchProperties(ScheduledActionResourceType? resourceType = default, ScheduledActionType? actionType = default, DateTimeOffset? startOn = default, DateTimeOffset? endOn = default, ScheduledActionsSchedule schedule = default, IEnumerable notificationSettings = default, bool? disabled = default) + { + notificationSettings ??= new ChangeTrackingList(); + + return new ScheduledActionPatchProperties( + resourceType, + actionType, + startOn, + endOn, + schedule, + notificationSettings.ToList(), + disabled, + additionalBinaryDataProperties: null); + } + + /// Represents an scheduled action resource metadata. + /// The name of the resource. + /// The compute RP resource id of the resource in the scheduled actions scope. . + /// The type of resource. /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// /// The desired notification settings for the specified resource. /// A new instance for mocking. - public static ScheduledActionResourceData ScheduledActionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier resourceId = null, IEnumerable notificationSettings = null) + public static ScheduledActionResourceData ScheduledActionResourceData(string name = default, ResourceIdentifier id = default, string @type = default, ResourceIdentifier resourceId = default, IEnumerable notificationSettings = default) { - notificationSettings ??= new List(); + notificationSettings ??= new ChangeTrackingList(); return new ScheduledActionResourceData( - id, name, - resourceType, - systemData, + id, + @type, resourceId, - notificationSettings?.ToList(), - serializedAdditionalRawData: null); + notificationSettings.ToList(), + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Request model to attach a list of scheduled action resources. + /// List of resources to be attached/patched. + /// A new instance for mocking. + public static ScheduledActionResourceAttachContent ScheduledActionResourceAttachContent(IEnumerable resources = default) + { + resources ??= new ChangeTrackingList(); + + return new ScheduledActionResourceAttachContent(resources.ToList(), additionalBinaryDataProperties: null); + } + + /// The response from scheduled action resource requests, which contains the status of each resource. /// The total number of resources operated on. /// The resource status of for each resource. /// A new instance for mocking. - public static ScheduledActionResourceOperationResult ScheduledActionResourceOperationResult(int totalResources = default, IEnumerable resourcesStatuses = null) + public static ScheduledActionResourceOperationResult ScheduledActionResourceOperationResult(int totalResources = default, IEnumerable resourcesStatuses = default) { - resourcesStatuses ??= new List(); + resourcesStatuses ??= new ChangeTrackingList(); - return new ScheduledActionResourceOperationResult(totalResources, resourcesStatuses?.ToList(), serializedAdditionalRawData: null); + return new ScheduledActionResourceOperationResult(totalResources, resourcesStatuses.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The status of a resource after a resource level operation was performed. /// The arm identifier of the resource. /// The state the resource is currently on. /// Errors encountered while trying to perform. /// A new instance for mocking. - public static ScheduledActionResourceStatus ScheduledActionResourceStatus(ResourceIdentifier resourceId = null, ScheduledActionResourceOperationStatus status = default, ResponseError error = null) + public static ScheduledActionResourceStatus ScheduledActionResourceStatus(ResourceIdentifier resourceId = default, ScheduledActionResourceOperationStatus status = default, ResponseError error = default) + { + return new ScheduledActionResourceStatus(resourceId, status, error, additionalBinaryDataProperties: null); + } + + /// Request model to detach a list of scheduled action resources. + /// List of resources to be detached. + /// A new instance for mocking. + public static ScheduledActionResourceDetachContent ScheduledActionResourceDetachContent(IEnumerable resources = default) + { + resources ??= new ChangeTrackingList(); + + return new ScheduledActionResourceDetachContent(resources.ToList(), additionalBinaryDataProperties: null); + } + + /// Request model perform a resource operation in a list of resources. + /// The list of resources we watch to patch. + /// A new instance for mocking. + public static ScheduledActionResourcePatchContent ScheduledActionResourcePatchContent(IEnumerable resources = default) { - return new ScheduledActionResourceStatus(resourceId, status, error, serializedAdditionalRawData: null); + resources ??= new ChangeTrackingList(); + + return new ScheduledActionResourcePatchContent(resources.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// The request to cancel an occurrence. + /// The resources the cancellation should act on. If no resource is passed in the list, Scheduled Action will cancel the occurrence for all resources. + /// A new instance for mocking. + public static OccurrenceCancelContent OccurrenceCancelContent(IEnumerable resourceIds = default) + { + resourceIds ??= new ChangeTrackingList(); + + return new OccurrenceCancelContent(resourceIds.ToList(), additionalBinaryDataProperties: null); + } + + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// 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 ScheduledActionOccurrenceData ScheduledActionOccurrenceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ScheduledActionOccurrenceProperties properties = null) + public static ScheduledActionOccurrenceData ScheduledActionOccurrenceData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, ScheduledActionOccurrenceProperties properties = default) { return new ScheduledActionOccurrenceData( id, name, resourceType, systemData, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . + /// Properties for an occurrence. /// The time the occurrence is scheduled for. This value can be changed by calling the delay API. /// The result for occurrences that achieved a terminal state. /// The aggregated provisioning state of the occurrence. /// A new instance for mocking. - public static ScheduledActionOccurrenceProperties ScheduledActionOccurrenceProperties(DateTimeOffset scheduledOn = default, OccurrenceResultSummary resultSummary = null, ScheduledActionOccurrenceState? provisioningState = null) + public static ScheduledActionOccurrenceProperties ScheduledActionOccurrenceProperties(DateTimeOffset scheduledOn = default, OccurrenceResultSummary resultSummary = default, ScheduledActionOccurrenceState? provisioningState = default) { - return new ScheduledActionOccurrenceProperties(scheduledOn, resultSummary, provisioningState, serializedAdditionalRawData: null); + return new ScheduledActionOccurrenceProperties(scheduledOn, resultSummary, provisioningState, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The summarized provisioning result of an occurrence. /// The total number of resources that the occurrence was supposed to act on. /// The summarized status of the resources. /// A new instance for mocking. - public static OccurrenceResultSummary OccurrenceResultSummary(int total = default, IEnumerable statuses = null) + public static OccurrenceResultSummary OccurrenceResultSummary(int total = default, IEnumerable statuses = default) { - statuses ??= new List(); + statuses ??= new ChangeTrackingList(); - return new OccurrenceResultSummary(total, statuses?.ToList(), serializedAdditionalRawData: null); + return new OccurrenceResultSummary(total, statuses.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The status of the resources. /// The error code for those resources. In case of success, code is populated with Success. /// The number of resources that the code applies to. /// The error details for the resources. Not populated on success cases. /// A new instance for mocking. - public static ResourceResultSummary ResourceResultSummary(string code = null, int count = default, ResponseError errorDetails = null) + public static ResourceResultSummary ResourceResultSummary(string code = default, int count = default, ResponseError errorDetails = default) { - return new ResourceResultSummary(code, count, errorDetails, serializedAdditionalRawData: null); + return new ResourceResultSummary(code, count, errorDetails, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// The scheduled action extension. + /// 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 ScheduledActionResources ScheduledActionResources(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ScheduledActionsExtensionProperties properties = null) + public static ScheduledActionResources ScheduledActionResources(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, ScheduledActionsExtensionProperties properties = default) { return new ScheduledActionResources( id, name, resourceType, systemData, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . + /// Scheduled action extension properties. /// The type of resource the scheduled action is targeting. /// The action the scheduled action should perform in the resources. /// The time which the scheduled action is supposed to start running. @@ -436,10 +646,10 @@ public static ScheduledActionResources ScheduledActionResources(ResourceIdentifi /// The status of the last provisioning operation performed on the resource. /// The notification settings for the scheduled action at a resource level. Resource level notification settings are scope to specific resources only and submitted through attach requests. /// A new instance for mocking. - public static ScheduledActionsExtensionProperties ScheduledActionsExtensionProperties(ScheduledActionResourceType resourceType = default, ScheduledActionType actionType = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = null, ScheduledActionsSchedule schedule = null, IEnumerable notificationSettings = null, bool? disabled = null, ScheduledActionResourceProvisioningState? provisioningState = null, IEnumerable resourceNotificationSettings = null) + public static ScheduledActionsExtensionProperties ScheduledActionsExtensionProperties(ScheduledActionResourceType resourceType = default, ScheduledActionType actionType = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = default, ScheduledActionsSchedule schedule = default, IEnumerable notificationSettings = default, bool? disabled = default, ScheduledActionResourceProvisioningState? provisioningState = default, IEnumerable resourceNotificationSettings = default) { - notificationSettings ??= new List(); - resourceNotificationSettings ??= new List(); + notificationSettings ??= new ChangeTrackingList(); + resourceNotificationSettings ??= new ChangeTrackingList(); return new ScheduledActionsExtensionProperties( resourceType, @@ -447,18 +657,17 @@ public static ScheduledActionsExtensionProperties ScheduledActionsExtensionPrope startOn, endOn, schedule, - notificationSettings?.ToList(), + notificationSettings.ToList(), disabled, provisioningState, - resourceNotificationSettings?.ToList(), - serializedAdditionalRawData: null); + resourceNotificationSettings.ToList(), + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Represents an scheduled action resource metadata. + /// The name of the resource. + /// The compute RP resource id of the resource in the scheduled actions scope. . + /// The type of resource. /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" @@ -468,42 +677,52 @@ public static ScheduledActionsExtensionProperties ScheduledActionsExtensionPrope /// The current state of the resource. /// Error details for the resource. Only populated if resource is in failed state. /// A new instance for mocking. - public static OccurrenceResourceData OccurrenceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier resourceId = null, IEnumerable notificationSettings = null, DateTimeOffset scheduledOn = default, OccurrenceResourceProvisioningState? provisioningState = null, ResponseError errorDetails = null) + public static OccurrenceResourceData OccurrenceResourceData(string name = default, ResourceIdentifier id = default, string @type = default, ResourceIdentifier resourceId = default, IEnumerable notificationSettings = default, DateTimeOffset scheduledOn = default, OccurrenceResourceProvisioningState? provisioningState = default, ResponseError errorDetails = default) { - notificationSettings ??= new List(); + notificationSettings ??= new ChangeTrackingList(); return new OccurrenceResourceData( - id, name, - resourceType, - systemData, + id, + @type, resourceId, - notificationSettings?.ToList(), + notificationSettings.ToList(), scheduledOn, provisioningState, errorDetails, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); + } + + /// Request to ask for a delay in an occurrence, delay should be set to client local time eg (ACST) 2025-05-30T22:03:00+09:30, (PST) 2025-05-30T06:35:00-07:00. + /// The exact time to delay the operations to. + /// The resources that should be delayed. If empty, the delay will apply to the all resources in the occurrence. + /// A new instance for mocking. + public static OccurrenceDelayContent OccurrenceDelayContent(DateTimeOffset delay = default, IEnumerable resourceIds = default) + { + resourceIds ??= new ChangeTrackingList(); + + return new OccurrenceDelayContent(delay, resourceIds.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// The scheduled action extension. + /// 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 OccurrenceExtensionResourceData OccurrenceExtensionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, OccurrenceExtensionProperties properties = null) + public static OccurrenceExtensionResourceData OccurrenceExtensionResourceData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, OccurrenceExtensionProperties properties = default) { return new OccurrenceExtensionResourceData( id, name, resourceType, systemData, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . + /// The properties of the occurrence extension. /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" @@ -514,18 +733,18 @@ public static OccurrenceExtensionResourceData OccurrenceExtensionResourceData(Re /// Error details for the resource. Only populated if resource is in failed state. /// The arm identifier of the scheduled action the occurrence belongs to. /// A new instance for mocking. - public static OccurrenceExtensionProperties OccurrenceExtensionProperties(ResourceIdentifier resourceId = null, IEnumerable notificationSettings = null, DateTimeOffset scheduledOn = default, OccurrenceResourceProvisioningState? provisioningState = null, ResponseError errorDetails = null, ResourceIdentifier scheduledActionId = null) + public static OccurrenceExtensionProperties OccurrenceExtensionProperties(ResourceIdentifier resourceId = default, IEnumerable notificationSettings = default, DateTimeOffset scheduledOn = default, OccurrenceResourceProvisioningState? provisioningState = default, ResponseError errorDetails = default, ResourceIdentifier scheduledActionId = default) { - notificationSettings ??= new List(); + notificationSettings ??= new ChangeTrackingList(); return new OccurrenceExtensionProperties( resourceId, - notificationSettings?.ToList(), + notificationSettings.ToList(), scheduledOn, provisioningState, errorDetails, scheduledActionId, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..6f763c97fc1d --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT : AsyncPageable + { + private readonly OccurrenceExtension _client; + private readonly string _resourceUri; + private readonly RequestContext _context; + + /// Initializes a new instance of OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The OccurrenceExtension client used to send requests. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT(OccurrenceExtension client, string resourceUri, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _resourceUri = resourceUri; + _context = context; + } + + /// Gets the pages of OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT 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; + } + OccurrenceExtensionResourceListResult result = OccurrenceExtensionResourceListResult.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.CreateNextGetAssociatedOccurrencesRequest(nextLink, _resourceUri, _context) : _client.CreateGetAssociatedOccurrencesRequest(_resourceUri, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableComputeScheduleArmClient.GetAssociatedOccurrences"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT.cs new file mode 100644 index 000000000000..aa0fbef5bd38 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT : Pageable + { + private readonly OccurrenceExtension _client; + private readonly string _resourceUri; + private readonly RequestContext _context; + + /// Initializes a new instance of OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The OccurrenceExtension client used to send requests. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT(OccurrenceExtension client, string resourceUri, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _resourceUri = resourceUri; + _context = context; + } + + /// Gets the pages of OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT 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; + } + OccurrenceExtensionResourceListResult result = OccurrenceExtensionResourceListResult.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.CreateNextGetAssociatedOccurrencesRequest(nextLink, _resourceUri, _context) : _client.CreateGetAssociatedOccurrencesRequest(_resourceUri, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableComputeScheduleArmClient.GetAssociatedOccurrences"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetAttachedResourcesAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetAttachedResourcesAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..41fe7937a7c4 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetAttachedResourcesAsyncCollectionResultOfT.cs @@ -0,0 +1,87 @@ +// 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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class OccurrencesGetAttachedResourcesAsyncCollectionResultOfT : AsyncPageable + { + private readonly Occurrences _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _scheduledActionName; + private readonly string _occurrenceId; + private readonly RequestContext _context; + + /// Initializes a new instance of OccurrencesGetAttachedResourcesAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Occurrences 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 name of the ScheduledAction. + /// The name of the Occurrence. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OccurrencesGetAttachedResourcesAsyncCollectionResultOfT(Occurrences client, Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _scheduledActionName = scheduledActionName; + _occurrenceId = occurrenceId; + _context = context; + } + + /// Gets the pages of OccurrencesGetAttachedResourcesAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OccurrencesGetAttachedResourcesAsyncCollectionResultOfT 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; + } + OccurrenceResourceListResponse result = OccurrenceResourceListResponse.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.CreateNextGetAttachedResourcesRequest(nextLink, _subscriptionId, _resourceGroupName, _scheduledActionName, _occurrenceId, _context) : _client.CreateGetAttachedResourcesRequest(_subscriptionId, _resourceGroupName, _scheduledActionName, _occurrenceId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableComputeScheduleResourceGroupResource.GetAttachedResources"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetAttachedResourcesCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetAttachedResourcesCollectionResultOfT.cs new file mode 100644 index 000000000000..1099113687f7 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetAttachedResourcesCollectionResultOfT.cs @@ -0,0 +1,86 @@ +// 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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class OccurrencesGetAttachedResourcesCollectionResultOfT : Pageable + { + private readonly Occurrences _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _scheduledActionName; + private readonly string _occurrenceId; + private readonly RequestContext _context; + + /// Initializes a new instance of OccurrencesGetAttachedResourcesCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Occurrences 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 name of the ScheduledAction. + /// The name of the Occurrence. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OccurrencesGetAttachedResourcesCollectionResultOfT(Occurrences client, Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _scheduledActionName = scheduledActionName; + _occurrenceId = occurrenceId; + _context = context; + } + + /// Gets the pages of OccurrencesGetAttachedResourcesCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OccurrencesGetAttachedResourcesCollectionResultOfT 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; + } + OccurrenceResourceListResponse result = OccurrenceResourceListResponse.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.CreateNextGetAttachedResourcesRequest(nextLink, _subscriptionId, _resourceGroupName, _scheduledActionName, _occurrenceId, _context) : _client.CreateGetAttachedResourcesRequest(_subscriptionId, _resourceGroupName, _scheduledActionName, _occurrenceId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableComputeScheduleResourceGroupResource.GetAttachedResources"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetByScheduledActionAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetByScheduledActionAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..51d48dc90518 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetByScheduledActionAsyncCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class OccurrencesGetByScheduledActionAsyncCollectionResultOfT : AsyncPageable + { + private readonly Occurrences _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _scheduledActionName; + private readonly RequestContext _context; + + /// Initializes a new instance of OccurrencesGetByScheduledActionAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Occurrences 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 name of the ScheduledAction. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OccurrencesGetByScheduledActionAsyncCollectionResultOfT(Occurrences client, Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _scheduledActionName = scheduledActionName; + _context = context; + } + + /// Gets the pages of OccurrencesGetByScheduledActionAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OccurrencesGetByScheduledActionAsyncCollectionResultOfT 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; + } + OccurrenceListResult result = OccurrenceListResult.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.CreateNextGetByScheduledActionRequest(nextLink, _subscriptionId, _resourceGroupName, _scheduledActionName, _context) : _client.CreateGetByScheduledActionRequest(_subscriptionId, _resourceGroupName, _scheduledActionName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetByScheduledActionCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetByScheduledActionCollectionResultOfT.cs new file mode 100644 index 000000000000..6a48a81f1e12 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/OccurrencesGetByScheduledActionCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class OccurrencesGetByScheduledActionCollectionResultOfT : Pageable + { + private readonly Occurrences _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _scheduledActionName; + private readonly RequestContext _context; + + /// Initializes a new instance of OccurrencesGetByScheduledActionCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The Occurrences 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 name of the ScheduledAction. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public OccurrencesGetByScheduledActionCollectionResultOfT(Occurrences client, Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _scheduledActionName = scheduledActionName; + _context = context; + } + + /// Gets the pages of OccurrencesGetByScheduledActionCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of OccurrencesGetByScheduledActionCollectionResultOfT 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; + } + OccurrenceListResult result = OccurrenceListResult.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.CreateNextGetByScheduledActionRequest(nextLink, _subscriptionId, _resourceGroupName, _scheduledActionName, _context) : _client.CreateGetByScheduledActionRequest(_subscriptionId, _resourceGroupName, _scheduledActionName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..1e19ca25d9aa --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT : AsyncPageable + { + private readonly ScheduledActionExtension _client; + private readonly string _resourceUri; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActionExtension client used to send requests. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT(ScheduledActionExtension client, string resourceUri, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _resourceUri = resourceUri; + _context = context; + } + + /// Gets the pages of ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT 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; + } + ScheduledActionResourcesListResult result = ScheduledActionResourcesListResult.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.CreateNextGetAssociatedScheduledActionsRequest(nextLink, _resourceUri, _context) : _client.CreateGetAssociatedScheduledActionsRequest(_resourceUri, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableComputeScheduleArmClient.GetAssociatedScheduledActions"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT.cs new file mode 100644 index 000000000000..e82b794da2a8 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT : Pageable + { + private readonly ScheduledActionExtension _client; + private readonly string _resourceUri; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActionExtension client used to send requests. + /// The fully qualified Azure Resource manager identifier of the resource. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT(ScheduledActionExtension client, string resourceUri, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _resourceUri = resourceUri; + _context = context; + } + + /// Gets the pages of ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT 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; + } + ScheduledActionResourcesListResult result = ScheduledActionResourcesListResult.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.CreateNextGetAssociatedScheduledActionsRequest(nextLink, _resourceUri, _context) : _client.CreateGetAssociatedScheduledActionsRequest(_resourceUri, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableComputeScheduleArmClient.GetAssociatedScheduledActions"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..f2aec783d6e1 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT : AsyncPageable + { + private readonly ScheduledActions _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _scheduledActionName; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActions 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 name of the ScheduledAction. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT(ScheduledActions client, Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _scheduledActionName = scheduledActionName; + _context = context; + } + + /// Gets the pages of ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT 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; + } + ResourceListResponse result = ResourceListResponse.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.CreateNextGetAttachedResourcesRequest(nextLink, _subscriptionId, _resourceGroupName, _scheduledActionName, _context) : _client.CreateGetAttachedResourcesRequest(_subscriptionId, _resourceGroupName, _scheduledActionName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("ScheduledActionResource.GetAttachedResources"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetAttachedResourcesCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetAttachedResourcesCollectionResultOfT.cs new file mode 100644 index 000000000000..484e149b06ba --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetAttachedResourcesCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionsGetAttachedResourcesCollectionResultOfT : Pageable + { + private readonly ScheduledActions _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _scheduledActionName; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionsGetAttachedResourcesCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActions 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 name of the ScheduledAction. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public ScheduledActionsGetAttachedResourcesCollectionResultOfT(ScheduledActions client, Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _scheduledActionName = scheduledActionName; + _context = context; + } + + /// Gets the pages of ScheduledActionsGetAttachedResourcesCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionsGetAttachedResourcesCollectionResultOfT 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; + } + ResourceListResponse result = ResourceListResponse.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.CreateNextGetAttachedResourcesRequest(nextLink, _subscriptionId, _resourceGroupName, _scheduledActionName, _context) : _client.CreateGetAttachedResourcesRequest(_subscriptionId, _resourceGroupName, _scheduledActionName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("ScheduledActionResource.GetAttachedResources"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..a18352fcc19c --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable + { + private readonly ScheduledActions _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActions 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 ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT(ScheduledActions client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT 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; + } + ScheduledActionListResult result = ScheduledActionListResult.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("ScheduledActionCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetByResourceGroupCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetByResourceGroupCollectionResultOfT.cs new file mode 100644 index 000000000000..a6f127680a54 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetByResourceGroupCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionsGetByResourceGroupCollectionResultOfT : Pageable + { + private readonly ScheduledActions _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionsGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActions 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 ScheduledActionsGetByResourceGroupCollectionResultOfT(ScheduledActions client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of ScheduledActionsGetByResourceGroupCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionsGetByResourceGroupCollectionResultOfT 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; + } + ScheduledActionListResult result = ScheduledActionListResult.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("ScheduledActionCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..cea37350240a --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT : AsyncPageable + { + private readonly ScheduledActions _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActions 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 ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT(ScheduledActions client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT 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; + } + ScheduledActionListResult result = ScheduledActionListResult.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("MockableComputeScheduleSubscriptionResource.GetScheduledActions"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetBySubscriptionCollectionResultOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetBySubscriptionCollectionResultOfT.cs new file mode 100644 index 000000000000..d3388b23c939 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/CollectionResults/ScheduledActionsGetBySubscriptionCollectionResultOfT.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.ComputeSchedule.Models; + +namespace Azure.ResourceManager.ComputeSchedule +{ + internal partial class ScheduledActionsGetBySubscriptionCollectionResultOfT : Pageable + { + private readonly ScheduledActions _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of ScheduledActionsGetBySubscriptionCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The ScheduledActions 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 ScheduledActionsGetBySubscriptionCollectionResultOfT(ScheduledActions client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of ScheduledActionsGetBySubscriptionCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of ScheduledActionsGetBySubscriptionCollectionResultOfT 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; + } + ScheduledActionListResult result = ScheduledActionListResult.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("MockableComputeScheduleSubscriptionResource.GetScheduledActions"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs index 9c8a4b84e509..23f301fd7f51 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.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.ComputeSchedule.Mocking; using Azure.ResourceManager.ComputeSchedule.Models; using Azure.ResourceManager.Resources; @@ -18,46 +20,72 @@ namespace Azure.ResourceManager.ComputeSchedule /// A class to add extension methods to Azure.ResourceManager.ComputeSchedule. public static partial class ComputeScheduleExtensions { + /// private static MockableComputeScheduleArmClient GetMockableComputeScheduleArmClient(ArmClient client) { - return client.GetCachedClient(client0 => new MockableComputeScheduleArmClient(client0)); + return client.GetCachedClient(client0 => new MockableComputeScheduleArmClient(client0, ResourceIdentifier.Root)); } - private static MockableComputeScheduleResourceGroupResource GetMockableComputeScheduleResourceGroupResource(ArmResource resource) + /// + private static MockableComputeScheduleResourceGroupResource GetMockableComputeScheduleResourceGroupResource(ResourceGroupResource resourceGroupResource) { - return resource.GetCachedClient(client => new MockableComputeScheduleResourceGroupResource(client, resource.Id)); + return resourceGroupResource.GetCachedClient(client => new MockableComputeScheduleResourceGroupResource(client, resourceGroupResource.Id)); } - private static MockableComputeScheduleSubscriptionResource GetMockableComputeScheduleSubscriptionResource(ArmResource resource) + /// + private static MockableComputeScheduleSubscriptionResource GetMockableComputeScheduleSubscriptionResource(SubscriptionResource subscriptionResource) { - return resource.GetCachedClient(client => new MockableComputeScheduleSubscriptionResource(client, resource.Id)); + return subscriptionResource.GetCachedClient(client => new MockableComputeScheduleSubscriptionResource(client, subscriptionResource.Id)); } /// - /// List ScheduledActionResources resources by parent - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedScheduledActions - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Operation Id - /// ScheduledActionResources_GetAssociatedScheduledActions + /// Mocking. + /// To mock this method, please mock instead. /// + /// + /// The the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ScheduledActionResource GetScheduledActionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableComputeScheduleArmClient(client).GetScheduledActionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Default Api Version - /// 2025-04-15-preview + /// Mocking. + /// To mock this method, please mock instead. /// - /// + /// + /// The the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableComputeScheduleArmClient(client).GetScheduledActionOccurrenceResource(id); + } + + /// + /// List ScheduledActionResources resources by parent /// - /// 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 scope that the resource will apply against. /// The cancellation token to use. /// is null. + /// A collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAssociatedScheduledActionsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); @@ -67,29 +95,16 @@ public static AsyncPageable GetAssociatedScheduledActi /// /// List ScheduledActionResources resources by parent - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedScheduledActions - /// /// - /// Operation Id - /// ScheduledActionResources_GetAssociatedScheduledActions - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// - /// 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 scope that the resource will apply against. /// The cancellation token to use. /// is null. + /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAssociatedScheduledActions(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); @@ -99,29 +114,16 @@ public static Pageable GetAssociatedScheduledActions(t /// /// List OccurrenceExtensionResource resources by parent - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedOccurrences - /// /// - /// Operation Id - /// OccurrenceExtensionResource_GetAssociatedOccurrences - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// - /// 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 scope that the resource will apply against. /// The cancellation token to use. /// is null. + /// A collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAssociatedOccurrencesAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); @@ -131,29 +133,16 @@ public static AsyncPageable GetAssociatedOccurr /// /// List OccurrenceExtensionResource resources by parent - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedOccurrences - /// /// - /// Operation Id - /// OccurrenceExtensionResource_GetAssociatedOccurrences - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// - /// 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 scope that the resource will apply against. /// The cancellation token to use. /// is null. + /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAssociatedOccurrences(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); @@ -162,166 +151,148 @@ public static Pageable GetAssociatedOccurrences } /// - /// 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 a collection of ScheduledActions 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 resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ScheduledActionResource GetScheduledActionResource(this ArmClient client, ResourceIdentifier id) + /// The the method will execute against. + /// is null. + /// An object representing collection of ScheduledActions and their operations over a ScheduledActionResource. + public static ScheduledActionCollection GetScheduledActions(this ResourceGroupResource resourceGroupResource) { - Argument.AssertNotNull(client, nameof(client)); + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableComputeScheduleArmClient(client).GetScheduledActionResource(id); + return GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetScheduledActions(); } /// - /// 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. + /// Get a ScheduledAction /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(this ArmClient client, ResourceIdentifier id) + /// The the method will execute against. + /// The name of the ScheduledAction. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static async Task> GetScheduledActionAsync(this ResourceGroupResource resourceGroupResource, string scheduledActionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(client, nameof(client)); + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableComputeScheduleArmClient(client).GetScheduledActionOccurrenceResource(id); + return await GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetScheduledActionAsync(scheduledActionName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a collection of ScheduledActionResources in the ResourceGroupResource. + /// Get a ScheduledAction /// - /// 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 ScheduledAction. + /// The cancellation token to use. /// is null. - /// An object representing collection of ScheduledActionResources and their operations over a ScheduledActionResource. - public static ScheduledActionCollection GetScheduledActions(this ResourceGroupResource resourceGroupResource) + [ForwardsClientCalls] + public static Response GetScheduledAction(this ResourceGroupResource resourceGroupResource, string scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetScheduledActions(); + return GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetScheduledAction(scheduledActionName, cancellationToken); } /// - /// Get a ScheduledAction - /// + /// List resources attached to Scheduled Actions for the given occurrence /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-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 ScheduledAction. + /// The name of the Occurrence. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetScheduledActionAsync(this ResourceGroupResource resourceGroupResource, string scheduledActionName, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetAttachedResourcesAsync(this ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetScheduledActionAsync(scheduledActionName, cancellationToken).ConfigureAwait(false); + return GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetAttachedResourcesAsync(scheduledActionName, occurrenceId, cancellationToken); } /// - /// Get a ScheduledAction - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// + /// List resources attached to Scheduled Actions for the given occurrence /// - /// 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 ScheduledAction. + /// The name of the Occurrence. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetScheduledAction(this ResourceGroupResource resourceGroupResource, string scheduledActionName, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetAttachedResources(this ResourceGroupResource resourceGroupResource, string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetScheduledAction(scheduledActionName, cancellationToken); + return GetMockableComputeScheduleResourceGroupResource(resourceGroupResource).GetAttachedResources(scheduledActionName, occurrenceId, cancellationToken); } /// - /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineDeallocate - /// + /// List ScheduledAction resources by subscription ID /// - /// Default Api Version - /// 2025-04-15-preview + /// Mocking. + /// To mock this method, please mock instead. /// + /// + /// 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. + public static AsyncPageable GetScheduledActionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).GetScheduledActionsAsync(cancellationToken); + } + + /// + /// List ScheduledAction resources by subscription ID /// - /// Resource - /// + /// Mocking. + /// To mock this method, please mock instead. /// - /// + /// + /// 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. + public static Pageable GetScheduledActions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).GetScheduledActions(cancellationToken); + } + + /// + /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. /// - /// 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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> SubmitVirtualMachineDeallocateAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, SubmitDeallocateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -331,34 +302,16 @@ public static async Task> SubmitVirt /// /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineDeallocate - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response SubmitVirtualMachineDeallocate(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, SubmitDeallocateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -368,34 +321,16 @@ public static Response SubmitVirtualMachineDe /// /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitHibernate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> SubmitVirtualMachineHibernateAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, SubmitHibernateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -405,34 +340,16 @@ public static async Task> SubmitVirtu /// /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitHibernate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response SubmitVirtualMachineHibernate(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, SubmitHibernateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -442,34 +359,16 @@ public static Response SubmitVirtualMachineHib /// /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitStart - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> SubmitVirtualMachineStartAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, SubmitStartContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -479,34 +378,16 @@ public static async Task> SubmitVirtualMa /// /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitStart - /// /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response SubmitVirtualMachineStart(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, SubmitStartContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -516,34 +397,16 @@ public static Response SubmitVirtualMachineStart(t /// /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeallocate - /// /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> ExecuteVirtualMachineDeallocateAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteDeallocateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -553,34 +416,16 @@ public static async Task> ExecuteVir /// /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeallocate - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response ExecuteVirtualMachineDeallocate(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteDeallocateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -590,34 +435,16 @@ public static Response ExecuteVirtualMachineD /// /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteHibernate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineHibernate - /// /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> ExecuteVirtualMachineHibernateAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteHibernateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -627,34 +454,16 @@ public static async Task> ExecuteVirt /// /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteHibernate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response ExecuteVirtualMachineHibernate(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteHibernateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -664,34 +473,16 @@ public static Response ExecuteVirtualMachineHi /// /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteStart - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineStart - /// /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> ExecuteVirtualMachineStartAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteStartContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -701,34 +492,16 @@ public static async Task> ExecuteVirtualM /// /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteStart - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response ExecuteVirtualMachineStart(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteStartContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -737,35 +510,17 @@ public static Response ExecuteVirtualMachineStart( } /// - /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineCreateOperation - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// - /// 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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> ExecuteVirtualMachineCreateOperationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -774,35 +529,17 @@ public static async Task> ExecuteVirtual } /// - /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineCreateOperation - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response ExecuteVirtualMachineCreateOperation(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -811,35 +548,17 @@ public static Response ExecuteVirtualMachineCreat } /// - /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeleteOperation - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> ExecuteVirtualMachineDeleteOperationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -848,35 +567,17 @@ public static async Task> ExecuteVirtual } /// - /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeleteOperation - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response ExecuteVirtualMachineDeleteOperation(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -886,34 +587,16 @@ public static Response ExecuteVirtualMachineDelet /// /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationStatus - /// /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationStatus - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> GetVirtualMachineOperationStatusAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, GetOperationStatusContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -923,34 +606,16 @@ public static async Task> GetVirtualMachineOp /// /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationStatus - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationStatus - /// /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response GetVirtualMachineOperationStatus(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, GetOperationStatusContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -960,34 +625,16 @@ public static Response GetVirtualMachineOperationStatu /// /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations - /// - /// - /// Operation Id - /// ScheduledActions_CancelVirtualMachineOperations - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> CancelVirtualMachineOperationsAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, CancelOperationsContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -997,34 +644,16 @@ public static async Task> CancelVirtualMachineO /// /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations - /// - /// - /// Operation Id - /// ScheduledActions_CancelVirtualMachineOperations - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response CancelVirtualMachineOperations(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, CancelOperationsContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -1034,34 +663,16 @@ public static Response CancelVirtualMachineOperations(th /// /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationErrors - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationErrors - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static async Task> GetVirtualMachineOperationErrorsAsync(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, GetOperationErrorsContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -1071,111 +682,21 @@ public static async Task> GetVirtualMachineOp /// /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationErrors - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationErrors - /// - /// - /// Default Api Version - /// 2025-04-15-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 location name. /// The request body. /// The cancellation token to use. - /// or is null. + /// is null. public static Response GetVirtualMachineOperationErrors(this SubscriptionResource subscriptionResource, AzureLocation locationparameter, GetOperationErrorsContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).GetVirtualMachineOperationErrors(locationparameter, content, cancellationToken); } - - /// - /// List ScheduledAction resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/scheduledActions - /// - /// - /// Operation Id - /// ScheduledAction_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance 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. - public static AsyncPageable GetScheduledActionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).GetScheduledActionsAsync(cancellationToken); - } - - /// - /// List ScheduledAction resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/scheduledActions - /// - /// - /// Operation Id - /// ScheduledAction_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetScheduledActions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).GetScheduledActions(cancellationToken); - } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleArmClient.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleArmClient.cs index 1537e8c2e60b..b16efb66c96f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleArmClient.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleArmClient.cs @@ -7,189 +7,191 @@ using System; using System.Threading; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ComputeSchedule; using Azure.ResourceManager.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule.Mocking { - /// A class to add extension methods to ArmClient. + /// A class to add extension methods to . public partial class MockableComputeScheduleArmClient : ArmResource { private ClientDiagnostics _scheduledActionExtensionClientDiagnostics; - private ScheduledActionExtensionRestOperations _scheduledActionExtensionRestClient; + private ScheduledActionExtension _scheduledActionExtensionRestClient; private ClientDiagnostics _occurrenceExtensionClientDiagnostics; - private OccurrenceExtensionRestOperations _occurrenceExtensionRestClient; + private OccurrenceExtension _occurrenceExtensionRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableComputeScheduleArmClient for mocking. protected MockableComputeScheduleArmClient() { } - /// 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 MockableComputeScheduleArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) { } - internal MockableComputeScheduleArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + private ClientDiagnostics ScheduledActionExtensionClientDiagnostics => _scheduledActionExtensionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private ScheduledActionExtension ScheduledActionExtensionRestClient => _scheduledActionExtensionRestClient ??= new ScheduledActionExtension(ScheduledActionExtensionClientDiagnostics, Pipeline, Endpoint, "2026-01-01-preview"); + + private ClientDiagnostics OccurrenceExtensionClientDiagnostics => _occurrenceExtensionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private OccurrenceExtension OccurrenceExtensionRestClient => _occurrenceExtensionRestClient ??= new OccurrenceExtension(OccurrenceExtensionClientDiagnostics, Pipeline, Endpoint, "2026-01-01-preview"); + + /// 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 ScheduledActionResource GetScheduledActionResource(ResourceIdentifier id) { + ScheduledActionResource.ValidateResourceId(id); + return new ScheduledActionResource(Client, id); } - private ClientDiagnostics ScheduledActionExtensionClientDiagnostics => _scheduledActionExtensionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ScheduledActionExtensionRestOperations ScheduledActionExtensionRestClient => _scheduledActionExtensionRestClient ??= new ScheduledActionExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics OccurrenceExtensionClientDiagnostics => _occurrenceExtensionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private OccurrenceExtensionRestOperations OccurrenceExtensionRestClient => _occurrenceExtensionRestClient ??= new OccurrenceExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) + /// 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 ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(ResourceIdentifier id) { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; + ScheduledActionOccurrenceResource.ValidateResourceId(id); + return new ScheduledActionOccurrenceResource(Client, id); } /// /// List ScheduledActionResources resources by parent /// /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedScheduledActions + /// Request Path. + /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedScheduledActions. /// /// - /// Operation Id - /// ScheduledActionResources_GetAssociatedScheduledActions + /// Operation Id. + /// ScheduledActionExtension_ListByVms. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The scope that the resource will apply against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. + /// is an empty string, and was expected to be non-empty. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAssociatedScheduledActionsAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(scope, nameof(scope)); - HttpMessage FirstPageRequest(int? pageSizeHint) => ScheduledActionExtensionRestClient.CreateGetAssociatedScheduledActionsRequest(scope); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScheduledActionExtensionRestClient.CreateGetAssociatedScheduledActionsNextPageRequest(nextLink, scope); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ScheduledActionResources.DeserializeScheduledActionResources(e), ScheduledActionExtensionClientDiagnostics, Pipeline, "MockableComputeScheduleArmClient.GetAssociatedScheduledActions", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new ScheduledActionExtensionGetAssociatedScheduledActionsAsyncCollectionResultOfT(ScheduledActionExtensionRestClient, scope.ToString(), context); } /// /// List ScheduledActionResources resources by parent /// /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedScheduledActions + /// Request Path. + /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedScheduledActions. /// /// - /// Operation Id - /// ScheduledActionResources_GetAssociatedScheduledActions + /// Operation Id. + /// ScheduledActionExtension_ListByVms. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The scope that the resource will apply against. /// The cancellation token to use. /// is null. + /// is an empty string, and was expected to be non-empty. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAssociatedScheduledActions(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(scope, nameof(scope)); - HttpMessage FirstPageRequest(int? pageSizeHint) => ScheduledActionExtensionRestClient.CreateGetAssociatedScheduledActionsRequest(scope); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScheduledActionExtensionRestClient.CreateGetAssociatedScheduledActionsNextPageRequest(nextLink, scope); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ScheduledActionResources.DeserializeScheduledActionResources(e), ScheduledActionExtensionClientDiagnostics, Pipeline, "MockableComputeScheduleArmClient.GetAssociatedScheduledActions", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new ScheduledActionExtensionGetAssociatedScheduledActionsCollectionResultOfT(ScheduledActionExtensionRestClient, scope.ToString(), context); } /// /// List OccurrenceExtensionResource resources by parent /// /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedOccurrences + /// Request Path. + /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedOccurrences. /// /// - /// Operation Id - /// OccurrenceExtensionResource_GetAssociatedOccurrences + /// Operation Id. + /// OccurrenceExtension_ListOccurrenceByVms. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The scope that the resource will apply against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. + /// is an empty string, and was expected to be non-empty. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAssociatedOccurrencesAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(scope, nameof(scope)); - HttpMessage FirstPageRequest(int? pageSizeHint) => OccurrenceExtensionRestClient.CreateGetAssociatedOccurrencesRequest(scope); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OccurrenceExtensionRestClient.CreateGetAssociatedOccurrencesNextPageRequest(nextLink, scope); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => OccurrenceExtensionResourceData.DeserializeOccurrenceExtensionResourceData(e), OccurrenceExtensionClientDiagnostics, Pipeline, "MockableComputeScheduleArmClient.GetAssociatedOccurrences", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new OccurrenceExtensionGetAssociatedOccurrencesAsyncCollectionResultOfT(OccurrenceExtensionRestClient, scope.ToString(), context); } /// /// List OccurrenceExtensionResource resources by parent /// /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedOccurrences + /// Request Path. + /// /{resourceUri}/providers/Microsoft.ComputeSchedule/associatedOccurrences. /// /// - /// Operation Id - /// OccurrenceExtensionResource_GetAssociatedOccurrences + /// Operation Id. + /// OccurrenceExtension_ListOccurrenceByVms. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The scope that the resource will apply against. /// The cancellation token to use. /// is null. + /// is an empty string, and was expected to be non-empty. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAssociatedOccurrences(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(scope, nameof(scope)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => OccurrenceExtensionRestClient.CreateGetAssociatedOccurrencesRequest(scope); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OccurrenceExtensionRestClient.CreateGetAssociatedOccurrencesNextPageRequest(nextLink, scope); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => OccurrenceExtensionResourceData.DeserializeOccurrenceExtensionResourceData(e), OccurrenceExtensionClientDiagnostics, Pipeline, "MockableComputeScheduleArmClient.GetAssociatedOccurrences", "value", "nextLink", cancellationToken); - } - /// - /// 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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ScheduledActionResource GetScheduledActionResource(ResourceIdentifier id) - { - ScheduledActionResource.ValidateResourceId(id); - return new ScheduledActionResource(Client, id); - } + Argument.AssertNotNullOrEmpty(scope, nameof(scope)); - /// - /// 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. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ScheduledActionOccurrenceResource GetScheduledActionOccurrenceResource(ResourceIdentifier id) - { - ScheduledActionOccurrenceResource.ValidateResourceId(id); - return new ScheduledActionOccurrenceResource(Client, id); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new OccurrenceExtensionGetAssociatedOccurrencesCollectionResultOfT(OccurrenceExtensionRestClient, scope.ToString(), context); } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleResourceGroupResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleResourceGroupResource.cs index 74a24d8d500b..7fb5a26cff38 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleResourceGroupResource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleResourceGroupResource.cs @@ -8,33 +8,40 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ComputeSchedule; +using Azure.ResourceManager.ComputeSchedule.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ComputeSchedule.Mocking { - /// A class to add extension methods to ResourceGroupResource. + /// A class to add extension methods to . public partial class MockableComputeScheduleResourceGroupResource : ArmResource { - /// Initializes a new instance of the class for mocking. + private ClientDiagnostics _occurrencesClientDiagnostics; + private Occurrences _occurrencesRestClient; + + /// Initializes a new instance of MockableComputeScheduleResourceGroupResource for mocking. protected MockableComputeScheduleResourceGroupResource() { } - /// 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 MockableComputeScheduleResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } + private ClientDiagnostics OccurrencesClientDiagnostics => _occurrencesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); - /// Gets a collection of ScheduledActionResources in the ResourceGroupResource. - /// An object representing collection of ScheduledActionResources and their operations over a ScheduledActionResource. + private Occurrences OccurrencesRestClient => _occurrencesRestClient ??= new Occurrences(OccurrencesClientDiagnostics, Pipeline, Endpoint, "2026-01-01-preview"); + + /// Gets a collection of ScheduledActions in the . + /// An object representing collection of ScheduledActions and their operations over a ScheduledActionResource. public virtual ScheduledActionCollection GetScheduledActions() { return GetCachedClient(client => new ScheduledActionCollection(client, Id)); @@ -44,20 +51,16 @@ public virtual ScheduledActionCollection GetScheduledActions() /// Get a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// @@ -68,6 +71,8 @@ public virtual ScheduledActionCollection GetScheduledActions() [ForwardsClientCalls] public virtual async Task> GetScheduledActionAsync(string scheduledActionName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); + return await GetScheduledActions().GetAsync(scheduledActionName, cancellationToken).ConfigureAwait(false); } @@ -75,20 +80,16 @@ public virtual async Task> GetScheduledActionA /// Get a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// @@ -99,7 +100,91 @@ public virtual async Task> GetScheduledActionA [ForwardsClientCalls] public virtual Response GetScheduledAction(string scheduledActionName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); + return GetScheduledActions().Get(scheduledActionName, cancellationToken); } + + /// + /// List resources attached to Scheduled Actions for the given occurrence + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/resources. + /// + /// + /// Operation Id. + /// Occurrences_ListResources. + /// + /// + /// Default Api Version. + /// 2026-01-01-preview. + /// + /// + /// + /// The name of the ScheduledAction. + /// The name of the Occurrence. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAttachedResourcesAsync(string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); + Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); + + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new OccurrencesGetAttachedResourcesAsyncCollectionResultOfT( + OccurrencesRestClient, + Guid.Parse(Id.SubscriptionId), + Id.ResourceGroupName, + scheduledActionName, + occurrenceId, + context); + } + + /// + /// List resources attached to Scheduled Actions for the given occurrence + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/resources. + /// + /// + /// Operation Id. + /// Occurrences_ListResources. + /// + /// + /// Default Api Version. + /// 2026-01-01-preview. + /// + /// + /// + /// The name of the ScheduledAction. + /// The name of the Occurrence. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAttachedResources(string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); + Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); + + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new OccurrencesGetAttachedResourcesCollectionResultOfT( + OccurrencesRestClient, + Guid.Parse(Id.SubscriptionId), + Id.ResourceGroupName, + scheduledActionName, + occurrenceId, + context); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs index 39c1d1dd010b..3ec749d1a946 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs @@ -8,61 +8,95 @@ 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.ComputeSchedule; using Azure.ResourceManager.ComputeSchedule.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ComputeSchedule.Mocking { - /// A class to add extension methods to SubscriptionResource. + /// A class to add extension methods to . public partial class MockableComputeScheduleSubscriptionResource : ArmResource { - private ClientDiagnostics _scheduledActionClientDiagnostics; - private ScheduledActionsRestOperations _scheduledActionRestClient; + private ClientDiagnostics _scheduledActionsClientDiagnostics; + private ScheduledActions _scheduledActionsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableComputeScheduleSubscriptionResource for mocking. protected MockableComputeScheduleSubscriptionResource() { } - /// 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 MockableComputeScheduleSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private ClientDiagnostics ScheduledActionClientDiagnostics => _scheduledActionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ScheduledActionResource.ResourceType.Namespace, Diagnostics); - private ScheduledActionsRestOperations ScheduledActionRestClient => _scheduledActionRestClient ??= new ScheduledActionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ScheduledActionResource.ResourceType)); + private ClientDiagnostics ScheduledActionsClientDiagnostics => _scheduledActionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } + private ScheduledActions ScheduledActionsRestClient => _scheduledActionsRestClient ??= new ScheduledActions(ScheduledActionsClientDiagnostics, Pipeline, Endpoint, "2026-01-01-preview"); /// - /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. + /// List ScheduledAction resources by subscription ID /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDeallocate + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/scheduledActions. + /// + /// + /// Operation Id. + /// ScheduledActions_ListBySubscription. /// /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineDeallocate + /// Default Api Version. + /// 2026-01-01-preview. + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetScheduledActionsAsync(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new ScheduledActionsGetBySubscriptionAsyncCollectionResultOfT(ScheduledActionsRestClient, Guid.Parse(Id.SubscriptionId), context), data => new ScheduledActionResource(Client, data)); + } + + /// + /// List ScheduledAction resources by subscription ID + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/scheduledActions. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_ListBySubscription. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetScheduledActions(CancellationToken cancellationToken = default) + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new ScheduledActionsGetBySubscriptionCollectionResultOfT(ScheduledActionsRestClient, Guid.Parse(Id.SubscriptionId), context), data => new ScheduledActionResource(Client, data)); + } + + /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. /// The location name. /// The request body. /// The cancellation token to use. @@ -71,11 +105,21 @@ public virtual async Task> SubmitVir { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineDeallocate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineDeallocate"); scope.Start(); try { - var response = await ScheduledActionRestClient.SubmitVirtualMachineDeallocateAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateSubmitVirtualMachineDeallocateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, SubmitDeallocateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DeallocateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -85,27 +129,7 @@ public virtual async Task> SubmitVir } } - /// - /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineDeallocate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. /// The location name. /// The request body. /// The cancellation token to use. @@ -114,11 +138,21 @@ public virtual Response SubmitVirtualMachineD { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineDeallocate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineDeallocate"); scope.Start(); try { - var response = ScheduledActionRestClient.SubmitVirtualMachineDeallocate(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateSubmitVirtualMachineDeallocateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, SubmitDeallocateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DeallocateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -128,27 +162,7 @@ public virtual Response SubmitVirtualMachineD } } - /// - /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitHibernate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. /// The location name. /// The request body. /// The cancellation token to use. @@ -157,11 +171,21 @@ public virtual async Task> SubmitVirt { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineHibernate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineHibernate"); scope.Start(); try { - var response = await ScheduledActionRestClient.SubmitVirtualMachineHibernateAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateSubmitVirtualMachineHibernateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, SubmitHibernateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(HibernateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -171,27 +195,7 @@ public virtual async Task> SubmitVirt } } - /// - /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitHibernate - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. /// The location name. /// The request body. /// The cancellation token to use. @@ -200,11 +204,21 @@ public virtual Response SubmitVirtualMachineHi { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineHibernate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineHibernate"); scope.Start(); try { - var response = ScheduledActionRestClient.SubmitVirtualMachineHibernate(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateSubmitVirtualMachineHibernateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, SubmitHibernateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(HibernateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -214,27 +228,7 @@ public virtual Response SubmitVirtualMachineHi } } - /// - /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitStart - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. /// The location name. /// The request body. /// The cancellation token to use. @@ -243,11 +237,21 @@ public virtual async Task> SubmitVirtualM { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineStart"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineStart"); scope.Start(); try { - var response = await ScheduledActionRestClient.SubmitVirtualMachineStartAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateSubmitVirtualMachineStartRequest(Guid.Parse(Id.SubscriptionId), locationparameter, SubmitStartContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(StartResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -257,27 +261,7 @@ public virtual async Task> SubmitVirtualM } } - /// - /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitStart - /// - /// - /// Operation Id - /// ScheduledActions_SubmitVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. /// The location name. /// The request body. /// The cancellation token to use. @@ -286,11 +270,21 @@ public virtual Response SubmitVirtualMachineStart( { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineStart"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.SubmitVirtualMachineStart"); scope.Start(); try { - var response = ScheduledActionRestClient.SubmitVirtualMachineStart(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateSubmitVirtualMachineStartRequest(Guid.Parse(Id.SubscriptionId), locationparameter, SubmitStartContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(StartResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -300,27 +294,7 @@ public virtual Response SubmitVirtualMachineStart( } } - /// - /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeallocate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -329,11 +303,21 @@ public virtual async Task> ExecuteVi { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeallocate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeallocate"); scope.Start(); try { - var response = await ScheduledActionRestClient.ExecuteVirtualMachineDeallocateAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineDeallocateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteDeallocateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DeallocateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -343,27 +327,7 @@ public virtual async Task> ExecuteVi } } - /// - /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDeallocate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeallocate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -372,11 +336,21 @@ public virtual Response ExecuteVirtualMachine { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeallocate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeallocate"); scope.Start(); try { - var response = ScheduledActionRestClient.ExecuteVirtualMachineDeallocate(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineDeallocateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteDeallocateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DeallocateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -386,27 +360,7 @@ public virtual Response ExecuteVirtualMachine } } - /// - /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteHibernate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -415,11 +369,21 @@ public virtual async Task> ExecuteVir { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineHibernate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineHibernate"); scope.Start(); try { - var response = await ScheduledActionRestClient.ExecuteVirtualMachineHibernateAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineHibernateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteHibernateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(HibernateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -429,27 +393,7 @@ public virtual async Task> ExecuteVir } } - /// - /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteHibernate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineHibernate - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -458,11 +402,21 @@ public virtual Response ExecuteVirtualMachineH { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineHibernate"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineHibernate"); scope.Start(); try { - var response = ScheduledActionRestClient.ExecuteVirtualMachineHibernate(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineHibernateRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteHibernateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(HibernateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -472,27 +426,7 @@ public virtual Response ExecuteVirtualMachineH } } - /// - /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteStart - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -501,11 +435,21 @@ public virtual async Task> ExecuteVirtual { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineStart"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineStart"); scope.Start(); try { - var response = await ScheduledActionRestClient.ExecuteVirtualMachineStartAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineStartRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteStartContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(StartResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -515,27 +459,7 @@ public virtual async Task> ExecuteVirtual } } - /// - /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteStart - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineStart - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -544,11 +468,21 @@ public virtual Response ExecuteVirtualMachineStart { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineStart"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineStart"); scope.Start(); try { - var response = ScheduledActionRestClient.ExecuteVirtualMachineStart(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineStartRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteStartContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(StartResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -558,27 +492,7 @@ public virtual Response ExecuteVirtualMachineStart } } - /// - /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineCreateOperation - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -587,11 +501,21 @@ public virtual async Task> ExecuteVirtua { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineCreateOperation"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineCreateOperation"); scope.Start(); try { - var response = await ScheduledActionRestClient.ExecuteVirtualMachineCreateOperationAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineCreateOperationRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteCreateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CreateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -601,27 +525,7 @@ public virtual async Task> ExecuteVirtua } } - /// - /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineCreateOperation - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -630,11 +534,21 @@ public virtual Response ExecuteVirtualMachineCrea { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineCreateOperation"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineCreateOperation"); scope.Start(); try { - var response = ScheduledActionRestClient.ExecuteVirtualMachineCreateOperation(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineCreateOperationRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteCreateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CreateResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -644,27 +558,7 @@ public virtual Response ExecuteVirtualMachineCrea } } - /// - /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeleteOperation - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -673,11 +567,21 @@ public virtual async Task> ExecuteVirtua { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeleteOperation"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeleteOperation"); scope.Start(); try { - var response = await ScheduledActionRestClient.ExecuteVirtualMachineDeleteOperationAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineDeleteOperationRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteDeleteContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DeleteResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -687,27 +591,7 @@ public virtual async Task> ExecuteVirtua } } - /// - /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete - /// - /// - /// Operation Id - /// ScheduledActions_ExecuteVirtualMachineDeleteOperation - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// [PRIVATE PREVIEW]: VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. /// The location name. /// The request body. /// The cancellation token to use. @@ -716,11 +600,21 @@ public virtual Response ExecuteVirtualMachineDele { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeleteOperation"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.ExecuteVirtualMachineDeleteOperation"); scope.Start(); try { - var response = ScheduledActionRestClient.ExecuteVirtualMachineDeleteOperation(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateExecuteVirtualMachineDeleteOperationRequest(Guid.Parse(Id.SubscriptionId), locationparameter, ExecuteDeleteContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DeleteResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -730,27 +624,7 @@ public virtual Response ExecuteVirtualMachineDele } } - /// - /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationStatus - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationStatus - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. /// The location name. /// The request body. /// The cancellation token to use. @@ -759,11 +633,21 @@ public virtual async Task> GetVirtualMachineO { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationStatus"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationStatus"); scope.Start(); try { - var response = await ScheduledActionRestClient.GetVirtualMachineOperationStatusAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateGetVirtualMachineOperationStatusRequest(Guid.Parse(Id.SubscriptionId), locationparameter, GetOperationStatusContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(GetOperationStatusResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -773,27 +657,7 @@ public virtual async Task> GetVirtualMachineO } } - /// - /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationStatus - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationStatus - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. /// The location name. /// The request body. /// The cancellation token to use. @@ -802,11 +666,21 @@ public virtual Response GetVirtualMachineOperationStat { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationStatus"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationStatus"); scope.Start(); try { - var response = ScheduledActionRestClient.GetVirtualMachineOperationStatus(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateGetVirtualMachineOperationStatusRequest(Guid.Parse(Id.SubscriptionId), locationparameter, GetOperationStatusContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(GetOperationStatusResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -816,27 +690,7 @@ public virtual Response GetVirtualMachineOperationStat } } - /// - /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations - /// - /// - /// Operation Id - /// ScheduledActions_CancelVirtualMachineOperations - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. /// The location name. /// The request body. /// The cancellation token to use. @@ -845,11 +699,21 @@ public virtual async Task> CancelVirtualMachine { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.CancelVirtualMachineOperations"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.CancelVirtualMachineOperations"); scope.Start(); try { - var response = await ScheduledActionRestClient.CancelVirtualMachineOperationsAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateCancelVirtualMachineOperationsRequest(Guid.Parse(Id.SubscriptionId), locationparameter, CancelOperationsContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CancelOperationsResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -859,27 +723,7 @@ public virtual async Task> CancelVirtualMachine } } - /// - /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations - /// - /// - /// Operation Id - /// ScheduledActions_CancelVirtualMachineOperations - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. /// The location name. /// The request body. /// The cancellation token to use. @@ -888,11 +732,21 @@ public virtual Response CancelVirtualMachineOperations(A { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.CancelVirtualMachineOperations"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.CancelVirtualMachineOperations"); scope.Start(); try { - var response = ScheduledActionRestClient.CancelVirtualMachineOperations(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateCancelVirtualMachineOperationsRequest(Guid.Parse(Id.SubscriptionId), locationparameter, CancelOperationsContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CancelOperationsResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -902,27 +756,7 @@ public virtual Response CancelVirtualMachineOperations(A } } - /// - /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationErrors - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationErrors - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. /// The location name. /// The request body. /// The cancellation token to use. @@ -931,11 +765,21 @@ public virtual async Task> GetVirtualMachineO { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationErrors"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationErrors"); scope.Start(); try { - var response = await ScheduledActionRestClient.GetVirtualMachineOperationErrorsAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateGetVirtualMachineOperationErrorsRequest(Guid.Parse(Id.SubscriptionId), locationparameter, GetOperationErrorsContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(GetOperationErrorsResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -945,27 +789,7 @@ public virtual async Task> GetVirtualMachineO } } - /// - /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationErrors - /// - /// - /// Operation Id - /// ScheduledActions_GetVirtualMachineOperationErrors - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. /// The location name. /// The request body. /// The cancellation token to use. @@ -974,11 +798,21 @@ public virtual Response GetVirtualMachineOperationErro { Argument.AssertNotNull(content, nameof(content)); - using var scope = ScheduledActionClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationErrors"); + using DiagnosticScope scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.GetVirtualMachineOperationErrors"); scope.Start(); try { - var response = ScheduledActionRestClient.GetVirtualMachineOperationErrors(Id.SubscriptionId, locationparameter, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = ScheduledActionsRestClient.CreateGetVirtualMachineOperationErrorsRequest(Guid.Parse(Id.SubscriptionId), locationparameter, GetOperationErrorsContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(GetOperationErrorsResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -987,65 +821,5 @@ public virtual Response GetVirtualMachineOperationErro throw; } } - - /// - /// List ScheduledAction resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/scheduledActions - /// - /// - /// Operation Id - /// ScheduledAction_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetScheduledActionsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ScheduledActionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScheduledActionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScheduledActionResource(Client, ScheduledActionData.DeserializeScheduledActionData(e)), ScheduledActionClientDiagnostics, Pipeline, "MockableComputeScheduleSubscriptionResource.GetScheduledActions", "value", "nextLink", cancellationToken); - } - - /// - /// List ScheduledAction resources by subscription ID - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/scheduledActions - /// - /// - /// Operation Id - /// ScheduledAction_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetScheduledActions(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ScheduledActionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScheduledActionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScheduledActionResource(Client, ScheduledActionData.DeserializeScheduledActionData(e)), ScheduledActionClientDiagnostics, Pipeline, "MockableComputeScheduleSubscriptionResource.GetScheduledActions", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Argument.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Argument.cs index 8695af015f6b..cc3b7c3f6841 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Argument.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Argument.cs @@ -11,8 +11,10 @@ namespace Azure.ResourceManager.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/AsyncPageableWrapper.cs new file mode 100644 index 000000000000..5fc0af61e4dc --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingDictionary.cs index fc60785059ec..851e61497cb8 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -11,7 +11,8 @@ namespace Azure.ResourceManager.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingList.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingList.cs index 08ae394e6efa..e1a1fb57cad9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingList.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ChangeTrackingList.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ClientPipelineExtensions.cs new file mode 100644 index 000000000000..64b7afefe0cb --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..72778edeb7e4 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..dfcabf517497 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..38d536e69173 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..f36b5f513173 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ErrorResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ErrorResult.cs new file mode 100644 index 000000000000..a80c6b1c1b7d --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ModelSerializationExtensions.cs index 40b659960047..e4d73021257b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Optional.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Optional.cs index f8a416ed219e..027943b4a94b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Optional.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Optional.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/PageableWrapper.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/PageableWrapper.cs new file mode 100644 index 000000000000..59500a0083a9 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/RawRequestUriBuilderExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/RawRequestUriBuilderExtensions.cs new file mode 100644 index 000000000000..38dc3223e2bd --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/RawRequestUriBuilderExtensions.cs @@ -0,0 +1,23 @@ +// 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.ComputeSchedule +{ + 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); + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/RequestContextExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/RequestContextExtensions.cs new file mode 100644 index 000000000000..6962ccdddc6f --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/SerializationFormat.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/SerializationFormat.cs new file mode 100644 index 000000000000..b105fb089327 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/TypeFormatters.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000000..d0db914a6747 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/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.ComputeSchedule +{ + 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Utf8JsonRequestContent.cs index f597350b53b0..d65a5ab407c6 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Utf8JsonRequestContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperation.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperation.cs index 73fc1a7df7cc..463759dc340a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperation.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperation.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.ComputeSchedule { -#pragma warning disable SA1649 // File name should match first type name - internal class ComputeScheduleArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class ComputeScheduleArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected ComputeScheduleArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal ComputeScheduleArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response); @@ -36,12 +37,20 @@ internal ComputeScheduleArmOperation(Response response, RehydrationToken? rehydr _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 ComputeScheduleArmOperation(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 ComputeScheduleArmOperation(ClientDiagnostics clientDiagnostics, HttpPi _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ComputeScheduleArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "ComputeScheduleArmOperation", + 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, AzureResourceManagerComputeScheduleContext.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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperationOfT.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperationOfT.cs index df70e90800d2..ddc459112954 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperationOfT.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ComputeScheduleArmOperationOfT.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.ComputeSchedule { -#pragma warning disable SA1649 // File name should match first type name - internal class ComputeScheduleArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class ComputeScheduleArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected ComputeScheduleArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal ComputeScheduleArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); @@ -36,12 +37,21 @@ internal ComputeScheduleArmOperation(Response response, RehydrationToken? reh _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 ComputeScheduleArmOperation(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 ComputeScheduleArmOperation(IOperationSource source, ClientDiagnosti _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "ComputeScheduleArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + NextLinkOperationImplementation.Create(source, nextLinkOperation), + clientDiagnostics, + response, + "ComputeScheduleArmOperation", + null, + new SequentialDelayStrategy()); } - private string GetOperationId(RehydrationToken? rehydrationToken) - { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerComputeScheduleContext.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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionOperationSource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionOperationSource.cs index 70be0b0e54bc..dc4c216b9733 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionOperationSource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionOperationSource.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.ComputeSchedule { - internal class ScheduledActionOperationSource : IOperationSource + /// + internal partial class ScheduledActionOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal ScheduledActionOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// ScheduledActionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerComputeScheduleContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + ScheduledActionData data = ScheduledActionData.DeserializeScheduledActionData(document.RootElement, ModelSerializationExtensions.WireOptions); return new ScheduledActionResource(_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, AzureResourceManagerComputeScheduleContext.Default); - return await Task.FromResult(new ScheduledActionResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + ScheduledActionData data = ScheduledActionData.DeserializeScheduledActionData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new ScheduledActionResource(_client, data); } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionResourceOperationResultOperationSource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionResourceOperationResultOperationSource.cs index 9c8260c199c7..4bded8803994 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionResourceOperationResultOperationSource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/LongRunningOperation/ScheduledActionResourceOperationResultOperationSource.cs @@ -8,23 +8,38 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.ResourceManager.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule { - internal class ScheduledActionResourceOperationResultOperationSource : IOperationSource + /// + internal partial class ScheduledActionResourceOperationResultOperationSource : IOperationSource { + /// + internal ScheduledActionResourceOperationResultOperationSource() + { + } + + /// The response from the service. + /// The cancellation token to use. + /// ScheduledActionResourceOperationResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - return ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + ScheduledActionResourceOperationResult result = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + return result; } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - return ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + ScheduledActionResourceOperationResult result = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + return result; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/AzureResourceManagerComputeScheduleContext.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/AzureResourceManagerComputeScheduleContext.cs index 7bfa851244aa..d2c388995072 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/AzureResourceManagerComputeScheduleContext.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/AzureResourceManagerComputeScheduleContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.ComputeSchedule.Models; using Azure.ResourceManager.Models; @@ -13,7 +14,7 @@ namespace Azure.ResourceManager.ComputeSchedule { /// /// 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(CancelOperationsContent))] [ModelReaderWriterBuildable(typeof(CancelOperationsResult))] @@ -25,6 +26,7 @@ namespace Azure.ResourceManager.ComputeSchedule [ModelReaderWriterBuildable(typeof(ExecuteDeleteContent))] [ModelReaderWriterBuildable(typeof(ExecuteHibernateContent))] [ModelReaderWriterBuildable(typeof(ExecuteStartContent))] + [ModelReaderWriterBuildable(typeof(FallbackOperationInfo))] [ModelReaderWriterBuildable(typeof(GetOperationErrorsContent))] [ModelReaderWriterBuildable(typeof(GetOperationErrorsResult))] [ModelReaderWriterBuildable(typeof(GetOperationStatusContent))] diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs index 5be1427e6b99..3b53732ec05a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class CancelOperationsContent : IUtf8JsonSerializable, IJsonModel + /// This is the request to cancel running operations in scheduled actions using the operation ids. + public partial class CancelOperationsContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CancelOperationsContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,30 +35,34 @@ 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(CancelOperationsContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationIds"u8); writer.WriteStartArray(); - foreach (var item in OperationIds) + foreach (string item in OperationIds) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -60,60 +71,73 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CancelOperationsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CancelOperationsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CancelOperationsContent 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(CancelOperationsContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCancelOperationsContent(document.RootElement, options); } - internal static CancelOperationsContent DeserializeCancelOperationsContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CancelOperationsContent DeserializeCancelOperationsContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList operationIds = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationIds"u8)) + if (prop.NameEquals("operationIds"u8)) { 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()); + } } operationIds = array; continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 CancelOperationsContent(operationIds, correlationid, serializedAdditionalRawData); + return new CancelOperationsContent(operationIds, correlationId, 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 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - CancelOperationsContent 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. + CancelOperationsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CancelOperationsContent 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 DeserializeCancelOperationsContent(document.RootElement, options); } default: @@ -139,6 +168,19 @@ CancelOperationsContent IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(CancelOperationsContent cancelOperationsContent) + { + if (cancelOperationsContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cancelOperationsContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.cs index b93e2b59bf49..6d104e04d08e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// This is the request to cancel running operations in scheduled actions using the operation ids. public partial class CancelOperationsContent { - /// - /// 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 list of operation ids to cancel operations on. @@ -62,21 +34,17 @@ public CancelOperationsContent(IEnumerable operationIds, string correlat /// Initializes a new instance of . /// The list of operation ids to cancel operations on. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal CancelOperationsContent(IList operationIds, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CancelOperationsContent(IList operationIds, string correlationId, IDictionary additionalBinaryDataProperties) { OperationIds = operationIds; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CancelOperationsContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The list of operation ids to cancel operations on. public IList OperationIds { get; } + /// CorrelationId item. public string CorrelationId { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs index e166d77f9050..d74eecfc15fb 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class CancelOperationsResult : IUtf8JsonSerializable, IJsonModel + /// This is the response from a cancel operations request. + public partial class CancelOperationsResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CancelOperationsResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,28 +35,27 @@ 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(CancelOperationsResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -58,35 +64,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CancelOperationsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CancelOperationsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CancelOperationsResult 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(CancelOperationsResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCancelOperationsResult(document.RootElement, options); } - internal static CancelOperationsResult DeserializeCancelOperationsResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CancelOperationsResult DeserializeCancelOperationsResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IReadOnlyList results = 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("results"u8)) + if (prop.NameEquals("results"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -95,17 +105,19 @@ internal static CancelOperationsResult DeserializeCancelOperationsResult(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 CancelOperationsResult(results, serializedAdditionalRawData); + return new CancelOperationsResult(results, 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": @@ -115,15 +127,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - CancelOperationsResult 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. + CancelOperationsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CancelOperationsResult 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 DeserializeCancelOperationsResult(document.RootElement, options); } default: @@ -131,6 +148,14 @@ CancelOperationsResult IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static CancelOperationsResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCancelOperationsResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.cs index 76a14f30b78e..598580caeb47 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CancelOperationsResult.cs @@ -14,60 +14,23 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// This is the response from a cancel operations request. public partial class CancelOperationsResult { - /// - /// 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 . /// An array of resource operations that were successfully cancelled. - /// is null. internal CancelOperationsResult(IEnumerable results) { - Argument.AssertNotNull(results, nameof(results)); - Results = results.ToList(); } /// Initializes a new instance of . /// An array of resource operations that were successfully cancelled. - /// Keeps track of any properties unknown to the library. - internal CancelOperationsResult(IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CancelOperationsResult(IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CancelOperationsResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// An array of resource operations that were successfully cancelled. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.Serialization.cs index 98145ea98500..e32c23790417 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.Serialization.cs @@ -9,14 +9,22 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class CreateResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// The response from a create request. + public partial class CreateResourceOperationResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CreateResourceOperationResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(CreateResourceOperationResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -44,21 +51,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -67,57 +74,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CreateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CreateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CreateResourceOperationResult 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(CreateResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCreateResourceOperationResult(document.RootElement, options); } - internal static CreateResourceOperationResult DeserializeCreateResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CreateResourceOperationResult DeserializeCreateResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string description = default; - string type = default; + string @type = default; AzureLocation location = default; IReadOnlyList results = 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("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("results"u8)) + if (prop.NameEquals("results"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(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -126,17 +137,19 @@ internal static CreateResourceOperationResult DeserializeCreateResourceOperation } 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 CreateResourceOperationResult(description, type, location, results ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new CreateResourceOperationResult(description, @type, location, results ?? 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": @@ -146,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - CreateResourceOperationResult 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. + CreateResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CreateResourceOperationResult 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 DeserializeCreateResourceOperationResult(document.RootElement, options); } default: @@ -162,6 +180,14 @@ CreateResourceOperationResult IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static CreateResourceOperationResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCreateResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.cs index 60b10f1d33f0..8cd05351fdb2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResult.cs @@ -8,56 +8,24 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response from a create request. public partial class CreateResourceOperationResult { - /// - /// 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 description of the operation response. /// The type of resources used in the create request eg virtual machines. /// The location of the start request eg westus. - /// or is null. - internal CreateResourceOperationResult(string description, string type, AzureLocation location) + internal CreateResourceOperationResult(string description, string @type, AzureLocation location) { - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(type, nameof(type)); - Description = description; - Type = type; + Type = @type; Location = location; Results = new ChangeTrackingList(); } @@ -67,27 +35,25 @@ internal CreateResourceOperationResult(string description, string type, AzureLoc /// The type of resources used in the create request eg virtual machines. /// The location of the start request eg westus. /// The results from the start request if no errors exist. - /// Keeps track of any properties unknown to the library. - internal CreateResourceOperationResult(string description, string type, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CreateResourceOperationResult(string description, string @type, AzureLocation location, IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Description = description; - Type = type; + Type = @type; Location = location; Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CreateResourceOperationResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The description of the operation response. public string Description { get; } + /// The type of resources used in the create request eg virtual machines. public string Type { get; } + /// The location of the start request eg westus. public AzureLocation Location { get; } + /// The results from the start request if no errors exist. public IReadOnlyList Results { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs index c8f78a4a317d..c016e264a4b0 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.Serialization.cs @@ -9,14 +9,22 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class DeallocateResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// The response from a deallocate request. + public partial class DeallocateResourceOperationResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeallocateResourceOperationResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeallocateResourceOperationResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -44,21 +51,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -67,57 +74,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeallocateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeallocateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeallocateResourceOperationResult 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(DeallocateResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeallocateResourceOperationResult(document.RootElement, options); } - internal static DeallocateResourceOperationResult DeserializeDeallocateResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeallocateResourceOperationResult DeserializeDeallocateResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string description = default; - string type = default; + string resourceType = default; AzureLocation location = default; IReadOnlyList results = 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("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + resourceType = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("results"u8)) + if (prop.NameEquals("results"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(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -126,17 +137,19 @@ internal static DeallocateResourceOperationResult DeserializeDeallocateResourceO } 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 DeallocateResourceOperationResult(description, type, location, results ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DeallocateResourceOperationResult(description, resourceType, location, results ?? 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": @@ -146,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - DeallocateResourceOperationResult 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. + DeallocateResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeallocateResourceOperationResult 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 DeserializeDeallocateResourceOperationResult(document.RootElement, options); } default: @@ -162,6 +180,14 @@ DeallocateResourceOperationResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static DeallocateResourceOperationResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeallocateResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.cs index 53dd7b2eee05..74ee2b74c014 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeallocateResourceOperationResult.cs @@ -8,54 +8,22 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response from a deallocate request. public partial class DeallocateResourceOperationResult { - /// - /// 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 description of the operation response. /// The type of resources used in the deallocate request eg virtual machines. /// The location of the deallocate request eg westus. - /// or is null. internal DeallocateResourceOperationResult(string description, string resourceType, AzureLocation location) { - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(resourceType, nameof(resourceType)); - Description = description; ResourceType = resourceType; Location = location; @@ -67,27 +35,25 @@ internal DeallocateResourceOperationResult(string description, string resourceTy /// The type of resources used in the deallocate request eg virtual machines. /// The location of the deallocate request eg westus. /// The results from the deallocate request if no errors exist. - /// Keeps track of any properties unknown to the library. - internal DeallocateResourceOperationResult(string description, string resourceType, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeallocateResourceOperationResult(string description, string resourceType, AzureLocation location, IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Description = description; ResourceType = resourceType; Location = location; Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeallocateResourceOperationResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The description of the operation response. public string Description { get; } + /// The type of resources used in the deallocate request eg virtual machines. public string ResourceType { get; } + /// The location of the deallocate request eg westus. public AzureLocation Location { get; } + /// The results from the deallocate request if no errors exist. public IReadOnlyList Results { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.Serialization.cs index fbe6eddc3886..0b3273833f42 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.Serialization.cs @@ -9,14 +9,22 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class DeleteResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// The response from a delete request. + public partial class DeleteResourceOperationResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeleteResourceOperationResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(DeleteResourceOperationResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -44,21 +51,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -67,57 +74,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeleteResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeleteResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeleteResourceOperationResult 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(DeleteResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeleteResourceOperationResult(document.RootElement, options); } - internal static DeleteResourceOperationResult DeserializeDeleteResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeleteResourceOperationResult DeserializeDeleteResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string description = default; - string type = default; + string @type = default; AzureLocation location = default; IReadOnlyList results = 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("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("results"u8)) + if (prop.NameEquals("results"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(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -126,17 +137,19 @@ internal static DeleteResourceOperationResult DeserializeDeleteResourceOperation } 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 DeleteResourceOperationResult(description, type, location, results ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DeleteResourceOperationResult(description, @type, location, results ?? 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": @@ -146,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - DeleteResourceOperationResult 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. + DeleteResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeleteResourceOperationResult 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 DeserializeDeleteResourceOperationResult(document.RootElement, options); } default: @@ -162,6 +180,14 @@ DeleteResourceOperationResult IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static DeleteResourceOperationResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeleteResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.cs index 880209a70316..07fb13940309 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResult.cs @@ -8,56 +8,24 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response from a delete request. public partial class DeleteResourceOperationResult { - /// - /// 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 description of the operation response. /// The type of resources used in the delete request eg virtual machines. /// The location of the start request eg westus. - /// or is null. - internal DeleteResourceOperationResult(string description, string type, AzureLocation location) + internal DeleteResourceOperationResult(string description, string @type, AzureLocation location) { - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(type, nameof(type)); - Description = description; - Type = type; + Type = @type; Location = location; Results = new ChangeTrackingList(); } @@ -67,27 +35,25 @@ internal DeleteResourceOperationResult(string description, string type, AzureLoc /// The type of resources used in the delete request eg virtual machines. /// The location of the start request eg westus. /// The results from the start request if no errors exist. - /// Keeps track of any properties unknown to the library. - internal DeleteResourceOperationResult(string description, string type, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeleteResourceOperationResult(string description, string @type, AzureLocation location, IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Description = description; - Type = type; + Type = @type; Location = location; Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeleteResourceOperationResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The description of the operation response. public string Description { get; } + /// The type of resources used in the delete request eg virtual machines. public string Type { get; } + /// The location of the start request eg westus. public AzureLocation Location { get; } + /// The results from the start request if no errors exist. public IReadOnlyList Results { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs index eb724b40a98a..0bdc07143ff3 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ExecuteCreateContent : IUtf8JsonSerializable, IJsonModel + /// The ExecuteCreateRequest request for create operations. + public partial class ExecuteCreateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ExecuteCreateContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,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(ExecuteCreateContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceConfigParameters"u8); writer.WriteObjectValue(ResourceConfigParameters, options); writer.WritePropertyName("executionParameters"u8); @@ -43,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); } - 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); } @@ -60,61 +66,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExecuteCreateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ExecuteCreateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ExecuteCreateContent 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(ExecuteCreateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeExecuteCreateContent(document.RootElement, options); } - internal static ExecuteCreateContent DeserializeExecuteCreateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ExecuteCreateContent DeserializeExecuteCreateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ResourceProvisionPayload resourceConfigParameters = default; ScheduledActionExecutionParameterDetail executionParameters = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceConfigParameters"u8)) + if (prop.NameEquals("resourceConfigParameters"u8)) { - resourceConfigParameters = ResourceProvisionPayload.DeserializeResourceProvisionPayload(property.Value, options); + resourceConfigParameters = ResourceProvisionPayload.DeserializeResourceProvisionPayload(prop.Value, options); continue; } - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationid, serializedAdditionalRawData); + return new ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationId, 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": @@ -124,15 +136,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - ExecuteCreateContent 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. + ExecuteCreateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ExecuteCreateContent 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 DeserializeExecuteCreateContent(document.RootElement, options); } default: @@ -140,6 +157,19 @@ ExecuteCreateContent 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(ExecuteCreateContent executeCreateContent) + { + if (executeCreateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(executeCreateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs index f3dfb6219ffb..0f471e9c7deb 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The ExecuteCreateRequest request for create operations. public partial class ExecuteCreateContent { - /// - /// 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 . /// resource creation payload. @@ -62,24 +34,21 @@ public ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters, S /// resource creation payload. /// The execution parameters for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters, ScheduledActionExecutionParameterDetail executionParameters, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters, ScheduledActionExecutionParameterDetail executionParameters, string correlationId, IDictionary additionalBinaryDataProperties) { ResourceConfigParameters = resourceConfigParameters; ExecutionParameters = executionParameters; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ExecuteCreateContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// resource creation payload. public ResourceProvisionPayload ResourceConfigParameters { get; } + /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// CorrelationId item. public string CorrelationId { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs index b0bedd943e97..35867284c47f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ExecuteDeallocateContent : IUtf8JsonSerializable, IJsonModel + /// The ExecuteDeallocateRequest request for executeDeallocate operations. + public partial class ExecuteDeallocateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ExecuteDeallocateContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,27 +35,26 @@ 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(ExecuteDeallocateContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); writer.WriteObjectValue(Resources, options); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -57,61 +63,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExecuteDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ExecuteDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ExecuteDeallocateContent 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(ExecuteDeallocateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeExecuteDeallocateContent(document.RootElement, options); } - internal static ExecuteDeallocateContent DeserializeExecuteDeallocateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ExecuteDeallocateContent DeserializeExecuteDeallocateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 ExecuteDeallocateContent(executionParameters, resources, correlationid, serializedAdditionalRawData); + return new ExecuteDeallocateContent(executionParameters, resources, correlationId, 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": @@ -121,15 +133,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - ExecuteDeallocateContent 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. + ExecuteDeallocateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ExecuteDeallocateContent 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 DeserializeExecuteDeallocateContent(document.RootElement, options); } default: @@ -137,6 +154,19 @@ ExecuteDeallocateContent IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ExecuteDeallocateContent executeDeallocateContent) + { + if (executeDeallocateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(executeDeallocateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.cs index 267ecdae80cb..15fe41c40067 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeallocateContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The ExecuteDeallocateRequest request for executeDeallocate operations. public partial class ExecuteDeallocateContent { - /// - /// 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 execution parameters for the request. @@ -66,31 +38,31 @@ public ExecuteDeallocateContent(ScheduledActionExecutionParameterDetail executio /// The execution parameters for the request. /// The resources for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal ExecuteDeallocateContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ExecuteDeallocateContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary additionalBinaryDataProperties) { ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ExecuteDeallocateContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } + + /// CorrelationId item. + public string CorrelationId { get; } + /// The resource ids used for the request. public IList ResourcesIds { - get => Resources?.Ids; + get + { + return Resources is null ? default : Resources.Ids; + } } - - /// CorrelationId item. - public string CorrelationId { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs index 9c545edc2402..3a30e3ea45a2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ExecuteDeleteContent : IUtf8JsonSerializable, IJsonModel + /// The ExecuteDeleteRequest for delete VM operation. + public partial class ExecuteDeleteContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ExecuteDeleteContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,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(ExecuteDeleteContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); @@ -48,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("forceDeletion"u8); writer.WriteBooleanValue(IsForceDeletion.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); } @@ -65,71 +71,77 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExecuteDeleteContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ExecuteDeleteContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ExecuteDeleteContent 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(ExecuteDeleteContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeExecuteDeleteContent(document.RootElement, options); } - internal static ExecuteDeleteContent DeserializeExecuteDeleteContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ExecuteDeleteContent DeserializeExecuteDeleteContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - bool? forceDeletion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + bool? isForceDeletion = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("forceDeletion"u8)) + if (prop.NameEquals("forceDeletion"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - forceDeletion = property.Value.GetBoolean(); + isForceDeletion = prop.Value.GetBoolean(); 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 ExecuteDeleteContent(executionParameters, resources, correlationid, forceDeletion, serializedAdditionalRawData); + return new ExecuteDeleteContent(executionParameters, resources, correlationId, isForceDeletion, 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": @@ -139,15 +151,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - ExecuteDeleteContent 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. + ExecuteDeleteContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ExecuteDeleteContent 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 DeserializeExecuteDeleteContent(document.RootElement, options); } default: @@ -155,6 +172,19 @@ ExecuteDeleteContent 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(ExecuteDeleteContent executeDeleteContent) + { + if (executeDeleteContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(executeDeleteContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs index f53f8d9b0a5f..bae1e46c71f2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The ExecuteDeleteRequest for delete VM operation. public partial class ExecuteDeleteContent { - /// - /// 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 execution parameters for the request. @@ -64,34 +36,35 @@ public ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionPar /// The resources for the request. /// CorrelationId item. /// Forced delete resource item. - /// Keeps track of any properties unknown to the library. - internal ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, bool? isForceDeletion, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, bool? isForceDeletion, IDictionary additionalBinaryDataProperties) { ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; IsForceDeletion = isForceDeletion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ExecuteDeleteContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } - /// The resource ids used for the request. - public IList ResourcesIds - { - get => Resources?.Ids; - } /// CorrelationId item. public string CorrelationId { get; set; } + /// Forced delete resource item. public bool? IsForceDeletion { get; set; } + + /// The resource ids used for the request. + public IList ResourcesIds + { + get + { + return Resources is null ? default : Resources.Ids; + } + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs index 10df2f1f3996..e6be8738f628 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ExecuteHibernateContent : IUtf8JsonSerializable, IJsonModel + /// The ExecuteHibernateRequest request for executeHibernate operations. + public partial class ExecuteHibernateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ExecuteHibernateContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,27 +35,26 @@ 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(ExecuteHibernateContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); writer.WriteObjectValue(Resources, options); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -57,61 +63,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExecuteHibernateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ExecuteHibernateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ExecuteHibernateContent 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(ExecuteHibernateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeExecuteHibernateContent(document.RootElement, options); } - internal static ExecuteHibernateContent DeserializeExecuteHibernateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ExecuteHibernateContent DeserializeExecuteHibernateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 ExecuteHibernateContent(executionParameters, resources, correlationid, serializedAdditionalRawData); + return new ExecuteHibernateContent(executionParameters, resources, correlationId, 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": @@ -121,15 +133,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - ExecuteHibernateContent 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. + ExecuteHibernateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ExecuteHibernateContent 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 DeserializeExecuteHibernateContent(document.RootElement, options); } default: @@ -137,6 +154,19 @@ ExecuteHibernateContent IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ExecuteHibernateContent executeHibernateContent) + { + if (executeHibernateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(executeHibernateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.cs index 9c8bf6a27bda..5e57eb2837f4 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteHibernateContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The ExecuteHibernateRequest request for executeHibernate operations. public partial class ExecuteHibernateContent { - /// - /// 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 execution parameters for the request. @@ -66,31 +38,31 @@ public ExecuteHibernateContent(ScheduledActionExecutionParameterDetail execution /// The execution parameters for the request. /// The resources for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal ExecuteHibernateContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ExecuteHibernateContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary additionalBinaryDataProperties) { ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ExecuteHibernateContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } + + /// CorrelationId item. + public string CorrelationId { get; } + /// The resource ids used for the request. public IList ResourcesIds { - get => Resources?.Ids; + get + { + return Resources is null ? default : Resources.Ids; + } } - - /// CorrelationId item. - public string CorrelationId { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs index 2a7c0e2bb96f..6a1177af9652 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ExecuteStartContent : IUtf8JsonSerializable, IJsonModel + /// The ExecuteStartRequest request for executeStart operations. + public partial class ExecuteStartContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ExecuteStartContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,27 +35,26 @@ 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(ExecuteStartContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("executionParameters"u8); writer.WriteObjectValue(ExecutionParameters, options); writer.WritePropertyName("resources"u8); writer.WriteObjectValue(Resources, options); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -57,61 +63,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExecuteStartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ExecuteStartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ExecuteStartContent 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(ExecuteStartContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeExecuteStartContent(document.RootElement, options); } - internal static ExecuteStartContent DeserializeExecuteStartContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ExecuteStartContent DeserializeExecuteStartContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 ExecuteStartContent(executionParameters, resources, correlationid, serializedAdditionalRawData); + return new ExecuteStartContent(executionParameters, resources, correlationId, 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": @@ -121,15 +133,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - ExecuteStartContent 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. + ExecuteStartContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ExecuteStartContent 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 DeserializeExecuteStartContent(document.RootElement, options); } default: @@ -137,6 +154,19 @@ ExecuteStartContent IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ExecuteStartContent executeStartContent) + { + if (executeStartContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(executeStartContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.cs index fb6427d764d8..ff931fdfc107 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteStartContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The ExecuteStartRequest request for executeStart operations. public partial class ExecuteStartContent { - /// - /// 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 execution parameters for the request. @@ -66,31 +38,31 @@ public ExecuteStartContent(ScheduledActionExecutionParameterDetail executionPara /// The execution parameters for the request. /// The resources for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal ExecuteStartContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ExecuteStartContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary additionalBinaryDataProperties) { ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ExecuteStartContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } + + /// CorrelationId item. + public string CorrelationId { get; } + /// The resource ids used for the request. public IList ResourcesIds { - get => Resources?.Ids; + get + { + return Resources is null ? default : Resources.Ids; + } } - - /// CorrelationId item. - public string CorrelationId { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/FallbackOperationInfo.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/FallbackOperationInfo.Serialization.cs new file mode 100644 index 000000000000..e5ec4d476da0 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/FallbackOperationInfo.Serialization.cs @@ -0,0 +1,166 @@ +// 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.ComputeSchedule; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// Describes the fallback operation that was performed. + public partial class FallbackOperationInfo : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal FallbackOperationInfo() + { + } + + /// 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(FallbackOperationInfo)} does not support writing '{format}' format."); + } + writer.WritePropertyName("lastOpType"u8); + writer.WriteStringValue(LastOpType.ToString()); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, 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. + FallbackOperationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual FallbackOperationInfo 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(FallbackOperationInfo)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFallbackOperationInfo(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static FallbackOperationInfo DeserializeFallbackOperationInfo(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceOperationType lastOpType = default; + string status = default; + ResourceOperationError error = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("lastOpType"u8)) + { + lastOpType = new ResourceOperationType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("status"u8)) + { + status = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("error"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ResourceOperationError.DeserializeResourceOperationError(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new FallbackOperationInfo(lastOpType, status, error, 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, AzureResourceManagerComputeScheduleContext.Default); + default: + throw new FormatException($"The model {nameof(FallbackOperationInfo)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + FallbackOperationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual FallbackOperationInfo 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 DeserializeFallbackOperationInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FallbackOperationInfo)} 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/FallbackOperationInfo.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/FallbackOperationInfo.cs new file mode 100644 index 000000000000..c9fd3040702a --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/FallbackOperationInfo.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// Describes the fallback operation that was performed. + public partial class FallbackOperationInfo + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The last operation type that was performed as a fallback. + /// The status of the fallback operation. + internal FallbackOperationInfo(ResourceOperationType lastOpType, string status) + { + LastOpType = lastOpType; + Status = status; + } + + /// Initializes a new instance of . + /// The last operation type that was performed as a fallback. + /// The status of the fallback operation. + /// The error code if the fallback operation failed. + /// Keeps track of any properties unknown to the library. + internal FallbackOperationInfo(ResourceOperationType lastOpType, string status, ResourceOperationError error, IDictionary additionalBinaryDataProperties) + { + LastOpType = lastOpType; + Status = status; + Error = error; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The last operation type that was performed as a fallback. + public ResourceOperationType LastOpType { get; } + + /// The status of the fallback operation. + public string Status { get; } + + /// The error code if the fallback operation failed. + public ResourceOperationError Error { get; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs index 4b930439ba1f..467eba12a00f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class GetOperationErrorsContent : IUtf8JsonSerializable, IJsonModel + /// This is the request to get errors per vm operations. + public partial class GetOperationErrorsContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal GetOperationErrorsContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,28 +35,32 @@ 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(GetOperationErrorsContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationIds"u8); writer.WriteStartArray(); - foreach (var item in OperationIds) + foreach (string item in OperationIds) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } 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); } @@ -58,54 +69,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GetOperationErrorsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + GetOperationErrorsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual GetOperationErrorsContent 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(GetOperationErrorsContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeGetOperationErrorsContent(document.RootElement, options); } - internal static GetOperationErrorsContent DeserializeGetOperationErrorsContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static GetOperationErrorsContent DeserializeGetOperationErrorsContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList operationIds = 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("operationIds"u8)) + if (prop.NameEquals("operationIds"u8)) { 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()); + } } operationIds = array; 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 GetOperationErrorsContent(operationIds, serializedAdditionalRawData); + return new GetOperationErrorsContent(operationIds, 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": @@ -115,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - GetOperationErrorsContent 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. + GetOperationErrorsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual GetOperationErrorsContent 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 DeserializeGetOperationErrorsContent(document.RootElement, options); } default: @@ -131,6 +160,19 @@ GetOperationErrorsContent IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(GetOperationErrorsContent getOperationErrorsContent) + { + if (getOperationErrorsContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(getOperationErrorsContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.cs index b59284a55b06..f58c3c23b550 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// This is the request to get errors per vm operations. public partial class GetOperationErrorsContent { - /// - /// 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 list of operation ids to query errors of. @@ -58,16 +30,11 @@ public GetOperationErrorsContent(IEnumerable operationIds) /// Initializes a new instance of . /// The list of operation ids to query errors of. - /// Keeps track of any properties unknown to the library. - internal GetOperationErrorsContent(IList operationIds, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal GetOperationErrorsContent(IList operationIds, IDictionary additionalBinaryDataProperties) { OperationIds = operationIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GetOperationErrorsContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The list of operation ids to query errors of. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs index cd4c9c07c811..89e8024ca1c8 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class GetOperationErrorsResult : IUtf8JsonSerializable, IJsonModel + /// This is the response from a get operations errors request. + public partial class GetOperationErrorsResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal GetOperationErrorsResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,28 +35,27 @@ 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(GetOperationErrorsResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (OperationErrorsResult item in Results) { 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); } @@ -58,35 +64,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GetOperationErrorsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + GetOperationErrorsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual GetOperationErrorsResult 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(GetOperationErrorsResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeGetOperationErrorsResult(document.RootElement, options); } - internal static GetOperationErrorsResult DeserializeGetOperationErrorsResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static GetOperationErrorsResult DeserializeGetOperationErrorsResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IReadOnlyList results = 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("results"u8)) + if (prop.NameEquals("results"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(OperationErrorsResult.DeserializeOperationErrorsResult(item, options)); } @@ -95,17 +105,19 @@ internal static GetOperationErrorsResult DeserializeGetOperationErrorsResult(Jso } 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 GetOperationErrorsResult(results, serializedAdditionalRawData); + return new GetOperationErrorsResult(results, 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": @@ -115,15 +127,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - GetOperationErrorsResult 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. + GetOperationErrorsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual GetOperationErrorsResult 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 DeserializeGetOperationErrorsResult(document.RootElement, options); } default: @@ -131,6 +148,14 @@ GetOperationErrorsResult IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static GetOperationErrorsResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetOperationErrorsResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.cs index 6ffe0ec4385c..47bc484ab7d1 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationErrorsResult.cs @@ -14,60 +14,23 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// This is the response from a get operations errors request. public partial class GetOperationErrorsResult { - /// - /// 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 . /// An array of operationids and their corresponding errors if any. - /// is null. internal GetOperationErrorsResult(IEnumerable results) { - Argument.AssertNotNull(results, nameof(results)); - Results = results.ToList(); } /// Initializes a new instance of . /// An array of operationids and their corresponding errors if any. - /// Keeps track of any properties unknown to the library. - internal GetOperationErrorsResult(IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal GetOperationErrorsResult(IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GetOperationErrorsResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// An array of operationids and their corresponding errors if any. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs index 21661ecea309..9fcedad694e3 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class GetOperationStatusContent : IUtf8JsonSerializable, IJsonModel + /// This is the request to get operation status using operationids. + public partial class GetOperationStatusContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal GetOperationStatusContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,30 +35,34 @@ 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(GetOperationStatusContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationIds"u8); writer.WriteStartArray(); - foreach (var item in OperationIds) + foreach (string item in OperationIds) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -60,60 +71,73 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GetOperationStatusContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + GetOperationStatusContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual GetOperationStatusContent 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(GetOperationStatusContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeGetOperationStatusContent(document.RootElement, options); } - internal static GetOperationStatusContent DeserializeGetOperationStatusContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static GetOperationStatusContent DeserializeGetOperationStatusContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList operationIds = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationIds"u8)) + if (prop.NameEquals("operationIds"u8)) { 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()); + } } operationIds = array; continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 GetOperationStatusContent(operationIds, correlationid, serializedAdditionalRawData); + return new GetOperationStatusContent(operationIds, correlationId, 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 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - GetOperationStatusContent 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. + GetOperationStatusContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual GetOperationStatusContent 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 DeserializeGetOperationStatusContent(document.RootElement, options); } default: @@ -139,6 +168,19 @@ GetOperationStatusContent IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(GetOperationStatusContent getOperationStatusContent) + { + if (getOperationStatusContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(getOperationStatusContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.cs index 4461ba68721f..a9515b2b36d6 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// This is the request to get operation status using operationids. public partial class GetOperationStatusContent { - /// - /// 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 list of operation ids to get the status of. @@ -62,21 +34,17 @@ public GetOperationStatusContent(IEnumerable operationIds, string correl /// Initializes a new instance of . /// The list of operation ids to get the status of. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal GetOperationStatusContent(IList operationIds, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal GetOperationStatusContent(IList operationIds, string correlationId, IDictionary additionalBinaryDataProperties) { OperationIds = operationIds; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GetOperationStatusContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The list of operation ids to get the status of. public IList OperationIds { get; } + /// CorrelationId item. public string CorrelationId { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs index a35a9e0ce7e2..6ff23e220d4a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class GetOperationStatusResult : IUtf8JsonSerializable, IJsonModel + /// This is the response from a get operations status request. + public partial class GetOperationStatusResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal GetOperationStatusResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,28 +35,27 @@ 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(GetOperationStatusResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -58,35 +64,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GetOperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + GetOperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual GetOperationStatusResult 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(GetOperationStatusResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeGetOperationStatusResult(document.RootElement, options); } - internal static GetOperationStatusResult DeserializeGetOperationStatusResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static GetOperationStatusResult DeserializeGetOperationStatusResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IReadOnlyList results = 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("results"u8)) + if (prop.NameEquals("results"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -95,17 +105,19 @@ internal static GetOperationStatusResult DeserializeGetOperationStatusResult(Jso } 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 GetOperationStatusResult(results, serializedAdditionalRawData); + return new GetOperationStatusResult(results, 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": @@ -115,15 +127,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - GetOperationStatusResult 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. + GetOperationStatusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual GetOperationStatusResult 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 DeserializeGetOperationStatusResult(document.RootElement, options); } default: @@ -131,6 +148,14 @@ GetOperationStatusResult IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static GetOperationStatusResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetOperationStatusResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.cs index c2000759d64c..8492513bc1fa 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/GetOperationStatusResult.cs @@ -14,60 +14,23 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// This is the response from a get operations status request. public partial class GetOperationStatusResult { - /// - /// 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 . /// An array of resource operations based on their operation ids. - /// is null. internal GetOperationStatusResult(IEnumerable results) { - Argument.AssertNotNull(results, nameof(results)); - Results = results.ToList(); } /// Initializes a new instance of . /// An array of resource operations based on their operation ids. - /// Keeps track of any properties unknown to the library. - internal GetOperationStatusResult(IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal GetOperationStatusResult(IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GetOperationStatusResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// An array of resource operations based on their operation ids. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs index ee36f35087f6..09cd7c2852d7 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.Serialization.cs @@ -9,14 +9,22 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class HibernateResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// The response from a Hibernate request. + public partial class HibernateResourceOperationResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HibernateResourceOperationResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +36,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(HibernateResourceOperationResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -44,21 +51,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -67,57 +74,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HibernateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HibernateResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HibernateResourceOperationResult 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(HibernateResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHibernateResourceOperationResult(document.RootElement, options); } - internal static HibernateResourceOperationResult DeserializeHibernateResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HibernateResourceOperationResult DeserializeHibernateResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string description = default; - string type = default; + string resourceType = default; AzureLocation location = default; IReadOnlyList results = 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("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + resourceType = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("results"u8)) + if (prop.NameEquals("results"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(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -126,17 +137,19 @@ internal static HibernateResourceOperationResult DeserializeHibernateResourceOpe } 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 HibernateResourceOperationResult(description, type, location, results ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new HibernateResourceOperationResult(description, resourceType, location, results ?? 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": @@ -146,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - HibernateResourceOperationResult 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. + HibernateResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HibernateResourceOperationResult 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 DeserializeHibernateResourceOperationResult(document.RootElement, options); } default: @@ -162,6 +180,14 @@ HibernateResourceOperationResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static HibernateResourceOperationResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHibernateResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.cs index 30bda4ece05c..c2cf42dee679 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/HibernateResourceOperationResult.cs @@ -8,54 +8,22 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response from a Hibernate request. public partial class HibernateResourceOperationResult { - /// - /// 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 description of the operation response. /// The type of resources used in the Hibernate request eg virtual machines. /// The location of the Hibernate request eg westus. - /// or is null. internal HibernateResourceOperationResult(string description, string resourceType, AzureLocation location) { - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(resourceType, nameof(resourceType)); - Description = description; ResourceType = resourceType; Location = location; @@ -67,27 +35,25 @@ internal HibernateResourceOperationResult(string description, string resourceTyp /// The type of resources used in the Hibernate request eg virtual machines. /// The location of the Hibernate request eg westus. /// The results from the Hibernate request if no errors exist. - /// Keeps track of any properties unknown to the library. - internal HibernateResourceOperationResult(string description, string resourceType, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HibernateResourceOperationResult(string description, string resourceType, AzureLocation location, IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Description = description; ResourceType = resourceType; Location = location; Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HibernateResourceOperationResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The description of the operation response. public string Description { get; } + /// The type of resources used in the Hibernate request eg virtual machines. public string ResourceType { get; } + /// The location of the Hibernate request eg westus. public AzureLocation Location { get; } + /// The results from the Hibernate request if no errors exist. public IReadOnlyList Results { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationLanguage.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationLanguage.cs index 95f0b8259d34..c3f10c36ac7a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationLanguage.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationLanguage.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,35 +15,52 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct NotificationLanguage : IEquatable { private readonly string _value; + /// American english language. + private const string EnUsValue = "en-us"; /// Initializes a new instance of . + /// The value. /// is null. public NotificationLanguage(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string EnUsValue = "en-us"; + _value = value; + } /// American english language. public static NotificationLanguage EnUs { get; } = new NotificationLanguage(EnUsValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(NotificationLanguage left, NotificationLanguage 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 !=(NotificationLanguage left, NotificationLanguage right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator NotificationLanguage(string value) => new NotificationLanguage(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator NotificationLanguage?(string value) => value == null ? null : new NotificationLanguage(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is NotificationLanguage other && Equals(other); - /// + + /// public bool Equals(NotificationLanguage 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.Serialization.cs index dd4ba7b1daa8..87856649ca53 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class NotificationSettings : IUtf8JsonSerializable, IJsonModel + /// The information about notifications to be send to about upcoming operations. + public partial class NotificationSettings : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NotificationSettings() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,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(NotificationSettings)} does not support writing '{format}' format."); } - writer.WritePropertyName("destination"u8); writer.WriteStringValue(Destination); writer.WritePropertyName("type"u8); @@ -45,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("disabled"u8); writer.WriteBooleanValue(IsDisabled.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); } @@ -62,71 +67,77 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NotificationSettings 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(NotificationSettings)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNotificationSettings(document.RootElement, options); } - internal static NotificationSettings DeserializeNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NotificationSettings DeserializeNotificationSettings(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string destination = default; - NotificationType type = default; + NotificationType @type = default; NotificationLanguage language = default; - bool? disabled = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + bool? isDisabled = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("destination"u8)) + if (prop.NameEquals("destination"u8)) { - destination = property.Value.GetString(); + destination = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = new NotificationType(property.Value.GetString()); + @type = new NotificationType(prop.Value.GetString()); continue; } - if (property.NameEquals("language"u8)) + if (prop.NameEquals("language"u8)) { - language = new NotificationLanguage(property.Value.GetString()); + language = new NotificationLanguage(prop.Value.GetString()); continue; } - if (property.NameEquals("disabled"u8)) + if (prop.NameEquals("disabled"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - disabled = property.Value.GetBoolean(); + isDisabled = prop.Value.GetBoolean(); 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 NotificationSettings(destination, type, language, disabled, serializedAdditionalRawData); + return new NotificationSettings(destination, @type, language, isDisabled, 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": @@ -136,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - NotificationSettings 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. + NotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NotificationSettings 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 DeserializeNotificationSettings(document.RootElement, options); } default: @@ -152,6 +168,7 @@ NotificationSettings IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.cs index 9b9b0e84d13b..4b09156949f5 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationSettings.cs @@ -7,55 +7,27 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The information about notifications to be send to about upcoming operations. public partial class NotificationSettings { - /// - /// 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 . /// Where the notification should be sent. For email, it should follow email format. /// Type of notification to be sent. /// The language the notification should be sent on. /// is null. - public NotificationSettings(string destination, NotificationType type, NotificationLanguage language) + public NotificationSettings(string destination, NotificationType @type, NotificationLanguage language) { Argument.AssertNotNull(destination, nameof(destination)); Destination = destination; - Type = type; + Type = @type; Language = language; } @@ -64,27 +36,25 @@ public NotificationSettings(string destination, NotificationType type, Notificat /// Type of notification to be sent. /// The language the notification should be sent on. /// Tells if the notification is enabled or not. - /// Keeps track of any properties unknown to the library. - internal NotificationSettings(string destination, NotificationType type, NotificationLanguage language, bool? isDisabled, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NotificationSettings(string destination, NotificationType @type, NotificationLanguage language, bool? isDisabled, IDictionary additionalBinaryDataProperties) { Destination = destination; - Type = type; + Type = @type; Language = language; IsDisabled = isDisabled; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NotificationSettings() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Where the notification should be sent. For email, it should follow email format. public string Destination { get; set; } + /// Type of notification to be sent. public NotificationType Type { get; set; } + /// The language the notification should be sent on. public NotificationLanguage Language { get; set; } + /// Tells if the notification is enabled or not. public bool? IsDisabled { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationType.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationType.cs index 58d7046c8894..6f4a182a0357 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationType.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/NotificationType.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,35 +15,52 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct NotificationType : IEquatable { private readonly string _value; + /// Notify through e-mail. + private const string EmailValue = "Email"; /// Initializes a new instance of . + /// The value. /// is null. public NotificationType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string EmailValue = "Email"; + _value = value; + } /// Notify through e-mail. public static NotificationType Email { get; } = new NotificationType(EmailValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(NotificationType left, NotificationType 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 !=(NotificationType left, NotificationType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator NotificationType(string value) => new NotificationType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator NotificationType?(string value) => value == null ? null : new NotificationType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is NotificationType other && Equals(other); - /// + + /// public bool Equals(NotificationType 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.Serialization.cs index 4457e9d0d28d..ab329e81bc97 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OccurrenceCancelContent : IUtf8JsonSerializable, IJsonModel + /// The request to cancel an occurrence. + public partial class OccurrenceCancelContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceCancelContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ 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(OccurrenceCancelContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceIds"u8); writer.WriteStartArray(); - foreach (var item in ResourceIds) + foreach (ResourceIdentifier item in ResourceIds) { if (item == null) { @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(item); } 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); } @@ -63,35 +69,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceCancelContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceCancelContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceCancelContent 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(OccurrenceCancelContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceCancelContent(document.RootElement, options); } - internal static OccurrenceCancelContent DeserializeOccurrenceCancelContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceCancelContent DeserializeOccurrenceCancelContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList resourceIds = 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("resourceIds"u8)) + if (prop.NameEquals("resourceIds"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { @@ -107,17 +117,19 @@ internal static OccurrenceCancelContent DeserializeOccurrenceCancelContent(JsonE } 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 OccurrenceCancelContent(resourceIds, serializedAdditionalRawData); + return new OccurrenceCancelContent(resourceIds, 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": @@ -127,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - OccurrenceCancelContent 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. + OccurrenceCancelContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceCancelContent 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 DeserializeOccurrenceCancelContent(document.RootElement, options); } default: @@ -143,6 +160,19 @@ OccurrenceCancelContent IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(OccurrenceCancelContent occurrenceCancelContent) + { + if (occurrenceCancelContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(occurrenceCancelContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.cs index 9b61ff0bc795..a6a4b0857978 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceCancelContent.cs @@ -9,43 +9,15 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The request to cancel an occurrence. public partial class OccurrenceCancelContent { - /// - /// 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 resources the cancellation should act on. If no resource is passed in the list, Scheduled Action will cancel the occurrence for all resources. @@ -59,16 +31,11 @@ public OccurrenceCancelContent(IEnumerable resourceIds) /// Initializes a new instance of . /// The resources the cancellation should act on. If no resource is passed in the list, Scheduled Action will cancel the occurrence for all resources. - /// Keeps track of any properties unknown to the library. - internal OccurrenceCancelContent(IList resourceIds, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceCancelContent(IList resourceIds, IDictionary additionalBinaryDataProperties) { ResourceIds = resourceIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceCancelContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The resources the cancellation should act on. If no resource is passed in the list, Scheduled Action will cancel the occurrence for all resources. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.Serialization.cs index 7792be3b8fe9..3a3caca82c51 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OccurrenceDelayContent : IUtf8JsonSerializable, IJsonModel + /// Request to ask for a delay in an occurrence, delay should be set to client local time eg (ACST) 2025-05-30T22:03:00+09:30, (PST) 2025-05-30T06:35:00-07:00. + public partial class OccurrenceDelayContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceDelayContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,17 +35,16 @@ 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(OccurrenceDelayContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("delay"u8); writer.WriteStringValue(Delay, "O"); writer.WritePropertyName("resourceIds"u8); writer.WriteStartArray(); - foreach (var item in ResourceIds) + foreach (ResourceIdentifier item in ResourceIds) { if (item == null) { @@ -48,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(item); } 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); } @@ -65,41 +71,45 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceDelayContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceDelayContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceDelayContent 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(OccurrenceDelayContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceDelayContent(document.RootElement, options); } - internal static OccurrenceDelayContent DeserializeOccurrenceDelayContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceDelayContent DeserializeOccurrenceDelayContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DateTimeOffset delay = default; IList resourceIds = 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("delay"u8)) + if (prop.NameEquals("delay"u8)) { - delay = property.Value.GetDateTimeOffset("O"); + delay = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("resourceIds"u8)) + if (prop.NameEquals("resourceIds"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { @@ -115,17 +125,19 @@ internal static OccurrenceDelayContent DeserializeOccurrenceDelayContent(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 OccurrenceDelayContent(delay, resourceIds, serializedAdditionalRawData); + return new OccurrenceDelayContent(delay, resourceIds, 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": @@ -135,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - OccurrenceDelayContent 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. + OccurrenceDelayContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceDelayContent 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 DeserializeOccurrenceDelayContent(document.RootElement, options); } default: @@ -151,6 +168,19 @@ OccurrenceDelayContent IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(OccurrenceDelayContent occurrenceDelayContent) + { + if (occurrenceDelayContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(occurrenceDelayContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.cs index c016475851d8..b262fe944a0d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceDelayContent.cs @@ -9,43 +9,15 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Request to ask for a delay in an occurrence, delay should be set to client local time eg (ACST) 2025-05-30T22:03:00+09:30, (PST) 2025-05-30T06:35:00-07:00. public partial class OccurrenceDelayContent { - /// - /// 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 exact time to delay the operations to. @@ -62,21 +34,17 @@ public OccurrenceDelayContent(DateTimeOffset delay, IEnumerable Initializes a new instance of . /// The exact time to delay the operations to. /// The resources that should be delayed. If empty, the delay will apply to the all resources in the occurrence. - /// Keeps track of any properties unknown to the library. - internal OccurrenceDelayContent(DateTimeOffset delay, IList resourceIds, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceDelayContent(DateTimeOffset delay, IList resourceIds, IDictionary additionalBinaryDataProperties) { Delay = delay; ResourceIds = resourceIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceDelayContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The exact time to delay the operations to. public DateTimeOffset Delay { get; } + /// The resources that should be delayed. If empty, the delay will apply to the all resources in the occurrence. public IList ResourceIds { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.Serialization.cs index 8e27f7449984..883a3d146fc7 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.Serialization.cs @@ -10,14 +10,22 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OccurrenceExtensionProperties : IUtf8JsonSerializable, IJsonModel + /// The properties of the occurrence extension. + public partial class OccurrenceExtensionProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceExtensionProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -29,19 +37,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(OccurrenceExtensionProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); if (Optional.IsCollectionDefined(NotificationSettings)) { writer.WritePropertyName("notificationSettings"u8); writer.WriteStartArray(); - foreach (var item in NotificationSettings) + foreach (NotificationSettings item in NotificationSettings) { writer.WriteObjectValue(item, options); } @@ -64,15 +71,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("scheduledActionId"u8); writer.WriteStringValue(ScheduledActionId); - 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); } @@ -81,103 +88,109 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceExtensionProperties 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(OccurrenceExtensionProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceExtensionProperties(document.RootElement, options); } - internal static OccurrenceExtensionProperties DeserializeOccurrenceExtensionProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceExtensionProperties DeserializeOccurrenceExtensionProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ResourceIdentifier resourceId = default; - IReadOnlyList notificationSettings = default; - DateTimeOffset scheduledTime = default; + IList notificationSettings = default; + DateTimeOffset scheduledOn = default; OccurrenceResourceProvisioningState? provisioningState = default; ResponseError errorDetails = default; ResourceIdentifier scheduledActionId = 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("resourceId"u8)) + if (prop.NameEquals("resourceId"u8)) { - resourceId = new ResourceIdentifier(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("notificationSettings"u8)) + if (prop.NameEquals("notificationSettings"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(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); } notificationSettings = array; continue; } - if (property.NameEquals("scheduledTime"u8)) + if (prop.NameEquals("scheduledTime"u8)) { - scheduledTime = property.Value.GetDateTimeOffset("O"); + scheduledOn = prop.Value.GetDateTimeOffset("O"); 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 OccurrenceResourceProvisioningState(property.Value.GetString()); + provisioningState = new OccurrenceResourceProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("errorDetails"u8)) + if (prop.NameEquals("errorDetails"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - errorDetails = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerComputeScheduleContext.Default); + errorDetails = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.Default); continue; } - if (property.NameEquals("scheduledActionId"u8)) + if (prop.NameEquals("scheduledActionId"u8)) { - scheduledActionId = new ResourceIdentifier(property.Value.GetString()); + scheduledActionId = new ResourceIdentifier(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 OccurrenceExtensionProperties( resourceId, notificationSettings ?? new ChangeTrackingList(), - scheduledTime, + scheduledOn, provisioningState, errorDetails, scheduledActionId, - 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": @@ -187,15 +200,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - OccurrenceExtensionProperties 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. + OccurrenceExtensionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceExtensionProperties 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 DeserializeOccurrenceExtensionProperties(document.RootElement, options); } default: @@ -203,6 +221,7 @@ OccurrenceExtensionProperties IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.cs index ebe228fdb9db..5df6ba13a8f8 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionProperties.cs @@ -7,61 +7,28 @@ using System; using System.Collections.Generic; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The properties of the occurrence extension. public partial class OccurrenceExtensionProperties { - /// - /// 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 ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// - /// The time the occurrence is scheduled for the resource. Specified in UTC. /// The arm identifier of the scheduled action the occurrence belongs to. - /// or is null. - internal OccurrenceExtensionProperties(ResourceIdentifier resourceId, DateTimeOffset scheduledOn, ResourceIdentifier scheduledActionId) + internal OccurrenceExtensionProperties(ResourceIdentifier resourceId, ResourceIdentifier scheduledActionId) { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNull(scheduledActionId, nameof(scheduledActionId)); - ResourceId = resourceId; NotificationSettings = new ChangeTrackingList(); - ScheduledOn = scheduledOn; ScheduledActionId = scheduledActionId; } @@ -75,8 +42,8 @@ internal OccurrenceExtensionProperties(ResourceIdentifier resourceId, DateTimeOf /// The current state of the resource. /// Error details for the resource. Only populated if resource is in failed state. /// The arm identifier of the scheduled action the occurrence belongs to. - /// Keeps track of any properties unknown to the library. - internal OccurrenceExtensionProperties(ResourceIdentifier resourceId, IReadOnlyList notificationSettings, DateTimeOffset scheduledOn, OccurrenceResourceProvisioningState? provisioningState, ResponseError errorDetails, ResourceIdentifier scheduledActionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceExtensionProperties(ResourceIdentifier resourceId, IList notificationSettings, DateTimeOffset scheduledOn, OccurrenceResourceProvisioningState? provisioningState, ResponseError errorDetails, ResourceIdentifier scheduledActionId, IDictionary additionalBinaryDataProperties) { ResourceId = resourceId; NotificationSettings = notificationSettings; @@ -84,12 +51,7 @@ internal OccurrenceExtensionProperties(ResourceIdentifier resourceId, IReadOnlyL ProvisioningState = provisioningState; ErrorDetails = errorDetails; ScheduledActionId = scheduledActionId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceExtensionProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// @@ -97,14 +59,19 @@ internal OccurrenceExtensionProperties() /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// public ResourceIdentifier ResourceId { get; } + /// The desired notification settings for the specified resource. - public IReadOnlyList NotificationSettings { get; } + public IList NotificationSettings { get; } + /// The time the occurrence is scheduled for the resource. Specified in UTC. public DateTimeOffset ScheduledOn { get; } + /// The current state of the resource. public OccurrenceResourceProvisioningState? ProvisioningState { get; } + /// Error details for the resource. Only populated if resource is in failed state. public ResponseError ErrorDetails { get; } + /// The arm identifier of the scheduled action the occurrence belongs to. public ResourceIdentifier ScheduledActionId { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.Serialization.cs index 76250cb19c0a..8ae8e0194ac5 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.Serialization.cs @@ -11,14 +11,16 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OccurrenceExtensionResourceData : IUtf8JsonSerializable, IJsonModel + /// The scheduled action extension. + public partial class OccurrenceExtensionResourceData : ResourceData, 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(); @@ -30,12 +32,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// 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(OccurrenceExtensionResourceData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -44,87 +45,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - OccurrenceExtensionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceExtensionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (OccurrenceExtensionResourceData)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(OccurrenceExtensionResourceData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceExtensionResourceData(document.RootElement, options); } - internal static OccurrenceExtensionResourceData DeserializeOccurrenceExtensionResourceData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceExtensionResourceData DeserializeOccurrenceExtensionResourceData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - OccurrenceExtensionProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + OccurrenceExtensionProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = OccurrenceExtensionProperties.DeserializeOccurrenceExtensionProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("systemData"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.Default); 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, AzureResourceManagerComputeScheduleContext.Default); + properties = OccurrenceExtensionProperties.DeserializeOccurrenceExtensionProperties(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 OccurrenceExtensionResourceData( id, name, - type, + resourceType, systemData, - properties, - serializedAdditionalRawData); + additionalBinaryDataProperties, + properties); } - 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 +149,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - OccurrenceExtensionResourceData 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. + OccurrenceExtensionResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (OccurrenceExtensionResourceData)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 DeserializeOccurrenceExtensionResourceData(document.RootElement, options); } default: @@ -150,6 +170,7 @@ OccurrenceExtensionResourceData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.cs index 653f318e5156..20dd4bcf5943 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceData.cs @@ -15,37 +15,8 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The scheduled action extension. public partial class OccurrenceExtensionResourceData : ResourceData { - /// - /// 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 OccurrenceExtensionResourceData() @@ -53,16 +24,16 @@ internal OccurrenceExtensionResourceData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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. - /// Keeps track of any properties unknown to the library. - internal OccurrenceExtensionResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, OccurrenceExtensionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal OccurrenceExtensionResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, OccurrenceExtensionProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } /// The resource-specific properties for this resource. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.Serialization.cs index 7ea0886658ad..547e85b36bbb 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - internal partial class OccurrenceExtensionResourceListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a OccurrenceExtensionResource list operation. + internal partial class OccurrenceExtensionResourceListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceExtensionResourceListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter writ /// 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(OccurrenceExtensionResourceListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (OccurrenceExtensionResourceData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceExtensionResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceExtensionResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceExtensionResourceListResult 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(OccurrenceExtensionResourceListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceExtensionResourceListResult(document.RootElement, options); } - internal static OccurrenceExtensionResourceListResult DeserializeOccurrenceExtensionResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceExtensionResourceListResult DeserializeOccurrenceExtensionResourceListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(OccurrenceExtensionResourceData.DeserializeOccurrenceExtensionResourceData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = 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 OccurrenceExtensionResourceListResult(value, nextLink, serializedAdditionalRawData); + return new OccurrenceExtensionResourceListResult(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelR } } - OccurrenceExtensionResourceListResult 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. + OccurrenceExtensionResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceExtensionResourceListResult 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 DeserializeOccurrenceExtensionResourceListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ OccurrenceExtensionResourceListResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static OccurrenceExtensionResourceListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOccurrenceExtensionResourceListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.cs index ae234f39c9c8..a9c4fa10a650 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceExtensionResourceListResult.cs @@ -14,66 +14,30 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The response of a OccurrenceExtensionResource list operation. internal partial class OccurrenceExtensionResourceListResult { - /// - /// 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 OccurrenceExtensionResource items on this page. - /// is null. internal OccurrenceExtensionResourceListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The OccurrenceExtensionResource items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal OccurrenceExtensionResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceExtensionResourceListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceExtensionResourceListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The OccurrenceExtensionResource items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.Serialization.cs index a7d407222e32..06563b4a27f1 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - internal partial class OccurrenceListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a Occurrence list operation. + internal partial class OccurrenceListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ 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(OccurrenceListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (ScheduledActionOccurrenceData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceListResult 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(OccurrenceListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceListResult(document.RootElement, options); } - internal static OccurrenceListResult DeserializeOccurrenceListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceListResult DeserializeOccurrenceListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = 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 OccurrenceListResult(value, nextLink, serializedAdditionalRawData); + return new OccurrenceListResult(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - OccurrenceListResult 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. + OccurrenceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceListResult 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 DeserializeOccurrenceListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ OccurrenceListResult IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static OccurrenceListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOccurrenceListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.cs index 43f7c8b3c5e7..43501f65cf9c 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceListResult.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response of a Occurrence list operation. internal partial class OccurrenceListResult { - /// - /// 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 Occurrence items on this page. - /// is null. internal OccurrenceListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The Occurrence items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal OccurrenceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Occurrence items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.Serialization.cs index 545a50fe8e56..5e30e0dbb644 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.Serialization.cs @@ -10,15 +10,22 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; -using Azure.ResourceManager.Models; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OccurrenceResourceData : IUtf8JsonSerializable, IJsonModel + /// Represents an scheduled action resource metadata. + public partial class OccurrenceResourceData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceResourceData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,22 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + 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(OccurrenceResourceData)} does not support writing '{format}' format."); } - - base.JsonModelWriteCore(writer, options); + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); if (Optional.IsCollectionDefined(NotificationSettings)) { writer.WritePropertyName("notificationSettings"u8); writer.WriteStartArray(); - foreach (var item in NotificationSettings) + foreach (NotificationSettings item in NotificationSettings) { writer.WriteObjectValue(item, options); } @@ -64,130 +84,140 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("errorDetails"u8); ((IJsonModel)ErrorDetails).Write(writer, 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 + } + } } - OccurrenceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceResourceData 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(OccurrenceResourceData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceResourceData(document.RootElement, options); } - internal static OccurrenceResourceData DeserializeOccurrenceResourceData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceResourceData DeserializeOccurrenceResourceData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string name = default; + ResourceIdentifier id = default; + string @type = default; ResourceIdentifier resourceId = default; - IReadOnlyList notificationSettings = default; - DateTimeOffset scheduledTime = default; + IList notificationSettings = default; + DateTimeOffset scheduledOn = default; OccurrenceResourceProvisioningState? provisioningState = default; ResponseError errorDetails = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = 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("resourceId"u8)) + if (prop.NameEquals("name"u8)) { - resourceId = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("notificationSettings"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); - } - notificationSettings = array; + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("scheduledTime"u8)) + if (prop.NameEquals("type"u8)) { - scheduledTime = property.Value.GetDateTimeOffset("O"); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("resourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new OccurrenceResourceProvisioningState(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("errorDetails"u8)) + if (prop.NameEquals("notificationSettings"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - errorDetails = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerComputeScheduleContext.Default); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); + } + notificationSettings = array; continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("scheduledTime"u8)) { - name = property.Value.GetString(); + scheduledOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("provisioningState"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new OccurrenceResourceProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("errorDetails"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, AzureResourceManagerComputeScheduleContext.Default); + errorDetails = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.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 OccurrenceResourceData( - id, name, - type, - systemData, + id, + @type, resourceId, notificationSettings ?? new ChangeTrackingList(), - scheduledTime, + scheduledOn, provisioningState, errorDetails, - 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": @@ -197,15 +227,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - OccurrenceResourceData 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. + OccurrenceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceResourceData 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 DeserializeOccurrenceResourceData(document.RootElement, options); } default: @@ -213,6 +248,7 @@ OccurrenceResourceData IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.cs index 7f9c9d02d21c..e2d01ddb3acb 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceData.cs @@ -7,67 +7,33 @@ using System; using System.Collections.Generic; +using Azure; using Azure.Core; -using Azure.ResourceManager.Models; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Represents an scheduled action resource metadata. - public partial class OccurrenceResourceData : ResourceData + public partial class OccurrenceResourceData { - /// - /// 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 ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// - /// The time the occurrence is scheduled for the resource. - /// is null. - internal OccurrenceResourceData(ResourceIdentifier resourceId, DateTimeOffset scheduledOn) + internal OccurrenceResourceData(ResourceIdentifier resourceId) { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - ResourceId = resourceId; NotificationSettings = new ChangeTrackingList(); - ScheduledOn = scheduledOn; } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// The name of the resource. + /// The compute RP resource id of the resource in the scheduled actions scope. . + /// The type of resource. /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" @@ -76,33 +42,44 @@ internal OccurrenceResourceData(ResourceIdentifier resourceId, DateTimeOffset sc /// The time the occurrence is scheduled for the resource. /// The current state of the resource. /// Error details for the resource. Only populated if resource is in failed state. - /// Keeps track of any properties unknown to the library. - internal OccurrenceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier resourceId, IReadOnlyList notificationSettings, DateTimeOffset scheduledOn, OccurrenceResourceProvisioningState? provisioningState, ResponseError errorDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceResourceData(string name, ResourceIdentifier id, string @type, ResourceIdentifier resourceId, IList notificationSettings, DateTimeOffset scheduledOn, OccurrenceResourceProvisioningState? provisioningState, ResponseError errorDetails, IDictionary additionalBinaryDataProperties) { + Name = name; + Id = id; + Type = @type; ResourceId = resourceId; NotificationSettings = notificationSettings; ScheduledOn = scheduledOn; ProvisioningState = provisioningState; ErrorDetails = errorDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Initializes a new instance of for deserialization. - internal OccurrenceResourceData() - { - } + /// The name of the resource. + public string Name { get; } + + /// The compute RP resource id of the resource in the scheduled actions scope. . + public ResourceIdentifier Id { get; } + + /// The type of resource. + public string Type { get; } /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// public ResourceIdentifier ResourceId { get; } + /// The desired notification settings for the specified resource. - public IReadOnlyList NotificationSettings { get; } + public IList NotificationSettings { get; } + /// The time the occurrence is scheduled for the resource. public DateTimeOffset ScheduledOn { get; } + /// The current state of the resource. public OccurrenceResourceProvisioningState? ProvisioningState { get; } + /// Error details for the resource. Only populated if resource is in failed state. public ResponseError ErrorDetails { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.Serialization.cs index d804f2b5495c..536e2bdb7ff9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - internal partial class OccurrenceResourceListResponse : IUtf8JsonSerializable, IJsonModel + /// Paged collection of OccurrenceResource items. + internal partial class OccurrenceResourceListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceResourceListResponse() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// 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(OccurrenceResourceListResponse)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (OccurrenceResourceData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceResourceListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceResourceListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceResourceListResponse 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(OccurrenceResourceListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceResourceListResponse(document.RootElement, options); } - internal static OccurrenceResourceListResponse DeserializeOccurrenceResourceListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceResourceListResponse DeserializeOccurrenceResourceListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(OccurrenceResourceData.DeserializeOccurrenceResourceData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = 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 OccurrenceResourceListResponse(value, nextLink, serializedAdditionalRawData); + return new OccurrenceResourceListResponse(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - OccurrenceResourceListResponse 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. + OccurrenceResourceListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceResourceListResponse 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 DeserializeOccurrenceResourceListResponse(document.RootElement, options); } default: @@ -146,6 +163,14 @@ OccurrenceResourceListResponse IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static OccurrenceResourceListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOccurrenceResourceListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.cs index c93b2964c6f2..b0753f956325 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceListResponse.cs @@ -14,66 +14,30 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// Paged collection of OccurrenceResource items. internal partial class OccurrenceResourceListResponse { - /// - /// 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 OccurrenceResource items on this page. - /// is null. internal OccurrenceResourceListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The OccurrenceResource items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal OccurrenceResourceListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceResourceListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceResourceListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The OccurrenceResource items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceProvisioningState.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceProvisioningState.cs index 8b95b002c077..2c4dc5db1180 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceProvisioningState.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResourceProvisioningState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,41 +15,62 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct OccurrenceResourceProvisioningState : IEquatable { private readonly string _value; + /// Resource has been created. + private const string SucceededValue = "Succeeded"; + /// Resource creation failed. + private const string FailedValue = "Failed"; + /// Resource creation was canceled. + private const string CanceledValue = "Canceled"; /// Initializes a new instance of . + /// The value. /// is null. public OccurrenceResourceProvisioningState(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; + _value = value; + } /// Resource has been created. public static OccurrenceResourceProvisioningState Succeeded { get; } = new OccurrenceResourceProvisioningState(SucceededValue); + /// Resource creation failed. public static OccurrenceResourceProvisioningState Failed { get; } = new OccurrenceResourceProvisioningState(FailedValue); + /// Resource creation was canceled. public static OccurrenceResourceProvisioningState Canceled { get; } = new OccurrenceResourceProvisioningState(CanceledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(OccurrenceResourceProvisioningState left, OccurrenceResourceProvisioningState 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 !=(OccurrenceResourceProvisioningState left, OccurrenceResourceProvisioningState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator OccurrenceResourceProvisioningState(string value) => new OccurrenceResourceProvisioningState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator OccurrenceResourceProvisioningState?(string value) => value == null ? null : new OccurrenceResourceProvisioningState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is OccurrenceResourceProvisioningState other && Equals(other); - /// + + /// public bool Equals(OccurrenceResourceProvisioningState 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.Serialization.cs index c3c6bc51ebe5..bec122e31714 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OccurrenceResultSummary : IUtf8JsonSerializable, IJsonModel + /// The summarized provisioning result of an occurrence. + public partial class OccurrenceResultSummary : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OccurrenceResultSummary() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,30 +34,29 @@ 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(OccurrenceResultSummary)} does not support writing '{format}' format."); } - writer.WritePropertyName("total"u8); writer.WriteNumberValue(Total); writer.WritePropertyName("statuses"u8); writer.WriteStartArray(); - foreach (var item in Statuses) + foreach (ResourceResultSummary item in Statuses) { 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); } @@ -60,41 +65,45 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OccurrenceResultSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OccurrenceResultSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OccurrenceResultSummary 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(OccurrenceResultSummary)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOccurrenceResultSummary(document.RootElement, options); } - internal static OccurrenceResultSummary DeserializeOccurrenceResultSummary(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OccurrenceResultSummary DeserializeOccurrenceResultSummary(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int total = default; - IReadOnlyList statuses = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList statuses = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("total"u8)) + if (prop.NameEquals("total"u8)) { - total = property.Value.GetInt32(); + total = prop.Value.GetInt32(); continue; } - if (property.NameEquals("statuses"u8)) + if (prop.NameEquals("statuses"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ResourceResultSummary.DeserializeResourceResultSummary(item, options)); } @@ -103,17 +112,19 @@ internal static OccurrenceResultSummary DeserializeOccurrenceResultSummary(JsonE } 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 OccurrenceResultSummary(total, statuses, serializedAdditionalRawData); + return new OccurrenceResultSummary(total, statuses, 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 +134,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - OccurrenceResultSummary 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. + OccurrenceResultSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OccurrenceResultSummary 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 DeserializeOccurrenceResultSummary(document.RootElement, options); } default: @@ -139,6 +155,7 @@ OccurrenceResultSummary IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.cs index 7144602bf34e..69517d9f5977 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OccurrenceResultSummary.cs @@ -14,46 +14,14 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The summarized provisioning result of an occurrence. public partial class OccurrenceResultSummary { - /// - /// 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 total number of resources that the occurrence was supposed to act on. /// The summarized status of the resources. - /// is null. internal OccurrenceResultSummary(int total, IEnumerable statuses) { - Argument.AssertNotNull(statuses, nameof(statuses)); - Total = total; Statuses = statuses.ToList(); } @@ -61,22 +29,18 @@ internal OccurrenceResultSummary(int total, IEnumerable s /// Initializes a new instance of . /// The total number of resources that the occurrence was supposed to act on. /// The summarized status of the resources. - /// Keeps track of any properties unknown to the library. - internal OccurrenceResultSummary(int total, IReadOnlyList statuses, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OccurrenceResultSummary(int total, IList statuses, IDictionary additionalBinaryDataProperties) { Total = total; Statuses = statuses; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OccurrenceResultSummary() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The total number of resources that the occurrence was supposed to act on. public int Total { get; } + /// The summarized status of the resources. - public IReadOnlyList Statuses { get; } + public IList Statuses { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs index 4a1fffb745b1..3f76563764be 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OperationErrorDetails : IUtf8JsonSerializable, IJsonModel + /// This defines a list of operation errors associated with a unique operationId. + public partial class OperationErrorDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal OperationErrorDetails() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,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(OperationErrorDetails)} does not support writing '{format}' format."); } - writer.WritePropertyName("errorCode"u8); writer.WriteStringValue(ErrorCode); writer.WritePropertyName("errorDetails"u8); @@ -58,15 +63,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("crpOperationId"u8); writer.WriteStringValue(CrpOperationId); } - 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); } @@ -75,22 +80,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OperationErrorDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OperationErrorDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OperationErrorDetails 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(OperationErrorDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOperationErrorDetails(document.RootElement, options); } - internal static OperationErrorDetails DeserializeOperationErrorDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OperationErrorDetails DeserializeOperationErrorDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -98,71 +108,72 @@ internal static OperationErrorDetails DeserializeOperationErrorDetails(JsonEleme string errorCode = default; string errorDetails = default; DateTimeOffset? timestamp = default; - DateTimeOffset? timeStamp = default; + DateTimeOffset? errorDetailsTimestamp = default; string azureOperationName = default; string crpOperationId = 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("errorCode"u8)) + if (prop.NameEquals("errorCode"u8)) { - errorCode = property.Value.GetString(); + errorCode = prop.Value.GetString(); continue; } - if (property.NameEquals("errorDetails"u8)) + if (prop.NameEquals("errorDetails"u8)) { - errorDetails = property.Value.GetString(); + errorDetails = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("timeStamp"u8)) + if (prop.NameEquals("timeStamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timeStamp = property.Value.GetDateTimeOffset("O"); + errorDetailsTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("azureOperationName"u8)) + if (prop.NameEquals("azureOperationName"u8)) { - azureOperationName = property.Value.GetString(); + azureOperationName = prop.Value.GetString(); continue; } - if (property.NameEquals("crpOperationId"u8)) + if (prop.NameEquals("crpOperationId"u8)) { - crpOperationId = property.Value.GetString(); + crpOperationId = 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 OperationErrorDetails( errorCode, errorDetails, timestamp, - timeStamp, + errorDetailsTimestamp, azureOperationName, crpOperationId, - 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": @@ -172,15 +183,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - OperationErrorDetails 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. + OperationErrorDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OperationErrorDetails 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 DeserializeOperationErrorDetails(document.RootElement, options); } default: @@ -188,6 +204,7 @@ OperationErrorDetails IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.cs index 3aeb66912178..13ba0f1556a9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorDetails.cs @@ -13,47 +13,14 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// This defines a list of operation errors associated with a unique operationId. public partial class OperationErrorDetails { - /// - /// 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 error code of the operation. /// The error details of the operation. - /// or is null. internal OperationErrorDetails(string errorCode, string errorDetails) { - Argument.AssertNotNull(errorCode, nameof(errorCode)); - Argument.AssertNotNull(errorDetails, nameof(errorDetails)); - ErrorCode = errorCode; ErrorDetails = errorDetails; } @@ -65,8 +32,8 @@ internal OperationErrorDetails(string errorCode, string errorDetails) /// The timestamp of the error occurence. /// The compute operationid of the Start/Deallocate/Hibernate request. /// The compute operationid of the Start/Deallocate/Hibernate request. - /// Keeps track of any properties unknown to the library. - internal OperationErrorDetails(string errorCode, string errorDetails, DateTimeOffset? timestamp, DateTimeOffset? errorDetailsTimestamp, string azureOperationName, string crpOperationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OperationErrorDetails(string errorCode, string errorDetails, DateTimeOffset? timestamp, DateTimeOffset? errorDetailsTimestamp, string azureOperationName, string crpOperationId, IDictionary additionalBinaryDataProperties) { ErrorCode = errorCode; ErrorDetails = errorDetails; @@ -74,24 +41,24 @@ internal OperationErrorDetails(string errorCode, string errorDetails, DateTimeOf ErrorDetailsTimestamp = errorDetailsTimestamp; AzureOperationName = azureOperationName; CrpOperationId = crpOperationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal OperationErrorDetails() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The error code of the operation. public string ErrorCode { get; } + /// The error details of the operation. public string ErrorDetails { get; } + /// The timestamp of the error occurence. public DateTimeOffset? Timestamp { get; } + /// The timestamp of the error occurence. public DateTimeOffset? ErrorDetailsTimestamp { get; } + /// The compute operationid of the Start/Deallocate/Hibernate request. public string AzureOperationName { get; } + /// The compute operationid of the Start/Deallocate/Hibernate request. public string CrpOperationId { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs index eb2296bac28d..1eca2374c3f5 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class OperationErrorsResult : IUtf8JsonSerializable, IJsonModel + /// This is the first level of operation errors from the request when clients get errors per vm operation. + public partial class OperationErrorsResult : 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(OperationErrorsResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(OperationId)) { writer.WritePropertyName("operationId"u8); @@ -58,7 +58,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("operationErrors"u8); writer.WriteStartArray(); - foreach (var item in OperationErrors) + foreach (OperationErrorDetails item in OperationErrors) { writer.WriteObjectValue(item, options); } @@ -74,15 +74,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("requestErrorDetails"u8); writer.WriteStringValue(RequestErrorDetails); } - 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,114 +91,120 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OperationErrorsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + OperationErrorsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual OperationErrorsResult 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(OperationErrorsResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeOperationErrorsResult(document.RootElement, options); } - internal static OperationErrorsResult DeserializeOperationErrorsResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static OperationErrorsResult DeserializeOperationErrorsResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string operationId = default; - DateTimeOffset? creationTime = default; - DateTimeOffset? activationTime = default; - DateTimeOffset? completedAt = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? activationOn = default; + DateTimeOffset? completedOn = default; IReadOnlyList operationErrors = default; string requestErrorCode = default; string requestErrorDetails = 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("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("creationTime"u8)) + if (prop.NameEquals("creationTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - creationTime = property.Value.GetDateTimeOffset("O"); + createdOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("activationTime"u8)) + if (prop.NameEquals("activationTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - activationTime = property.Value.GetDateTimeOffset("O"); + activationOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("completedAt"u8)) + if (prop.NameEquals("completedAt"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - completedAt = property.Value.GetDateTimeOffset("O"); + completedOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("operationErrors"u8)) + if (prop.NameEquals("operationErrors"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(OperationErrorDetails.DeserializeOperationErrorDetails(item, options)); } operationErrors = array; continue; } - if (property.NameEquals("requestErrorCode"u8)) + if (prop.NameEquals("requestErrorCode"u8)) { - requestErrorCode = property.Value.GetString(); + requestErrorCode = prop.Value.GetString(); continue; } - if (property.NameEquals("requestErrorDetails"u8)) + if (prop.NameEquals("requestErrorDetails"u8)) { - requestErrorDetails = property.Value.GetString(); + requestErrorDetails = 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 OperationErrorsResult( operationId, - creationTime, - activationTime, - completedAt, + createdOn, + activationOn, + completedOn, operationErrors ?? new ChangeTrackingList(), requestErrorCode, requestErrorDetails, - 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": @@ -208,15 +214,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - OperationErrorsResult 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. + OperationErrorsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual OperationErrorsResult 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 DeserializeOperationErrorsResult(document.RootElement, options); } default: @@ -224,6 +235,7 @@ OperationErrorsResult IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.cs index 7f25f008e673..f4e14db0dffe 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/OperationErrorsResult.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// This is the first level of operation errors from the request when clients get errors per vm operation. public partial class OperationErrorsResult { - /// - /// 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 OperationErrorsResult() @@ -59,8 +31,8 @@ internal OperationErrorsResult() /// A list of errors associated with the operationid. /// Request level error code. /// Request level error details. - /// Keeps track of any properties unknown to the library. - internal OperationErrorsResult(string operationId, DateTimeOffset? createdOn, DateTimeOffset? activationOn, DateTimeOffset? completedOn, IReadOnlyList operationErrors, string requestErrorCode, string requestErrorDetails, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal OperationErrorsResult(string operationId, DateTimeOffset? createdOn, DateTimeOffset? activationOn, DateTimeOffset? completedOn, IReadOnlyList operationErrors, string requestErrorCode, string requestErrorDetails, IDictionary additionalBinaryDataProperties) { OperationId = operationId; CreatedOn = createdOn; @@ -69,21 +41,27 @@ internal OperationErrorsResult(string operationId, DateTimeOffset? createdOn, Da OperationErrors = operationErrors; RequestErrorCode = requestErrorCode; RequestErrorDetails = requestErrorDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The operationId identifying a vm operation. public string OperationId { get; } + /// The creation time of the error result. public DateTimeOffset? CreatedOn { get; } + /// The activation time of a vm operation. public DateTimeOffset? ActivationOn { get; } + /// The completion time of the operation if the operation was completed. public DateTimeOffset? CompletedOn { get; } + /// A list of errors associated with the operationid. public IReadOnlyList OperationErrors { get; } + /// Request level error code. public string RequestErrorCode { get; } + /// Request level error details. public string RequestErrorDetails { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.Serialization.cs index 4c2e5ee4909e..bba41fd4f59e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - internal partial class ResourceListResponse : IUtf8JsonSerializable, IJsonModel + /// Paged collection of ScheduledActionResource items. + internal partial class ResourceListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceListResponse() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ 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(ResourceListResponse)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (ScheduledActionResourceData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceListResponse 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(ResourceListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceListResponse(document.RootElement, options); } - internal static ResourceListResponse DeserializeResourceListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceListResponse DeserializeResourceListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionResourceData.DeserializeScheduledActionResourceData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = 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 ResourceListResponse(value, nextLink, serializedAdditionalRawData); + return new ResourceListResponse(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - ResourceListResponse 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. + ResourceListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceListResponse 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 DeserializeResourceListResponse(document.RootElement, options); } default: @@ -146,6 +163,14 @@ ResourceListResponse IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static ResourceListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.cs index f433a0b0f16f..cab7c45a0a50 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceListResponse.cs @@ -14,66 +14,30 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// Paged collection of ScheduledActionResource items. internal partial class ResourceListResponse { - /// - /// 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 ScheduledActionResource items on this page. - /// is null. internal ResourceListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The ScheduledActionResource items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal ResourceListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ScheduledActionResource items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs index 27476e1172de..1b121ddcbe8f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ResourceOperationDetails : IUtf8JsonSerializable, IJsonModel + /// The details of a response from an operation on a resource. + public partial class ResourceOperationDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceOperationDetails() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,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(ResourceOperationDetails)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationId"u8); writer.WriteStringValue(OperationId); if (Optional.IsDefined(ResourceId)) @@ -81,6 +87,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourceOperationError"u8); writer.WriteObjectValue(ResourceOperationError, options); } + if (Optional.IsDefined(FallbackOperationInfo)) + { + writer.WritePropertyName("fallbackOperationInfo"u8); + writer.WriteObjectValue(FallbackOperationInfo, options); + } if (Optional.IsDefined(CompletedOn)) { writer.WritePropertyName("completedAt"u8); @@ -91,15 +102,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("retryPolicy"u8); writer.WriteObjectValue(RetryPolicy, options); } - 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); } @@ -108,22 +119,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceOperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceOperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceOperationDetails 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(ResourceOperationDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceOperationDetails(document.RootElement, options); } - internal static ResourceOperationDetails DeserializeResourceOperationDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceOperationDetails DeserializeResourceOperationDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -136,112 +152,120 @@ internal static ResourceOperationDetails DeserializeResourceOperationDetails(Jso ScheduledActionDeadlineType? deadlineType = default; ScheduledActionOperationState? state = default; string timezone = default; - string timeZone = default; + string operationTimezone = default; ResourceOperationError resourceOperationError = default; - DateTimeOffset? completedAt = default; + FallbackOperationInfo fallbackOperationInfo = default; + DateTimeOffset? completedOn = default; UserRequestRetryPolicy retryPolicy = 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("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceId"u8)) + if (prop.NameEquals("resourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("opType"u8)) + if (prop.NameEquals("opType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - opType = new ResourceOperationType(property.Value.GetString()); + opType = new ResourceOperationType(prop.Value.GetString()); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("deadline"u8)) + if (prop.NameEquals("deadline"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - deadline = property.Value.GetDateTimeOffset("O"); + deadline = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("deadlineType"u8)) + if (prop.NameEquals("deadlineType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - deadlineType = new ScheduledActionDeadlineType(property.Value.GetString()); + deadlineType = new ScheduledActionDeadlineType(prop.Value.GetString()); continue; } - if (property.NameEquals("state"u8)) + if (prop.NameEquals("state"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - state = new ScheduledActionOperationState(property.Value.GetString()); + state = new ScheduledActionOperationState(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("timezone"u8)) + { + timezone = prop.Value.GetString(); continue; } - if (property.NameEquals("timezone"u8)) + if (prop.NameEquals("timeZone"u8)) { - timezone = property.Value.GetString(); + operationTimezone = prop.Value.GetString(); continue; } - if (property.NameEquals("timeZone"u8)) + if (prop.NameEquals("resourceOperationError"u8)) { - timeZone = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceOperationError = ResourceOperationError.DeserializeResourceOperationError(prop.Value, options); continue; } - if (property.NameEquals("resourceOperationError"u8)) + if (prop.NameEquals("fallbackOperationInfo"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceOperationError = ResourceOperationError.DeserializeResourceOperationError(property.Value, options); + fallbackOperationInfo = FallbackOperationInfo.DeserializeFallbackOperationInfo(prop.Value, options); continue; } - if (property.NameEquals("completedAt"u8)) + if (prop.NameEquals("completedAt"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - completedAt = property.Value.GetDateTimeOffset("O"); + completedOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("retryPolicy"u8)) + if (prop.NameEquals("retryPolicy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - retryPolicy = UserRequestRetryPolicy.DeserializeUserRequestRetryPolicy(property.Value, options); + retryPolicy = UserRequestRetryPolicy.DeserializeUserRequestRetryPolicy(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 ResourceOperationDetails( operationId, resourceId, @@ -251,17 +275,21 @@ internal static ResourceOperationDetails DeserializeResourceOperationDetails(Jso deadlineType, state, timezone, - timeZone, + operationTimezone, resourceOperationError, - completedAt, + fallbackOperationInfo, + completedOn, retryPolicy, - 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": @@ -271,15 +299,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - ResourceOperationDetails 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. + ResourceOperationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceOperationDetails 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 DeserializeResourceOperationDetails(document.RootElement, options); } default: @@ -287,6 +320,7 @@ ResourceOperationDetails IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.cs index 0bc17f0118d1..0b59ee6a42c1 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationDetails.cs @@ -14,45 +14,13 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The details of a response from an operation on a resource. public partial class ResourceOperationDetails { - /// - /// 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 . /// Operation identifier for the unique operation. - /// is null. internal ResourceOperationDetails(string operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - OperationId = operationId; } @@ -67,10 +35,11 @@ internal ResourceOperationDetails(string operationId) /// Timezone for the operation. /// Timezone for the operation. /// Operation level errors if they exist. + /// Fallback operation details if a fallback was performed. /// Time the operation was complete if errors are null. /// Retry policy the user can pass. - /// Keeps track of any properties unknown to the library. - internal ResourceOperationDetails(string operationId, ResourceIdentifier resourceId, ResourceOperationType? opType, string subscriptionId, DateTimeOffset? deadline, ScheduledActionDeadlineType? deadlineType, ScheduledActionOperationState? state, string timezone, string operationTimezone, ResourceOperationError resourceOperationError, DateTimeOffset? completedOn, UserRequestRetryPolicy retryPolicy, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceOperationDetails(string operationId, ResourceIdentifier resourceId, ResourceOperationType? opType, string subscriptionId, DateTimeOffset? deadline, ScheduledActionDeadlineType? deadlineType, ScheduledActionOperationState? state, string timezone, string operationTimezone, ResourceOperationError resourceOperationError, FallbackOperationInfo fallbackOperationInfo, DateTimeOffset? completedOn, UserRequestRetryPolicy retryPolicy, IDictionary additionalBinaryDataProperties) { OperationId = operationId; ResourceId = resourceId; @@ -82,38 +51,48 @@ internal ResourceOperationDetails(string operationId, ResourceIdentifier resourc Timezone = timezone; OperationTimezone = operationTimezone; ResourceOperationError = resourceOperationError; + FallbackOperationInfo = fallbackOperationInfo; CompletedOn = completedOn; RetryPolicy = retryPolicy; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceOperationDetails() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Operation identifier for the unique operation. public string OperationId { get; } + /// Unique identifier for the resource involved in the operation, eg ArmId. public ResourceIdentifier ResourceId { get; } + /// Type of operation performed on the resources. public ResourceOperationType? OpType { get; } + /// Subscription id attached to the request. public string SubscriptionId { get; } + /// Deadline for the operation. public DateTimeOffset? Deadline { get; } + /// Type of deadline of the operation. public ScheduledActionDeadlineType? DeadlineType { get; } + /// Current state of the operation. public ScheduledActionOperationState? State { get; } + /// Timezone for the operation. public string Timezone { get; } + /// Timezone for the operation. public string OperationTimezone { get; } + /// Operation level errors if they exist. public ResourceOperationError ResourceOperationError { get; } + + /// Fallback operation details if a fallback was performed. + public FallbackOperationInfo FallbackOperationInfo { get; } + /// Time the operation was complete if errors are null. public DateTimeOffset? CompletedOn { get; } + /// Retry policy the user can pass. public UserRequestRetryPolicy RetryPolicy { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs index b0061b4f1eff..e8d2db8d3cce 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ResourceOperationError : IUtf8JsonSerializable, IJsonModel + /// These describe errors that occur at the resource level. + public partial class ResourceOperationError : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceOperationError() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +34,24 @@ 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(ResourceOperationError)} does not support writing '{format}' format."); } - writer.WritePropertyName("errorCode"u8); writer.WriteStringValue(ErrorCode); writer.WritePropertyName("errorDetails"u8); writer.WriteStringValue(ErrorDetails); - 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); } @@ -55,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceOperationError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceOperationError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceOperationError 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(ResourceOperationError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceOperationError(document.RootElement, options); } - internal static ResourceOperationError DeserializeResourceOperationError(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceOperationError DeserializeResourceOperationError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string errorCode = default; string errorDetails = 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("errorCode"u8)) + if (prop.NameEquals("errorCode"u8)) { - errorCode = property.Value.GetString(); + errorCode = prop.Value.GetString(); continue; } - if (property.NameEquals("errorDetails"u8)) + if (prop.NameEquals("errorDetails"u8)) { - errorDetails = property.Value.GetString(); + errorDetails = 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 ResourceOperationError(errorCode, errorDetails, serializedAdditionalRawData); + return new ResourceOperationError(errorCode, errorDetails, 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": @@ -113,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - ResourceOperationError 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. + ResourceOperationError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceOperationError 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 DeserializeResourceOperationError(document.RootElement, options); } default: @@ -129,6 +145,7 @@ ResourceOperationError IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.cs index f2d52aeba4bf..aa3e7b5d877c 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationError.cs @@ -13,47 +13,14 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// These describe errors that occur at the resource level. public partial class ResourceOperationError { - /// - /// 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 . /// Code for the error eg 404, 500. /// Detailed message about the error. - /// or is null. internal ResourceOperationError(string errorCode, string errorDetails) { - Argument.AssertNotNull(errorCode, nameof(errorCode)); - Argument.AssertNotNull(errorDetails, nameof(errorDetails)); - ErrorCode = errorCode; ErrorDetails = errorDetails; } @@ -61,21 +28,17 @@ internal ResourceOperationError(string errorCode, string errorDetails) /// Initializes a new instance of . /// Code for the error eg 404, 500. /// Detailed message about the error. - /// Keeps track of any properties unknown to the library. - internal ResourceOperationError(string errorCode, string errorDetails, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceOperationError(string errorCode, string errorDetails, IDictionary additionalBinaryDataProperties) { ErrorCode = errorCode; ErrorDetails = errorDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceOperationError() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Code for the error eg 404, 500. public string ErrorCode { get; } + /// Detailed message about the error. public string ErrorDetails { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs index be6551322631..032931f1ea0d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// High level response from an operation on a resource. + public partial class ResourceOperationResult : 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, 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(ResourceOperationResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceId)) { writer.WritePropertyName("resourceId"u8); @@ -54,15 +55,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("operation"u8); writer.WriteObjectValue(Operation, options); } - 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); } @@ -71,22 +72,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceOperationResult 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(ResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceOperationResult(document.RootElement, options); } - internal static ResourceOperationResult DeserializeResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceOperationResult DeserializeResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -95,51 +101,52 @@ internal static ResourceOperationResult DeserializeResourceOperationResult(JsonE string errorCode = default; string errorDetails = default; ResourceOperationDetails operation = 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("resourceId"u8)) + if (prop.NameEquals("resourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("errorCode"u8)) + if (prop.NameEquals("errorCode"u8)) { - errorCode = property.Value.GetString(); + errorCode = prop.Value.GetString(); continue; } - if (property.NameEquals("errorDetails"u8)) + if (prop.NameEquals("errorDetails"u8)) { - errorDetails = property.Value.GetString(); + errorDetails = prop.Value.GetString(); continue; } - if (property.NameEquals("operation"u8)) + if (prop.NameEquals("operation"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - operation = ResourceOperationDetails.DeserializeResourceOperationDetails(property.Value, options); + operation = ResourceOperationDetails.DeserializeResourceOperationDetails(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 ResourceOperationResult(resourceId, errorCode, errorDetails, operation, serializedAdditionalRawData); + return new ResourceOperationResult(resourceId, errorCode, errorDetails, operation, 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": @@ -149,15 +156,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - ResourceOperationResult 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. + ResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceOperationResult 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 DeserializeResourceOperationResult(document.RootElement, options); } default: @@ -165,6 +177,7 @@ ResourceOperationResult IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.cs index 64d699509e9e..79465bbfe131 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationResult.cs @@ -14,37 +14,8 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// High level response from an operation on a resource. public partial class ResourceOperationResult { - /// - /// 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 ResourceOperationResult() @@ -56,22 +27,25 @@ internal ResourceOperationResult() /// Resource level error code if it exists. /// Resource level error details if they exist. /// Details of the operation performed on a resource. - /// Keeps track of any properties unknown to the library. - internal ResourceOperationResult(ResourceIdentifier resourceId, string errorCode, string errorDetails, ResourceOperationDetails operation, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceOperationResult(ResourceIdentifier resourceId, string errorCode, string errorDetails, ResourceOperationDetails operation, IDictionary additionalBinaryDataProperties) { ResourceId = resourceId; ErrorCode = errorCode; ErrorDetails = errorDetails; Operation = operation; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique identifier for the resource involved in the operation, eg ArmId. public ResourceIdentifier ResourceId { get; } + /// Resource level error code if it exists. public string ErrorCode { get; } + /// Resource level error details if they exist. public string ErrorDetails { get; } + /// Details of the operation performed on a resource. public ResourceOperationDetails Operation { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationType.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationType.cs index 200918228ead..dd692a06180b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationType.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceOperationType.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,44 +15,67 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ResourceOperationType : IEquatable { private readonly string _value; + /// The default value for this enum type. + private const string UnknownValue = "Unknown"; + /// Start operations on the resources. + private const string StartValue = "Start"; + /// Deallocate operations on the resources. + private const string DeallocateValue = "Deallocate"; + /// Hibernate operations on the resources. + private const string HibernateValue = "Hibernate"; /// Initializes a new instance of . + /// The value. /// is null. public ResourceOperationType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string UnknownValue = "Unknown"; - private const string StartValue = "Start"; - private const string DeallocateValue = "Deallocate"; - private const string HibernateValue = "Hibernate"; + _value = value; + } /// The default value for this enum type. public static ResourceOperationType Unknown { get; } = new ResourceOperationType(UnknownValue); + /// Start operations on the resources. public static ResourceOperationType Start { get; } = new ResourceOperationType(StartValue); + /// Deallocate operations on the resources. public static ResourceOperationType Deallocate { get; } = new ResourceOperationType(DeallocateValue); + /// Hibernate operations on the resources. public static ResourceOperationType Hibernate { get; } = new ResourceOperationType(HibernateValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ResourceOperationType left, ResourceOperationType 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 !=(ResourceOperationType left, ResourceOperationType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ResourceOperationType(string value) => new ResourceOperationType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ResourceOperationType?(string value) => value == null ? null : new ResourceOperationType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ResourceOperationType other && Equals(other); - /// + + /// public bool Equals(ResourceOperationType 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs index 887d12a0ac6e..775e040b2700 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ResourceProvisionPayload : IUtf8JsonSerializable, IJsonModel + /// Resource creation data model. + public partial class ResourceProvisionPayload : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceProvisionPayload() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,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(ResourceProvisionPayload)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(BaseProfile)) { writer.WritePropertyName("baseProfile"u8); @@ -47,9 +52,9 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit continue; } #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,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("resourceOverrides"u8); writer.WriteStartArray(); - foreach (var item in ResourceOverrides) + foreach (IDictionary item in ResourceOverrides) { if (item == null) { @@ -78,9 +83,9 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit continue; } #if NET6_0_OR_GREATER - writer.WriteRawValue(item0.Value); + writer.WriteRawValue(item0.Value); #else - using (JsonDocument document = JsonDocument.Parse(item0.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item0.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -97,15 +102,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourcePrefix"u8); writer.WriteStringValue(ResourcePrefix); } - 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); } @@ -114,22 +119,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceProvisionPayload IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceProvisionPayload IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceProvisionPayload 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(ResourceProvisionPayload)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceProvisionPayload(document.RootElement, options); } - internal static ResourceProvisionPayload DeserializeResourceProvisionPayload(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceProvisionPayload DeserializeResourceProvisionPayload(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -138,39 +148,38 @@ internal static ResourceProvisionPayload DeserializeResourceProvisionPayload(Jso IList> resourceOverrides = default; int resourceCount = default; string resourcePrefix = 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("baseProfile"u8)) + if (prop.NameEquals("baseProfile"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()) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (prop0.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, null); + dictionary.Add(prop0.Name, null); } else { - dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + dictionary.Add(prop0.Name, BinaryData.FromString(prop0.Value.GetRawText())); } } baseProfile = dictionary; continue; } - if (property.NameEquals("resourceOverrides"u8)) + if (prop.NameEquals("resourceOverrides"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()) { if (item.ValueKind == JsonValueKind.Null) { @@ -179,15 +188,15 @@ internal static ResourceProvisionPayload DeserializeResourceProvisionPayload(Jso else { Dictionary dictionary = new Dictionary(); - foreach (var property0 in item.EnumerateObject()) + foreach (var prop0 in item.EnumerateObject()) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (prop0.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, null); + dictionary.Add(prop0.Name, null); } else { - dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + dictionary.Add(prop0.Name, BinaryData.FromString(prop0.Value.GetRawText())); } } array.Add(dictionary); @@ -196,29 +205,31 @@ internal static ResourceProvisionPayload DeserializeResourceProvisionPayload(Jso resourceOverrides = array; continue; } - if (property.NameEquals("resourceCount"u8)) + if (prop.NameEquals("resourceCount"u8)) { - resourceCount = property.Value.GetInt32(); + resourceCount = prop.Value.GetInt32(); continue; } - if (property.NameEquals("resourcePrefix"u8)) + if (prop.NameEquals("resourcePrefix"u8)) { - resourcePrefix = property.Value.GetString(); + resourcePrefix = 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 ResourceProvisionPayload(baseProfile ?? new ChangeTrackingDictionary(), resourceOverrides ?? new ChangeTrackingList>(), resourceCount, resourcePrefix, serializedAdditionalRawData); + return new ResourceProvisionPayload(baseProfile ?? new ChangeTrackingDictionary(), resourceOverrides ?? new ChangeTrackingList>(), resourceCount, resourcePrefix, 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": @@ -228,15 +239,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - ResourceProvisionPayload 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. + ResourceProvisionPayload IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceProvisionPayload 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 DeserializeResourceProvisionPayload(document.RootElement, options); } default: @@ -244,6 +260,7 @@ ResourceProvisionPayload IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs index b5138c724e06..535689c49d70 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs @@ -7,43 +7,16 @@ using System; using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Resource creation data model. public partial class ResourceProvisionPayload { - /// - /// 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 . /// Number of VMs to be created. @@ -59,85 +32,75 @@ public ResourceProvisionPayload(int resourceCount) /// JSON array, that contains VM properties that should to be overridden for each VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and create a merged VMProfile. /// Number of VMs to be created. /// if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. - /// Keeps track of any properties unknown to the library. - internal ResourceProvisionPayload(IDictionary baseProfile, IList> resourceOverrides, int resourceCount, string resourcePrefix, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceProvisionPayload(IDictionary baseProfile, IList> resourceOverrides, int resourceCount, string resourcePrefix, IDictionary additionalBinaryDataProperties) { BaseProfile = baseProfile; ResourceOverrides = resourceOverrides; ResourceCount = resourceCount; ResourcePrefix = resourcePrefix; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceProvisionPayload() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// /// JSON object that contains VM properties that are common across all VMs in this batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in baseProfile) - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// + /// 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.FromObjectAsJson("foo"). + /// Creates a payload of "foo". /// /// - /// BinaryData.FromString("\"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.FromObjectAsJson(new { key = "value" }). + /// Creates a payload of { "key": "value" }. /// /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. + /// BinaryData.FromString("{\"key\": \"value\"}"). + /// Creates a payload of { "key": "value" }. /// /// /// /// public IDictionary BaseProfile { get; } + /// /// JSON array, that contains VM properties that should to be overridden for each VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and create a merged VMProfile. - /// - /// To assign an object to the element of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// + /// To assign an object to the element 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.FromObjectAsJson("foo"). + /// Creates a payload of "foo". /// /// - /// BinaryData.FromString("\"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.FromObjectAsJson(new { key = "value" }). + /// Creates a payload of { "key": "value" }. /// /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. + /// BinaryData.FromString("{\"key\": \"value\"}"). + /// Creates a payload of { "key": "value" }. /// /// /// /// public IList> ResourceOverrides { get; } + /// Number of VMs to be created. public int ResourceCount { get; } + /// if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. public string ResourcePrefix { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.Serialization.cs index 16df3dc274de..67ce4951af14 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.Serialization.cs @@ -10,14 +10,21 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ResourceResultSummary : IUtf8JsonSerializable, IJsonModel + /// The status of the resources. + public partial class ResourceResultSummary : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceResultSummary() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -29,12 +36,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(ResourceResultSummary)} does not support writing '{format}' format."); } - writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); writer.WritePropertyName("count"u8); @@ -44,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("errorDetails"u8); ((IJsonModel)ErrorDetails).Write(writer, options); } - 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,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceResultSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceResultSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceResultSummary 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(ResourceResultSummary)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceResultSummary(document.RootElement, options); } - internal static ResourceResultSummary DeserializeResourceResultSummary(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceResultSummary DeserializeResourceResultSummary(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -84,42 +95,43 @@ internal static ResourceResultSummary DeserializeResourceResultSummary(JsonEleme string code = default; int count = default; ResponseError errorDetails = 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("code"u8)) + if (prop.NameEquals("code"u8)) { - code = property.Value.GetString(); + code = prop.Value.GetString(); continue; } - if (property.NameEquals("count"u8)) + if (prop.NameEquals("count"u8)) { - count = property.Value.GetInt32(); + count = prop.Value.GetInt32(); continue; } - if (property.NameEquals("errorDetails"u8)) + if (prop.NameEquals("errorDetails"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - errorDetails = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerComputeScheduleContext.Default); + errorDetails = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.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 ResourceResultSummary(code, count, errorDetails, serializedAdditionalRawData); + return new ResourceResultSummary(code, count, errorDetails, 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": @@ -129,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - ResourceResultSummary 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. + ResourceResultSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceResultSummary 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 DeserializeResourceResultSummary(document.RootElement, options); } default: @@ -145,6 +162,7 @@ ResourceResultSummary IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.cs index 022572ab8ce9..ec497035d835 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceResultSummary.cs @@ -7,52 +7,21 @@ using System; using System.Collections.Generic; +using Azure; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The status of the resources. public partial class ResourceResultSummary { - /// - /// 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 error code for those resources. In case of success, code is populated with Success. /// The number of resources that the code applies to. - /// is null. internal ResourceResultSummary(string code, int count) { - Argument.AssertNotNull(code, nameof(code)); - Code = code; Count = count; } @@ -61,24 +30,21 @@ internal ResourceResultSummary(string code, int count) /// The error code for those resources. In case of success, code is populated with Success. /// The number of resources that the code applies to. /// The error details for the resources. Not populated on success cases. - /// Keeps track of any properties unknown to the library. - internal ResourceResultSummary(string code, int count, ResponseError errorDetails, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceResultSummary(string code, int count, ResponseError errorDetails, IDictionary additionalBinaryDataProperties) { Code = code; Count = count; ErrorDetails = errorDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceResultSummary() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The error code for those resources. In case of success, code is populated with Success. public string Code { get; } + /// The number of resources that the code applies to. public int Count { get; } + /// The error details for the resources. Not populated on success cases. public ResponseError ErrorDetails { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionDeadlineType.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionDeadlineType.cs index 311d43cdaf7e..7c014dad07bf 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionDeadlineType.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionDeadlineType.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,41 +15,62 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionDeadlineType : IEquatable { private readonly string _value; + /// Default value of Unknown. + private const string UnknownValue = "Unknown"; + /// Initiate the operation at the given deadline. + private const string InitiateAtValue = "InitiateAt"; + /// Complete the operation by the given deadline. + private const string CompleteByValue = "CompleteBy"; /// Initializes a new instance of . + /// The value. /// is null. public ScheduledActionDeadlineType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string UnknownValue = "Unknown"; - private const string InitiateAtValue = "InitiateAt"; - private const string CompleteByValue = "CompleteBy"; + _value = value; + } /// Default value of Unknown. public static ScheduledActionDeadlineType Unknown { get; } = new ScheduledActionDeadlineType(UnknownValue); + /// Initiate the operation at the given deadline. public static ScheduledActionDeadlineType InitiateAt { get; } = new ScheduledActionDeadlineType(InitiateAtValue); + /// Complete the operation by the given deadline. public static ScheduledActionDeadlineType CompleteBy { get; } = new ScheduledActionDeadlineType(CompleteByValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionDeadlineType left, ScheduledActionDeadlineType 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 !=(ScheduledActionDeadlineType left, ScheduledActionDeadlineType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionDeadlineType(string value) => new ScheduledActionDeadlineType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionDeadlineType?(string value) => value == null ? null : new ScheduledActionDeadlineType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionDeadlineType other && Equals(other); - /// + + /// public bool Equals(ScheduledActionDeadlineType 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs index 65c3495d369c..1a39944c2a7b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionExecutionParameterDetail : IUtf8JsonSerializable, IJsonModel + /// Extra details needed to run the user's request. + public partial class ScheduledActionExecutionParameterDetail : 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 wr /// 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(ScheduledActionExecutionParameterDetail)} does not support writing '{format}' format."); } - if (Optional.IsDefined(OptimizationPreference)) { writer.WritePropertyName("optimizationPreference"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("retryPolicy"u8); writer.WriteObjectValue(RetryPolicy, options); } - 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,63 +61,69 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionExecutionParameterDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionExecutionParameterDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionExecutionParameterDetail 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(ScheduledActionExecutionParameterDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionExecutionParameterDetail(document.RootElement, options); } - internal static ScheduledActionExecutionParameterDetail DeserializeScheduledActionExecutionParameterDetail(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionExecutionParameterDetail DeserializeScheduledActionExecutionParameterDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionOptimizationPreference? optimizationPreference = default; UserRequestRetryPolicy retryPolicy = 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("optimizationPreference"u8)) + if (prop.NameEquals("optimizationPreference"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - optimizationPreference = new ScheduledActionOptimizationPreference(property.Value.GetString()); + optimizationPreference = new ScheduledActionOptimizationPreference(prop.Value.GetString()); continue; } - if (property.NameEquals("retryPolicy"u8)) + if (prop.NameEquals("retryPolicy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - retryPolicy = UserRequestRetryPolicy.DeserializeUserRequestRetryPolicy(property.Value, options); + retryPolicy = UserRequestRetryPolicy.DeserializeUserRequestRetryPolicy(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 ScheduledActionExecutionParameterDetail(optimizationPreference, retryPolicy, serializedAdditionalRawData); + return new ScheduledActionExecutionParameterDetail(optimizationPreference, retryPolicy, 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": @@ -127,15 +133,20 @@ BinaryData IPersistableModel.Write(Mode } } - ScheduledActionExecutionParameterDetail 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. + ScheduledActionExecutionParameterDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionExecutionParameterDetail 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 DeserializeScheduledActionExecutionParameterDetail(document.RootElement, options); } default: @@ -143,6 +154,7 @@ ScheduledActionExecutionParameterDetail IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.cs index 7ade0616ea80..b913845893f7 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionExecutionParameterDetail.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// Extra details needed to run the user's request. public partial class ScheduledActionExecutionParameterDetail { - /// - /// 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 ScheduledActionExecutionParameterDetail() @@ -53,16 +24,17 @@ public ScheduledActionExecutionParameterDetail() /// Initializes a new instance of . /// Details that could optimize the user's request. /// Retry policy the user can pass. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionExecutionParameterDetail(ScheduledActionOptimizationPreference? optimizationPreference, UserRequestRetryPolicy retryPolicy, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionExecutionParameterDetail(ScheduledActionOptimizationPreference? optimizationPreference, UserRequestRetryPolicy retryPolicy, IDictionary additionalBinaryDataProperties) { OptimizationPreference = optimizationPreference; RetryPolicy = retryPolicy; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Details that could optimize the user's request. public ScheduledActionOptimizationPreference? OptimizationPreference { get; set; } + /// Retry policy the user can pass. public UserRequestRetryPolicy RetryPolicy { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.Serialization.cs index 9d26b471bc9f..5c856ca6e012 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - internal partial class ScheduledActionListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a ScheduledAction list operation. + internal partial class ScheduledActionListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ 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(ScheduledActionListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (ScheduledActionData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionListResult 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(ScheduledActionListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionListResult(document.RootElement, options); } - internal static ScheduledActionListResult DeserializeScheduledActionListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionListResult DeserializeScheduledActionListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionData.DeserializeScheduledActionData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = 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 ScheduledActionListResult(value, nextLink, serializedAdditionalRawData); + return new ScheduledActionListResult(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - ScheduledActionListResult 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. + ScheduledActionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionListResult 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 DeserializeScheduledActionListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ ScheduledActionListResult IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static ScheduledActionListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScheduledActionListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.cs index 3d70db224779..1f8e21a71885 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionListResult.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response of a ScheduledAction list operation. internal partial class ScheduledActionListResult { - /// - /// 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 ScheduledAction items on this page. - /// is null. internal ScheduledActionListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The ScheduledAction items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ScheduledAction items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.Serialization.cs index af4928038e4b..e1f1ee9d98e9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionOccurrenceProperties : IUtf8JsonSerializable, IJsonModel + /// Properties for an occurrence. + public partial class ScheduledActionOccurrenceProperties : 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 /// 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(ScheduledActionOccurrenceProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") { writer.WritePropertyName("scheduledTime"u8); @@ -49,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - 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 +66,71 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionOccurrenceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionOccurrenceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionOccurrenceProperties 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(ScheduledActionOccurrenceProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionOccurrenceProperties(document.RootElement, options); } - internal static ScheduledActionOccurrenceProperties DeserializeScheduledActionOccurrenceProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionOccurrenceProperties DeserializeScheduledActionOccurrenceProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset scheduledTime = default; + DateTimeOffset scheduledOn = default; OccurrenceResultSummary resultSummary = default; ScheduledActionOccurrenceState? provisioningState = 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("scheduledTime"u8)) + if (prop.NameEquals("scheduledTime"u8)) { - scheduledTime = property.Value.GetDateTimeOffset("O"); + scheduledOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("resultSummary"u8)) + if (prop.NameEquals("resultSummary"u8)) { - resultSummary = OccurrenceResultSummary.DeserializeOccurrenceResultSummary(property.Value, options); + resultSummary = OccurrenceResultSummary.DeserializeOccurrenceResultSummary(prop.Value, options); 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 ScheduledActionOccurrenceState(property.Value.GetString()); + provisioningState = new ScheduledActionOccurrenceState(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 ScheduledActionOccurrenceProperties(scheduledTime, resultSummary, provisioningState, serializedAdditionalRawData); + return new ScheduledActionOccurrenceProperties(scheduledOn, resultSummary, provisioningState, 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 +140,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - ScheduledActionOccurrenceProperties 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. + ScheduledActionOccurrenceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionOccurrenceProperties 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 DeserializeScheduledActionOccurrenceProperties(document.RootElement, options); } default: @@ -150,6 +161,7 @@ ScheduledActionOccurrenceProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.cs index 060189464ee1..c97037132b5f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceProperties.cs @@ -13,69 +13,33 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// Properties for an occurrence. public partial class ScheduledActionOccurrenceProperties { - /// - /// 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 time the occurrence is scheduled for. This value can be changed by calling the delay API. - /// The result for occurrences that achieved a terminal state. - internal ScheduledActionOccurrenceProperties(DateTimeOffset scheduledOn, OccurrenceResultSummary resultSummary) + internal ScheduledActionOccurrenceProperties() { - ScheduledOn = scheduledOn; - ResultSummary = resultSummary; } /// Initializes a new instance of . /// The time the occurrence is scheduled for. This value can be changed by calling the delay API. /// The result for occurrences that achieved a terminal state. /// The aggregated provisioning state of the occurrence. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionOccurrenceProperties(DateTimeOffset scheduledOn, OccurrenceResultSummary resultSummary, ScheduledActionOccurrenceState? provisioningState, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionOccurrenceProperties(DateTimeOffset scheduledOn, OccurrenceResultSummary resultSummary, ScheduledActionOccurrenceState? provisioningState, IDictionary additionalBinaryDataProperties) { ScheduledOn = scheduledOn; ResultSummary = resultSummary; ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionOccurrenceProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time the occurrence is scheduled for. This value can be changed by calling the delay API. public DateTimeOffset ScheduledOn { get; } + /// The result for occurrences that achieved a terminal state. public OccurrenceResultSummary ResultSummary { get; } + /// The aggregated provisioning state of the occurrence. public ScheduledActionOccurrenceState? ProvisioningState { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceState.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceState.cs index 33787dfd81c2..8586d7c5cd9d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceState.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOccurrenceState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,53 +15,82 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionOccurrenceState : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledActionOccurrenceState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The occurrence was created. private const string CreatedValue = "Created"; + /// The occurrence is being rescheduled. private const string ReschedulingValue = "Rescheduling"; + /// The occurrence has been scheduled. private const string ScheduledValue = "Scheduled"; + /// The occurrence has successfully ran. private const string SucceededValue = "Succeeded"; + /// The occurrence has failed during its scheduling. private const string FailedValue = "Failed"; + /// The occurrence is going through cancellation. private const string CancellingValue = "Cancelling"; + /// The occurrence has been canceled. private const string CanceledValue = "Canceled"; + /// Initializes a new instance of . + /// The value. + /// is null. + public ScheduledActionOccurrenceState(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The occurrence was created. public static ScheduledActionOccurrenceState Created { get; } = new ScheduledActionOccurrenceState(CreatedValue); + /// The occurrence is being rescheduled. public static ScheduledActionOccurrenceState Rescheduling { get; } = new ScheduledActionOccurrenceState(ReschedulingValue); + /// The occurrence has been scheduled. public static ScheduledActionOccurrenceState Scheduled { get; } = new ScheduledActionOccurrenceState(ScheduledValue); + /// The occurrence has successfully ran. public static ScheduledActionOccurrenceState Succeeded { get; } = new ScheduledActionOccurrenceState(SucceededValue); + /// The occurrence has failed during its scheduling. public static ScheduledActionOccurrenceState Failed { get; } = new ScheduledActionOccurrenceState(FailedValue); + /// The occurrence is going through cancellation. public static ScheduledActionOccurrenceState Cancelling { get; } = new ScheduledActionOccurrenceState(CancellingValue); + /// The occurrence has been canceled. public static ScheduledActionOccurrenceState Canceled { get; } = new ScheduledActionOccurrenceState(CanceledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionOccurrenceState left, ScheduledActionOccurrenceState 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 !=(ScheduledActionOccurrenceState left, ScheduledActionOccurrenceState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionOccurrenceState(string value) => new ScheduledActionOccurrenceState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionOccurrenceState?(string value) => value == null ? null : new ScheduledActionOccurrenceState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionOccurrenceState other && Equals(other); - /// + + /// public bool Equals(ScheduledActionOccurrenceState 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOperationState.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOperationState.cs index 5b6c060dbbe5..3c351dcdcde0 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOperationState.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOperationState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,59 +15,92 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionOperationState : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledActionOperationState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The default value for the operation state enum. private const string UnknownValue = "Unknown"; + /// Operations that are pending scheduling. private const string PendingSchedulingValue = "PendingScheduling"; + /// Operations that have been scheduled. private const string ScheduledValue = "Scheduled"; + /// Operations that are waiting to be executed. private const string PendingExecutionValue = "PendingExecution"; + /// Operations that are in the process of being executed. private const string ExecutingValue = "Executing"; + /// Operations that suceeded. private const string SucceededValue = "Succeeded"; + /// Operations that have failed. private const string FailedValue = "Failed"; + /// Operations that have been Cancelled by the user. private const string CancelledValue = "Cancelled"; + /// Operations that are blocked. private const string BlockedValue = "Blocked"; + /// Initializes a new instance of . + /// The value. + /// is null. + public ScheduledActionOperationState(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The default value for the operation state enum. public static ScheduledActionOperationState Unknown { get; } = new ScheduledActionOperationState(UnknownValue); + /// Operations that are pending scheduling. public static ScheduledActionOperationState PendingScheduling { get; } = new ScheduledActionOperationState(PendingSchedulingValue); + /// Operations that have been scheduled. public static ScheduledActionOperationState Scheduled { get; } = new ScheduledActionOperationState(ScheduledValue); + /// Operations that are waiting to be executed. public static ScheduledActionOperationState PendingExecution { get; } = new ScheduledActionOperationState(PendingExecutionValue); + /// Operations that are in the process of being executed. public static ScheduledActionOperationState Executing { get; } = new ScheduledActionOperationState(ExecutingValue); + /// Operations that suceeded. public static ScheduledActionOperationState Succeeded { get; } = new ScheduledActionOperationState(SucceededValue); + /// Operations that have failed. public static ScheduledActionOperationState Failed { get; } = new ScheduledActionOperationState(FailedValue); + /// Operations that have been Cancelled by the user. public static ScheduledActionOperationState Cancelled { get; } = new ScheduledActionOperationState(CancelledValue); + /// Operations that are blocked. public static ScheduledActionOperationState Blocked { get; } = new ScheduledActionOperationState(BlockedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionOperationState left, ScheduledActionOperationState 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 !=(ScheduledActionOperationState left, ScheduledActionOperationState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionOperationState(string value) => new ScheduledActionOperationState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionOperationState?(string value) => value == null ? null : new ScheduledActionOperationState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionOperationState other && Equals(other); - /// + + /// public bool Equals(ScheduledActionOperationState 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOptimizationPreference.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOptimizationPreference.cs index efb0ccdd03ac..bd6275caad2f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOptimizationPreference.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionOptimizationPreference.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,41 +15,62 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionOptimizationPreference : IEquatable { private readonly string _value; + /// Optimize while considering cost savings. + private const string CostValue = "Cost"; + /// Optimize while considering availability of resources. + private const string AvailabilityValue = "Availability"; + /// Optimize while considering a balance of cost and availability. + private const string CostAvailabilityBalancedValue = "CostAvailabilityBalanced"; /// Initializes a new instance of . + /// The value. /// is null. public ScheduledActionOptimizationPreference(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string CostValue = "Cost"; - private const string AvailabilityValue = "Availability"; - private const string CostAvailabilityBalancedValue = "CostAvailabilityBalanced"; + _value = value; + } /// Optimize while considering cost savings. public static ScheduledActionOptimizationPreference Cost { get; } = new ScheduledActionOptimizationPreference(CostValue); + /// Optimize while considering availability of resources. public static ScheduledActionOptimizationPreference Availability { get; } = new ScheduledActionOptimizationPreference(AvailabilityValue); + /// Optimize while considering a balance of cost and availability. public static ScheduledActionOptimizationPreference CostAvailabilityBalanced { get; } = new ScheduledActionOptimizationPreference(CostAvailabilityBalancedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionOptimizationPreference left, ScheduledActionOptimizationPreference 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 !=(ScheduledActionOptimizationPreference left, ScheduledActionOptimizationPreference right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionOptimizationPreference(string value) => new ScheduledActionOptimizationPreference(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionOptimizationPreference?(string value) => value == null ? null : new ScheduledActionOptimizationPreference(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionOptimizationPreference other && Equals(other); - /// + + /// public bool Equals(ScheduledActionOptimizationPreference 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.Serialization.cs index 3dc024e96c5b..433118d51290 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionPatch : IUtf8JsonSerializable, IJsonModel + /// The type used for update operations of the ScheduledAction. + public partial class ScheduledActionPatch : 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, 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(ScheduledActionPatch)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -41,6 +42,11 @@ 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(); @@ -50,15 +56,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - 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); } @@ -67,68 +73,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionPatch 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(ScheduledActionPatch)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionPatch(document.RootElement, options); } - internal static ScheduledActionPatch DeserializeScheduledActionPatch(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionPatch DeserializeScheduledActionPatch(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IDictionary tags = default; ScheduledActionPatchProperties properties = 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 (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = ScheduledActionPatchProperties.DeserializeScheduledActionPatchProperties(property.Value, options); + properties = ScheduledActionPatchProperties.DeserializeScheduledActionPatchProperties(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 ScheduledActionPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new ScheduledActionPatch(tags ?? new ChangeTrackingDictionary(), properties, 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": @@ -138,15 +157,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - ScheduledActionPatch 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. + ScheduledActionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionPatch 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 DeserializeScheduledActionPatch(document.RootElement, options); } default: @@ -154,6 +178,19 @@ ScheduledActionPatch 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(ScheduledActionPatch scheduledActionPatch) + { + if (scheduledActionPatch == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(scheduledActionPatch, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.cs index a08754f04585..d4bb835a1b9d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatch.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The type used for update operations of the ScheduledAction. public partial class ScheduledActionPatch { - /// - /// 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 ScheduledActionPatch() @@ -54,16 +26,17 @@ public ScheduledActionPatch() /// Initializes a new instance of . /// Resource tags. /// The resource-specific properties for this resource. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionPatch(IDictionary tags, ScheduledActionPatchProperties properties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionPatch(IDictionary tags, ScheduledActionPatchProperties properties, IDictionary additionalBinaryDataProperties) { Tags = tags; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Resource tags. public IDictionary Tags { get; } + /// The resource-specific properties for this resource. public ScheduledActionPatchProperties Properties { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.Serialization.cs index 5bb385b909af..5ac240de398a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionPatchProperties : IUtf8JsonSerializable, IJsonModel + /// The updatable properties of the ScheduledAction. + public partial class ScheduledActionPatchProperties : 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, Mod /// 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(ScheduledActionPatchProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -63,7 +63,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("notificationSettings"u8); writer.WriteStartArray(); - foreach (var item in NotificationSettings) + foreach (NotificationSettings item in NotificationSettings) { writer.WriteObjectValue(item, options); } @@ -74,15 +74,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("disabled"u8); writer.WriteBooleanValue(Disabled.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); } @@ -91,126 +91,132 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionPatchProperties 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(ScheduledActionPatchProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionPatchProperties(document.RootElement, options); } - internal static ScheduledActionPatchProperties DeserializeScheduledActionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionPatchProperties DeserializeScheduledActionPatchProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionResourceType? resourceType = default; ScheduledActionType? actionType = default; - DateTimeOffset? startTime = default; - DateTimeOffset? endTime = default; + DateTimeOffset? startOn = default; + DateTimeOffset? endOn = default; ScheduledActionsSchedule schedule = default; IList notificationSettings = default; bool? disabled = 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("resourceType"u8)) + if (prop.NameEquals("resourceType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceType = new ScheduledActionResourceType(property.Value.GetString()); + resourceType = new ScheduledActionResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("actionType"u8)) + if (prop.NameEquals("actionType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - actionType = new ScheduledActionType(property.Value.GetString()); + actionType = new ScheduledActionType(prop.Value.GetString()); continue; } - if (property.NameEquals("startTime"u8)) + if (prop.NameEquals("startTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - startTime = property.Value.GetDateTimeOffset("O"); + startOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("endTime"u8)) + if (prop.NameEquals("endTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - endTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("schedule"u8)) + if (prop.NameEquals("schedule"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - schedule = ScheduledActionsSchedule.DeserializeScheduledActionsSchedule(property.Value, options); + schedule = ScheduledActionsSchedule.DeserializeScheduledActionsSchedule(prop.Value, options); continue; } - if (property.NameEquals("notificationSettings"u8)) + if (prop.NameEquals("notificationSettings"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(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); } notificationSettings = array; continue; } - if (property.NameEquals("disabled"u8)) + if (prop.NameEquals("disabled"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - disabled = property.Value.GetBoolean(); + disabled = prop.Value.GetBoolean(); 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 ScheduledActionPatchProperties( resourceType, actionType, - startTime, - endTime, + startOn, + endOn, schedule, notificationSettings ?? new ChangeTrackingList(), disabled, - 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": @@ -220,15 +226,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - ScheduledActionPatchProperties 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. + ScheduledActionPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionPatchProperties 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 DeserializeScheduledActionPatchProperties(document.RootElement, options); } default: @@ -236,6 +247,7 @@ ScheduledActionPatchProperties IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.cs index 77fce05c1cbc..c0f408b4c222 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionPatchProperties.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The updatable properties of the ScheduledAction. public partial class ScheduledActionPatchProperties { - /// - /// 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 ScheduledActionPatchProperties() @@ -59,8 +31,8 @@ public ScheduledActionPatchProperties() /// The schedule the scheduled action is supposed to follow. /// The notification settings for the scheduled action. /// Tell if the scheduled action is disabled or not. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionPatchProperties(ScheduledActionResourceType? resourceType, ScheduledActionType? actionType, DateTimeOffset? startOn, DateTimeOffset? endOn, ScheduledActionsSchedule schedule, IList notificationSettings, bool? disabled, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionPatchProperties(ScheduledActionResourceType? resourceType, ScheduledActionType? actionType, DateTimeOffset? startOn, DateTimeOffset? endOn, ScheduledActionsSchedule schedule, IList notificationSettings, bool? disabled, IDictionary additionalBinaryDataProperties) { ResourceType = resourceType; ActionType = actionType; @@ -69,21 +41,27 @@ internal ScheduledActionPatchProperties(ScheduledActionResourceType? resourceTyp Schedule = schedule; NotificationSettings = notificationSettings; Disabled = disabled; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The type of resource the scheduled action is targeting. public ScheduledActionResourceType? ResourceType { get; set; } + /// The action the scheduled action should perform in the resources. public ScheduledActionType? ActionType { get; set; } + /// The time which the scheduled action is supposed to start running. public DateTimeOffset? StartOn { get; set; } + /// The time when the scheduled action is supposed to stop scheduling. public DateTimeOffset? EndOn { get; set; } + /// The schedule the scheduled action is supposed to follow. public ScheduledActionsSchedule Schedule { get; set; } + /// The notification settings for the scheduled action. public IList NotificationSettings { get; } + /// Tell if the scheduled action is disabled or not. public bool? Disabled { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.Serialization.cs index 0977427449b4..fbc9be373d6d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionProperties : IUtf8JsonSerializable, IJsonModel + /// Scheduled action properties. + public partial class ScheduledActionProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,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(ScheduledActionProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceType"u8); writer.WriteStringValue(ResourceType.ToString()); writer.WritePropertyName("actionType"u8); @@ -49,7 +54,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("notificationSettings"u8); writer.WriteStartArray(); - foreach (var item in NotificationSettings) + foreach (NotificationSettings item in NotificationSettings) { writer.WriteObjectValue(item, options); } @@ -64,15 +69,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - 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); } @@ -81,117 +86,123 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionProperties 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(ScheduledActionProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionProperties(document.RootElement, options); } - internal static ScheduledActionProperties DeserializeScheduledActionProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionProperties DeserializeScheduledActionProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionResourceType resourceType = default; ScheduledActionType actionType = default; - DateTimeOffset startTime = default; - DateTimeOffset? endTime = default; + DateTimeOffset startOn = default; + DateTimeOffset? endOn = default; ScheduledActionsSchedule schedule = default; IList notificationSettings = default; bool? disabled = default; ScheduledActionResourceProvisioningState? provisioningState = 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("resourceType"u8)) + if (prop.NameEquals("resourceType"u8)) { - resourceType = new ScheduledActionResourceType(property.Value.GetString()); + resourceType = new ScheduledActionResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("actionType"u8)) + if (prop.NameEquals("actionType"u8)) { - actionType = new ScheduledActionType(property.Value.GetString()); + actionType = new ScheduledActionType(prop.Value.GetString()); continue; } - if (property.NameEquals("startTime"u8)) + if (prop.NameEquals("startTime"u8)) { - startTime = property.Value.GetDateTimeOffset("O"); + startOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("endTime"u8)) + if (prop.NameEquals("endTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - endTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("schedule"u8)) + if (prop.NameEquals("schedule"u8)) { - schedule = ScheduledActionsSchedule.DeserializeScheduledActionsSchedule(property.Value, options); + schedule = ScheduledActionsSchedule.DeserializeScheduledActionsSchedule(prop.Value, options); continue; } - if (property.NameEquals("notificationSettings"u8)) + if (prop.NameEquals("notificationSettings"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); } notificationSettings = array; continue; } - if (property.NameEquals("disabled"u8)) + if (prop.NameEquals("disabled"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - disabled = property.Value.GetBoolean(); + disabled = prop.Value.GetBoolean(); 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 ScheduledActionResourceProvisioningState(property.Value.GetString()); + provisioningState = new ScheduledActionResourceProvisioningState(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 ScheduledActionProperties( resourceType, actionType, - startTime, - endTime, + startOn, + endOn, schedule, notificationSettings, disabled, provisioningState, - 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": @@ -201,15 +212,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - ScheduledActionProperties 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. + ScheduledActionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionProperties 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 DeserializeScheduledActionProperties(document.RootElement, options); } default: @@ -217,6 +233,7 @@ ScheduledActionProperties IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.cs index c5da05f1767e..f53787256147 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionProperties.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Scheduled action properties. public partial class ScheduledActionProperties { - /// - /// 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 type of resource the scheduled action is targeting. @@ -74,8 +46,8 @@ public ScheduledActionProperties(ScheduledActionResourceType resourceType, Sched /// The notification settings for the scheduled action. /// Tell if the scheduled action is disabled or not. /// The status of the last provisioning operation performed on the resource. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionProperties(ScheduledActionResourceType resourceType, ScheduledActionType actionType, DateTimeOffset startOn, DateTimeOffset? endOn, ScheduledActionsSchedule schedule, IList notificationSettings, bool? disabled, ScheduledActionResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionProperties(ScheduledActionResourceType resourceType, ScheduledActionType actionType, DateTimeOffset startOn, DateTimeOffset? endOn, ScheduledActionsSchedule schedule, IList notificationSettings, bool? disabled, ScheduledActionResourceProvisioningState? provisioningState, IDictionary additionalBinaryDataProperties) { ResourceType = resourceType; ActionType = actionType; @@ -85,28 +57,30 @@ internal ScheduledActionProperties(ScheduledActionResourceType resourceType, Sch NotificationSettings = notificationSettings; Disabled = disabled; ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The type of resource the scheduled action is targeting. public ScheduledActionResourceType ResourceType { get; set; } + /// The action the scheduled action should perform in the resources. public ScheduledActionType ActionType { get; set; } + /// The time which the scheduled action is supposed to start running. public DateTimeOffset StartOn { get; set; } + /// The time when the scheduled action is supposed to stop scheduling. public DateTimeOffset? EndOn { get; set; } + /// The schedule the scheduled action is supposed to follow. public ScheduledActionsSchedule Schedule { get; set; } + /// The notification settings for the scheduled action. public IList NotificationSettings { get; } + /// Tell if the scheduled action is disabled or not. public bool? Disabled { get; set; } + /// The status of the last provisioning operation performed on the resource. public ScheduledActionResourceProvisioningState? ProvisioningState { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.Serialization.cs index 768d120a00bb..163ff9778c82 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResourceAttachContent : IUtf8JsonSerializable, IJsonModel + /// Request model to attach a list of scheduled action resources. + public partial class ScheduledActionResourceAttachContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourceAttachContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,28 +35,27 @@ void IJsonModel.Write(Utf8JsonWriter write /// 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(ScheduledActionResourceAttachContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("resources"u8); writer.WriteStartArray(); - foreach (var item in Resources) + foreach (ScheduledActionResourceData item in Resources) { 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); } @@ -58,35 +64,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionResourceAttachContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourceAttachContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceAttachContent 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(ScheduledActionResourceAttachContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourceAttachContent(document.RootElement, options); } - internal static ScheduledActionResourceAttachContent DeserializeScheduledActionResourceAttachContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourceAttachContent DeserializeScheduledActionResourceAttachContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList resources = 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("resources"u8)) + if (prop.NameEquals("resources"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionResourceData.DeserializeScheduledActionResourceData(item, options)); } @@ -95,17 +105,19 @@ internal static ScheduledActionResourceAttachContent DeserializeScheduledActionR } 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 ScheduledActionResourceAttachContent(resources, serializedAdditionalRawData); + return new ScheduledActionResourceAttachContent(resources, 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": @@ -115,15 +127,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ScheduledActionResourceAttachContent 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. + ScheduledActionResourceAttachContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceAttachContent 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 DeserializeScheduledActionResourceAttachContent(document.RootElement, options); } default: @@ -131,6 +148,19 @@ ScheduledActionResourceAttachContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ScheduledActionResourceAttachContent scheduledActionResourceAttachContent) + { + if (scheduledActionResourceAttachContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(scheduledActionResourceAttachContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.cs index 12739d4beb78..0a4fac6b03ba 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceAttachContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Request model to attach a list of scheduled action resources. public partial class ScheduledActionResourceAttachContent { - /// - /// 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 . /// List of resources to be attached/patched. @@ -58,16 +30,11 @@ public ScheduledActionResourceAttachContent(IEnumerable Initializes a new instance of . /// List of resources to be attached/patched. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourceAttachContent(IList resources, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourceAttachContent(IList resources, IDictionary additionalBinaryDataProperties) { Resources = resources; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourceAttachContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// List of resources to be attached/patched. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.Serialization.cs index 557ab18ab2cb..b296c92f646a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.Serialization.cs @@ -8,17 +8,22 @@ 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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResourceData : IUtf8JsonSerializable, IJsonModel + /// Represents an scheduled action resource metadata. + public partial class ScheduledActionResourceData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourceData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,122 +33,145 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + 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(ScheduledActionResourceData)} does not support writing '{format}' format."); } - - base.JsonModelWriteCore(writer, options); + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); if (Optional.IsCollectionDefined(NotificationSettings)) { writer.WritePropertyName("notificationSettings"u8); writer.WriteStartArray(); - foreach (var item in NotificationSettings) + foreach (NotificationSettings item in NotificationSettings) { 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 + } + } } - ScheduledActionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceData 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(ScheduledActionResourceData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourceData(document.RootElement, options); } - internal static ScheduledActionResourceData DeserializeScheduledActionResourceData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourceData DeserializeScheduledActionResourceData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string name = default; + ResourceIdentifier id = default; + string @type = default; ResourceIdentifier resourceId = default; IList notificationSettings = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = 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("resourceId"u8)) + if (prop.NameEquals("name"u8)) { - resourceId = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("notificationSettings"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); - } - notificationSettings = array; - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("resourceId"u8)) { - type = new ResourceType(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("notificationSettings"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, AzureResourceManagerComputeScheduleContext.Default); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); + } + notificationSettings = array; 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 ScheduledActionResourceData( - id, name, - type, - systemData, + id, + @type, resourceId, notificationSettings ?? 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": @@ -153,15 +181,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - ScheduledActionResourceData 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. + ScheduledActionResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceData 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 DeserializeScheduledActionResourceData(document.RootElement, options); } default: @@ -169,6 +202,7 @@ ScheduledActionResourceData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.cs index 90a885b95c8f..1f18ef8dbbf9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceData.cs @@ -8,44 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Models; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Represents an scheduled action resource metadata. - public partial class ScheduledActionResourceData : ResourceData + public partial class ScheduledActionResourceData { - /// - /// 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 . /// @@ -62,33 +33,40 @@ public ScheduledActionResourceData(ResourceIdentifier resourceId) } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// The name of the resource. + /// The compute RP resource id of the resource in the scheduled actions scope. . + /// The type of resource. /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// /// The desired notification settings for the specified resource. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier resourceId, IList notificationSettings, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourceData(string name, ResourceIdentifier id, string @type, ResourceIdentifier resourceId, IList notificationSettings, IDictionary additionalBinaryDataProperties) { + Name = name; + Id = id; + Type = @type; ResourceId = resourceId; NotificationSettings = notificationSettings; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourceData() - { - } + /// The name of the resource. + public string Name { get; } + + /// The compute RP resource id of the resource in the scheduled actions scope. . + public ResourceIdentifier Id { get; } + + /// The type of resource. + public string Type { get; } /// /// The ARM Id of the resource. /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}" /// public ResourceIdentifier ResourceId { get; set; } + /// The desired notification settings for the specified resource. public IList NotificationSettings { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.Serialization.cs index ff1db15f460b..cd68cad49765 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResourceDetachContent : IUtf8JsonSerializable, IJsonModel + /// Request model to detach a list of scheduled action resources. + public partial class ScheduledActionResourceDetachContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourceDetachContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter write /// 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(ScheduledActionResourceDetachContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("resources"u8); writer.WriteStartArray(); - foreach (var item in Resources) + foreach (ResourceIdentifier item in Resources) { if (item == null) { @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(item); } 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); } @@ -63,35 +69,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionResourceDetachContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourceDetachContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceDetachContent 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(ScheduledActionResourceDetachContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourceDetachContent(document.RootElement, options); } - internal static ScheduledActionResourceDetachContent DeserializeScheduledActionResourceDetachContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourceDetachContent DeserializeScheduledActionResourceDetachContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList resources = 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("resources"u8)) + if (prop.NameEquals("resources"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { @@ -107,17 +117,19 @@ internal static ScheduledActionResourceDetachContent DeserializeScheduledActionR } 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 ScheduledActionResourceDetachContent(resources, serializedAdditionalRawData); + return new ScheduledActionResourceDetachContent(resources, 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": @@ -127,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ScheduledActionResourceDetachContent 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. + ScheduledActionResourceDetachContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceDetachContent 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 DeserializeScheduledActionResourceDetachContent(document.RootElement, options); } default: @@ -143,6 +160,19 @@ ScheduledActionResourceDetachContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ScheduledActionResourceDetachContent scheduledActionResourceDetachContent) + { + if (scheduledActionResourceDetachContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(scheduledActionResourceDetachContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.cs index 6dd1a99d7840..797dcc504d74 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceDetachContent.cs @@ -9,43 +9,15 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Request model to detach a list of scheduled action resources. public partial class ScheduledActionResourceDetachContent { - /// - /// 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 . /// List of resources to be detached. @@ -59,16 +31,11 @@ public ScheduledActionResourceDetachContent(IEnumerable reso /// Initializes a new instance of . /// List of resources to be detached. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourceDetachContent(IList resources, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourceDetachContent(IList resources, IDictionary additionalBinaryDataProperties) { Resources = resources; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourceDetachContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// List of resources to be detached. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.Serialization.cs index 11520536ad4a..2da86ab3923f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// The response from scheduled action resource requests, which contains the status of each resource. + public partial class ScheduledActionResourceOperationResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourceOperationResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,30 +35,29 @@ void IJsonModel.Write(Utf8JsonWriter wri /// 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(ScheduledActionResourceOperationResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("totalResources"u8); writer.WriteNumberValue(TotalResources); writer.WritePropertyName("resourcesStatuses"u8); writer.WriteStartArray(); - foreach (var item in ResourcesStatuses) + foreach (ScheduledActionResourceStatus item in ResourcesStatuses) { 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); } @@ -60,41 +66,45 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceOperationResult 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(ScheduledActionResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourceOperationResult(document.RootElement, options); } - internal static ScheduledActionResourceOperationResult DeserializeScheduledActionResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourceOperationResult DeserializeScheduledActionResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int totalResources = default; - IReadOnlyList resourcesStatuses = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList resourcesStatuses = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("totalResources"u8)) + if (prop.NameEquals("totalResources"u8)) { - totalResources = property.Value.GetInt32(); + totalResources = prop.Value.GetInt32(); continue; } - if (property.NameEquals("resourcesStatuses"u8)) + if (prop.NameEquals("resourcesStatuses"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionResourceStatus.DeserializeScheduledActionResourceStatus(item, options)); } @@ -103,17 +113,19 @@ internal static ScheduledActionResourceOperationResult DeserializeScheduledActio } 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 ScheduledActionResourceOperationResult(totalResources, resourcesStatuses, serializedAdditionalRawData); + return new ScheduledActionResourceOperationResult(totalResources, resourcesStatuses, 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 +135,20 @@ BinaryData IPersistableModel.Write(Model } } - ScheduledActionResourceOperationResult 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. + ScheduledActionResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceOperationResult 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 DeserializeScheduledActionResourceOperationResult(document.RootElement, options); } default: @@ -139,6 +156,14 @@ ScheduledActionResourceOperationResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static ScheduledActionResourceOperationResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScheduledActionResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.cs index fee71ec669ee..ef5d0cb9ef81 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationResult.cs @@ -14,46 +14,14 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The response from scheduled action resource requests, which contains the status of each resource. public partial class ScheduledActionResourceOperationResult { - /// - /// 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 total number of resources operated on. /// The resource status of for each resource. - /// is null. internal ScheduledActionResourceOperationResult(int totalResources, IEnumerable resourcesStatuses) { - Argument.AssertNotNull(resourcesStatuses, nameof(resourcesStatuses)); - TotalResources = totalResources; ResourcesStatuses = resourcesStatuses.ToList(); } @@ -61,22 +29,18 @@ internal ScheduledActionResourceOperationResult(int totalResources, IEnumerable< /// Initializes a new instance of . /// The total number of resources operated on. /// The resource status of for each resource. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourceOperationResult(int totalResources, IReadOnlyList resourcesStatuses, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourceOperationResult(int totalResources, IList resourcesStatuses, IDictionary additionalBinaryDataProperties) { TotalResources = totalResources; ResourcesStatuses = resourcesStatuses; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourceOperationResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The total number of resources operated on. public int TotalResources { get; } + /// The resource status of for each resource. - public IReadOnlyList ResourcesStatuses { get; } + public IList ResourcesStatuses { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationStatus.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationStatus.cs index 3c57d812c97e..370e3f6e463a 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationStatus.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceOperationStatus.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,38 +15,57 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionResourceOperationStatus : IEquatable { private readonly string _value; + /// The resource operation was successful. + private const string SucceededValue = "Succeeded"; + /// The resource operation has failed. + private const string FailedValue = "Failed"; /// Initializes a new instance of . + /// The value. /// is null. public ScheduledActionResourceOperationStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; + _value = value; + } /// The resource operation was successful. public static ScheduledActionResourceOperationStatus Succeeded { get; } = new ScheduledActionResourceOperationStatus(SucceededValue); + /// The resource operation has failed. public static ScheduledActionResourceOperationStatus Failed { get; } = new ScheduledActionResourceOperationStatus(FailedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionResourceOperationStatus left, ScheduledActionResourceOperationStatus 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 !=(ScheduledActionResourceOperationStatus left, ScheduledActionResourceOperationStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionResourceOperationStatus(string value) => new ScheduledActionResourceOperationStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionResourceOperationStatus?(string value) => value == null ? null : new ScheduledActionResourceOperationStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionResourceOperationStatus other && Equals(other); - /// + + /// public bool Equals(ScheduledActionResourceOperationStatus 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.Serialization.cs index c7f9559383cb..111345525c20 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResourcePatchContent : IUtf8JsonSerializable, IJsonModel + /// Request model perform a resource operation in a list of resources. + public partial class ScheduledActionResourcePatchContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourcePatchContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,28 +35,27 @@ void IJsonModel.Write(Utf8JsonWriter 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ScheduledActionResourcePatchContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("resources"u8); writer.WriteStartArray(); - foreach (var item in Resources) + foreach (ScheduledActionResourceData item in Resources) { 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); } @@ -58,35 +64,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionResourcePatchContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourcePatchContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourcePatchContent 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(ScheduledActionResourcePatchContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourcePatchContent(document.RootElement, options); } - internal static ScheduledActionResourcePatchContent DeserializeScheduledActionResourcePatchContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourcePatchContent DeserializeScheduledActionResourcePatchContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList resources = 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("resources"u8)) + if (prop.NameEquals("resources"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionResourceData.DeserializeScheduledActionResourceData(item, options)); } @@ -95,17 +105,19 @@ internal static ScheduledActionResourcePatchContent DeserializeScheduledActionRe } 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 ScheduledActionResourcePatchContent(resources, serializedAdditionalRawData); + return new ScheduledActionResourcePatchContent(resources, 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": @@ -115,15 +127,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - ScheduledActionResourcePatchContent 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. + ScheduledActionResourcePatchContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourcePatchContent 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 DeserializeScheduledActionResourcePatchContent(document.RootElement, options); } default: @@ -131,6 +148,19 @@ ScheduledActionResourcePatchContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ScheduledActionResourcePatchContent scheduledActionResourcePatchContent) + { + if (scheduledActionResourcePatchContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(scheduledActionResourcePatchContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.cs index b3054dc76f12..2de2f844e867 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcePatchContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Request model perform a resource operation in a list of resources. public partial class ScheduledActionResourcePatchContent { - /// - /// 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 list of resources we watch to patch. @@ -58,16 +30,11 @@ public ScheduledActionResourcePatchContent(IEnumerable Initializes a new instance of . /// The list of resources we watch to patch. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourcePatchContent(IList resources, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourcePatchContent(IList resources, IDictionary additionalBinaryDataProperties) { Resources = resources; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourcePatchContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The list of resources we watch to patch. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceProvisioningState.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceProvisioningState.cs index 3ce4fe2192e9..56185d6a2eb6 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceProvisioningState.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceProvisioningState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,44 +15,67 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionResourceProvisioningState : IEquatable { private readonly string _value; + /// Resource has been created. + private const string SucceededValue = "Succeeded"; + /// Resource creation failed. + private const string FailedValue = "Failed"; + /// Resource creation was canceled. + private const string CanceledValue = "Canceled"; + /// Resource is being deleted. + private const string DeletingValue = "Deleting"; /// Initializes a new instance of . + /// The value. /// is null. public ScheduledActionResourceProvisioningState(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string DeletingValue = "Deleting"; + _value = value; + } /// Resource has been created. public static ScheduledActionResourceProvisioningState Succeeded { get; } = new ScheduledActionResourceProvisioningState(SucceededValue); + /// Resource creation failed. public static ScheduledActionResourceProvisioningState Failed { get; } = new ScheduledActionResourceProvisioningState(FailedValue); + /// Resource creation was canceled. public static ScheduledActionResourceProvisioningState Canceled { get; } = new ScheduledActionResourceProvisioningState(CanceledValue); + /// Resource is being deleted. public static ScheduledActionResourceProvisioningState Deleting { get; } = new ScheduledActionResourceProvisioningState(DeletingValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionResourceProvisioningState left, ScheduledActionResourceProvisioningState 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 !=(ScheduledActionResourceProvisioningState left, ScheduledActionResourceProvisioningState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionResourceProvisioningState(string value) => new ScheduledActionResourceProvisioningState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionResourceProvisioningState?(string value) => value == null ? null : new ScheduledActionResourceProvisioningState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionResourceProvisioningState other && Equals(other); - /// + + /// public bool Equals(ScheduledActionResourceProvisioningState 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.Serialization.cs index d10093ea79e4..676007cbcd4f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.Serialization.cs @@ -10,14 +10,22 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResourceStatus : IUtf8JsonSerializable, IJsonModel + /// The status of a resource after a resource level operation was performed. + public partial class ScheduledActionResourceStatus : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourceStatus() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -29,12 +37,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(ScheduledActionResourceStatus)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); writer.WritePropertyName("status"u8); @@ -44,15 +51,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("error"u8); ((IJsonModel)Error).Write(writer, options); } - 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,22 +68,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionResourceStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourceStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceStatus 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(ScheduledActionResourceStatus)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourceStatus(document.RootElement, options); } - internal static ScheduledActionResourceStatus DeserializeScheduledActionResourceStatus(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourceStatus DeserializeScheduledActionResourceStatus(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -84,42 +96,43 @@ internal static ScheduledActionResourceStatus DeserializeScheduledActionResource ResourceIdentifier resourceId = default; ScheduledActionResourceOperationStatus status = default; ResponseError error = 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("resourceId"u8)) + if (prop.NameEquals("resourceId"u8)) { - resourceId = new ResourceIdentifier(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = new ScheduledActionResourceOperationStatus(property.Value.GetString()); + status = new ScheduledActionResourceOperationStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerComputeScheduleContext.Default); + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.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 ScheduledActionResourceStatus(resourceId, status, error, serializedAdditionalRawData); + return new ScheduledActionResourceStatus(resourceId, status, error, 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": @@ -129,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ScheduledActionResourceStatus 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. + ScheduledActionResourceStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourceStatus 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 DeserializeScheduledActionResourceStatus(document.RootElement, options); } default: @@ -145,6 +163,7 @@ ScheduledActionResourceStatus IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.cs index 5a4f18b46331..6295f37b6c99 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceStatus.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure; using Azure.Core; namespace Azure.ResourceManager.ComputeSchedule.Models @@ -14,46 +15,14 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The status of a resource after a resource level operation was performed. public partial class ScheduledActionResourceStatus { - /// - /// 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 arm identifier of the resource. /// The state the resource is currently on. - /// is null. internal ScheduledActionResourceStatus(ResourceIdentifier resourceId, ScheduledActionResourceOperationStatus status) { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - ResourceId = resourceId; Status = status; } @@ -62,24 +31,21 @@ internal ScheduledActionResourceStatus(ResourceIdentifier resourceId, ScheduledA /// The arm identifier of the resource. /// The state the resource is currently on. /// Errors encountered while trying to perform. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourceStatus(ResourceIdentifier resourceId, ScheduledActionResourceOperationStatus status, ResponseError error, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourceStatus(ResourceIdentifier resourceId, ScheduledActionResourceOperationStatus status, ResponseError error, IDictionary additionalBinaryDataProperties) { ResourceId = resourceId; Status = status; Error = error; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourceStatus() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The arm identifier of the resource. public ResourceIdentifier ResourceId { get; } + /// The state the resource is currently on. public ScheduledActionResourceOperationStatus Status { get; } + /// Errors encountered while trying to perform. public ResponseError Error { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceType.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceType.cs index 8e9aac9acbc7..7d03818fd676 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceType.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourceType.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,38 +15,57 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionResourceType : IEquatable { private readonly string _value; + /// Resources defined are Virtual Machines. + private const string VirtualMachineValue = "VirtualMachine"; + /// Resources defined are Virtual Machines Scale Sets. + private const string VirtualMachineScaleSetValue = "VirtualMachineScaleSet"; /// Initializes a new instance of . + /// The value. /// is null. public ScheduledActionResourceType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string VirtualMachineValue = "VirtualMachine"; - private const string VirtualMachineScaleSetValue = "VirtualMachineScaleSet"; + _value = value; + } /// Resources defined are Virtual Machines. public static ScheduledActionResourceType VirtualMachine { get; } = new ScheduledActionResourceType(VirtualMachineValue); + /// Resources defined are Virtual Machines Scale Sets. public static ScheduledActionResourceType VirtualMachineScaleSet { get; } = new ScheduledActionResourceType(VirtualMachineScaleSetValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionResourceType left, ScheduledActionResourceType 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 !=(ScheduledActionResourceType left, ScheduledActionResourceType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionResourceType(string value) => new ScheduledActionResourceType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionResourceType?(string value) => value == null ? null : new ScheduledActionResourceType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionResourceType other && Equals(other); - /// + + /// public bool Equals(ScheduledActionResourceType 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.Serialization.cs index e5ab64275a1c..72c27efa2a36 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.Serialization.cs @@ -11,14 +11,16 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionResources : IUtf8JsonSerializable, IJsonModel + /// The scheduled action extension. + public partial class ScheduledActionResources : ResourceData, 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(); @@ -30,12 +32,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// 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(ScheduledActionResources)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -44,87 +45,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ScheduledActionResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ScheduledActionResources)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(ScheduledActionResources)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResources(document.RootElement, options); } - internal static ScheduledActionResources DeserializeScheduledActionResources(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResources DeserializeScheduledActionResources(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ScheduledActionsExtensionProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + ScheduledActionsExtensionProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = ScheduledActionsExtensionProperties.DeserializeScheduledActionsExtensionProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("systemData"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.Default); 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, AzureResourceManagerComputeScheduleContext.Default); + properties = ScheduledActionsExtensionProperties.DeserializeScheduledActionsExtensionProperties(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 ScheduledActionResources( id, name, - type, + resourceType, systemData, - properties, - serializedAdditionalRawData); + additionalBinaryDataProperties, + properties); } - 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 +149,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - ScheduledActionResources 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. + ScheduledActionResources IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ScheduledActionResources)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 DeserializeScheduledActionResources(document.RootElement, options); } default: @@ -150,6 +170,7 @@ ScheduledActionResources IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.cs index 28c3fd9c1428..fec764c1c7b2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResources.cs @@ -15,37 +15,8 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The scheduled action extension. public partial class ScheduledActionResources : ResourceData { - /// - /// 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 ScheduledActionResources() @@ -53,16 +24,16 @@ internal ScheduledActionResources() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResources(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ScheduledActionsExtensionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ScheduledActionResources(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, ScheduledActionsExtensionProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } /// The resource-specific properties for this resource. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.Serialization.cs index 483812116454..92ae5c83c232 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.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.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - internal partial class ScheduledActionResourcesListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a ScheduledActionResources list operation. + internal partial class ScheduledActionResourcesListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionResourcesListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ScheduledActionResourcesListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (ScheduledActionResources item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourcesListResult 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(ScheduledActionResourcesListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionResourcesListResult(document.RootElement, options); } - internal static ScheduledActionResourcesListResult DeserializeScheduledActionResourcesListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionResourcesListResult DeserializeScheduledActionResourcesListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ScheduledActionResources.DeserializeScheduledActionResources(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = 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 ScheduledActionResourcesListResult(value, nextLink, serializedAdditionalRawData); + return new ScheduledActionResourcesListResult(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - ScheduledActionResourcesListResult 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. + ScheduledActionResourcesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionResourcesListResult 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 DeserializeScheduledActionResourcesListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ ScheduledActionResourcesListResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static ScheduledActionResourcesListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScheduledActionResourcesListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.cs index afb28a605a22..5c49daf37010 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionResourcesListResult.cs @@ -14,66 +14,30 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The response of a ScheduledActionResources list operation. internal partial class ScheduledActionResourcesListResult { - /// - /// 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 ScheduledActionResources items on this page. - /// is null. internal ScheduledActionResourcesListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The ScheduledActionResources items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionResourcesListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionResourcesListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionResourcesListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ScheduledActionResources items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionType.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionType.cs index ea214bae5b36..d34b6163934e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionType.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionType.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,41 +15,62 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionType : IEquatable { private readonly string _value; + /// Perform a start action on the specified resources. + private const string StartValue = "Start"; + /// Perform a deallocate action on the specified resources. + private const string DeallocateValue = "Deallocate"; + /// Perform hibernate and deallocate on the specified resources. + private const string HibernateValue = "Hibernate"; /// Initializes a new instance of . + /// The value. /// is null. public ScheduledActionType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string StartValue = "Start"; - private const string DeallocateValue = "Deallocate"; - private const string HibernateValue = "Hibernate"; + _value = value; + } /// Perform a start action on the specified resources. public static ScheduledActionType Start { get; } = new ScheduledActionType(StartValue); + /// Perform a deallocate action on the specified resources. public static ScheduledActionType Deallocate { get; } = new ScheduledActionType(DeallocateValue); + /// Perform hibernate and deallocate on the specified resources. public static ScheduledActionType Hibernate { get; } = new ScheduledActionType(HibernateValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionType left, ScheduledActionType 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 !=(ScheduledActionType left, ScheduledActionType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionType(string value) => new ScheduledActionType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionType?(string value) => value == null ? null : new ScheduledActionType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionType other && Equals(other); - /// + + /// public bool Equals(ScheduledActionType 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.Serialization.cs index ce3b84d78d6c..0c0889c2471f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionsExtensionProperties : IUtf8JsonSerializable, IJsonModel + /// Scheduled action extension properties. + public partial class ScheduledActionsExtensionProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionsExtensionProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ScheduledActionsExtensionProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceType"u8); writer.WriteStringValue(ResourceType.ToString()); writer.WritePropertyName("actionType"u8); @@ -49,7 +54,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("notificationSettings"u8); writer.WriteStartArray(); - foreach (var item in NotificationSettings) + foreach (NotificationSettings item in NotificationSettings) { writer.WriteObjectValue(item, options); } @@ -68,21 +73,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("resourceNotificationSettings"u8); writer.WriteStartArray(); - foreach (var item in ResourceNotificationSettings) + foreach (NotificationSettings item in ResourceNotificationSettings) { 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); } @@ -91,104 +96,108 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionsExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionsExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionsExtensionProperties 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(ScheduledActionsExtensionProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionsExtensionProperties(document.RootElement, options); } - internal static ScheduledActionsExtensionProperties DeserializeScheduledActionsExtensionProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionsExtensionProperties DeserializeScheduledActionsExtensionProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ScheduledActionResourceType resourceType = default; ScheduledActionType actionType = default; - DateTimeOffset startTime = default; - DateTimeOffset? endTime = default; + DateTimeOffset startOn = default; + DateTimeOffset? endOn = default; ScheduledActionsSchedule schedule = default; - IReadOnlyList notificationSettings = default; + IList notificationSettings = default; bool? disabled = default; ScheduledActionResourceProvisioningState? provisioningState = default; IReadOnlyList resourceNotificationSettings = 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("resourceType"u8)) + if (prop.NameEquals("resourceType"u8)) { - resourceType = new ScheduledActionResourceType(property.Value.GetString()); + resourceType = new ScheduledActionResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("actionType"u8)) + if (prop.NameEquals("actionType"u8)) { - actionType = new ScheduledActionType(property.Value.GetString()); + actionType = new ScheduledActionType(prop.Value.GetString()); continue; } - if (property.NameEquals("startTime"u8)) + if (prop.NameEquals("startTime"u8)) { - startTime = property.Value.GetDateTimeOffset("O"); + startOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("endTime"u8)) + if (prop.NameEquals("endTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - endTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("schedule"u8)) + if (prop.NameEquals("schedule"u8)) { - schedule = ScheduledActionsSchedule.DeserializeScheduledActionsSchedule(property.Value, options); + schedule = ScheduledActionsSchedule.DeserializeScheduledActionsSchedule(prop.Value, options); continue; } - if (property.NameEquals("notificationSettings"u8)) + if (prop.NameEquals("notificationSettings"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); } notificationSettings = array; continue; } - if (property.NameEquals("disabled"u8)) + if (prop.NameEquals("disabled"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - disabled = property.Value.GetBoolean(); + disabled = prop.Value.GetBoolean(); 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 ScheduledActionResourceProvisioningState(property.Value.GetString()); + provisioningState = new ScheduledActionResourceProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("resourceNotificationSettings"u8)) + if (prop.NameEquals("resourceNotificationSettings"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(Models.NotificationSettings.DeserializeNotificationSettings(item, options)); } @@ -197,27 +206,29 @@ internal static ScheduledActionsExtensionProperties DeserializeScheduledActionsE } 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 ScheduledActionsExtensionProperties( resourceType, actionType, - startTime, - endTime, + startOn, + endOn, schedule, notificationSettings, disabled, provisioningState, resourceNotificationSettings ?? 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": @@ -227,15 +238,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - ScheduledActionsExtensionProperties 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. + ScheduledActionsExtensionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionsExtensionProperties 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 DeserializeScheduledActionsExtensionProperties(document.RootElement, options); } default: @@ -243,6 +259,7 @@ ScheduledActionsExtensionProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.cs index 01ac56c3a4f1..a758e14c4640 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsExtensionProperties.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Scheduled action extension properties. public partial class ScheduledActionsExtensionProperties { - /// - /// 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 type of resource the scheduled action is targeting. @@ -52,12 +24,8 @@ public partial class ScheduledActionsExtensionProperties /// The time which the scheduled action is supposed to start running. /// The schedule the scheduled action is supposed to follow. /// The notification settings for the scheduled action. - /// or is null. internal ScheduledActionsExtensionProperties(ScheduledActionResourceType resourceType, ScheduledActionType actionType, DateTimeOffset startOn, ScheduledActionsSchedule schedule, IEnumerable notificationSettings) { - Argument.AssertNotNull(schedule, nameof(schedule)); - Argument.AssertNotNull(notificationSettings, nameof(notificationSettings)); - ResourceType = resourceType; ActionType = actionType; StartOn = startOn; @@ -76,8 +44,8 @@ internal ScheduledActionsExtensionProperties(ScheduledActionResourceType resourc /// Tell if the scheduled action is disabled or not. /// The status of the last provisioning operation performed on the resource. /// The notification settings for the scheduled action at a resource level. Resource level notification settings are scope to specific resources only and submitted through attach requests. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionsExtensionProperties(ScheduledActionResourceType resourceType, ScheduledActionType actionType, DateTimeOffset startOn, DateTimeOffset? endOn, ScheduledActionsSchedule schedule, IReadOnlyList notificationSettings, bool? disabled, ScheduledActionResourceProvisioningState? provisioningState, IReadOnlyList resourceNotificationSettings, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionsExtensionProperties(ScheduledActionResourceType resourceType, ScheduledActionType actionType, DateTimeOffset startOn, DateTimeOffset? endOn, ScheduledActionsSchedule schedule, IList notificationSettings, bool? disabled, ScheduledActionResourceProvisioningState? provisioningState, IReadOnlyList resourceNotificationSettings, IDictionary additionalBinaryDataProperties) { ResourceType = resourceType; ActionType = actionType; @@ -88,30 +56,33 @@ internal ScheduledActionsExtensionProperties(ScheduledActionResourceType resourc Disabled = disabled; ProvisioningState = provisioningState; ResourceNotificationSettings = resourceNotificationSettings; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionsExtensionProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The type of resource the scheduled action is targeting. public ScheduledActionResourceType ResourceType { get; } + /// The action the scheduled action should perform in the resources. public ScheduledActionType ActionType { get; } + /// The time which the scheduled action is supposed to start running. public DateTimeOffset StartOn { get; } + /// The time when the scheduled action is supposed to stop scheduling. public DateTimeOffset? EndOn { get; } + /// The schedule the scheduled action is supposed to follow. public ScheduledActionsSchedule Schedule { get; } + /// The notification settings for the scheduled action. - public IReadOnlyList NotificationSettings { get; } + public IList NotificationSettings { get; } + /// Tell if the scheduled action is disabled or not. public bool? Disabled { get; } + /// The status of the last provisioning operation performed on the resource. public ScheduledActionResourceProvisioningState? ProvisioningState { get; } + /// The notification settings for the scheduled action at a resource level. Resource level notification settings are scope to specific resources only and submitted through attach requests. public IReadOnlyList ResourceNotificationSettings { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.Serialization.cs index 5ebb769ebc78..9072e280ed94 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class ScheduledActionsSchedule : IUtf8JsonSerializable, IJsonModel + /// Specify the schedule in which the scheduled action is supposed to follow. + public partial class ScheduledActionsSchedule : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionsSchedule() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,33 +34,32 @@ 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(ScheduledActionsSchedule)} does not support writing '{format}' format."); } - writer.WritePropertyName("scheduledTime"u8); writer.WriteStringValue(ScheduledTime, "T"); writer.WritePropertyName("timeZone"u8); writer.WriteStringValue(TimeZone); writer.WritePropertyName("requestedWeekDays"u8); writer.WriteStartArray(); - foreach (var item in RequestedWeekDays) + foreach (ScheduledActionsScheduleWeekDay item in RequestedWeekDays) { writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); writer.WritePropertyName("requestedMonths"u8); writer.WriteStartArray(); - foreach (var item in RequestedMonths) + foreach (ScheduledActionsScheduleMonth item in RequestedMonths) { writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); writer.WritePropertyName("requestedDaysOfTheMonth"u8); writer.WriteStartArray(); - foreach (var item in RequestedDaysOfTheMonth) + foreach (int item in RequestedDaysOfTheMonth) { writer.WriteNumberValue(item); } @@ -69,15 +74,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("deadlineType"u8); writer.WriteStringValue(DeadlineType.Value.ToString()); } - 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); } @@ -86,22 +91,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ScheduledActionsSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionsSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ScheduledActionsSchedule 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(ScheduledActionsSchedule)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionsSchedule(document.RootElement, options); } - internal static ScheduledActionsSchedule DeserializeScheduledActionsSchedule(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionsSchedule DeserializeScheduledActionsSchedule(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -113,74 +123,72 @@ internal static ScheduledActionsSchedule DeserializeScheduledActionsSchedule(Jso IList requestedDaysOfTheMonth = default; ScheduledActionExecutionParameterDetail executionParameters = default; ScheduledActionDeadlineType? deadlineType = 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("scheduledTime"u8)) + if (prop.NameEquals("scheduledTime"u8)) { - scheduledTime = property.Value.GetTimeSpan("T"); + scheduledTime = prop.Value.GetTimeSpan("T"); continue; } - if (property.NameEquals("timeZone"u8)) + if (prop.NameEquals("timeZone"u8)) { - timeZone = property.Value.GetString(); + timeZone = prop.Value.GetString(); continue; } - if (property.NameEquals("requestedWeekDays"u8)) + if (prop.NameEquals("requestedWeekDays"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(new ScheduledActionsScheduleWeekDay(item.GetString())); } requestedWeekDays = array; continue; } - if (property.NameEquals("requestedMonths"u8)) + if (prop.NameEquals("requestedMonths"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(new ScheduledActionsScheduleMonth(item.GetString())); } requestedMonths = array; continue; } - if (property.NameEquals("requestedDaysOfTheMonth"u8)) + if (prop.NameEquals("requestedDaysOfTheMonth"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(item.GetInt32()); } requestedDaysOfTheMonth = array; continue; } - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("deadlineType"u8)) + if (prop.NameEquals("deadlineType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - deadlineType = new ScheduledActionDeadlineType(property.Value.GetString()); + deadlineType = new ScheduledActionDeadlineType(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 ScheduledActionsSchedule( scheduledTime, timeZone, @@ -189,13 +197,16 @@ internal static ScheduledActionsSchedule DeserializeScheduledActionsSchedule(Jso requestedDaysOfTheMonth, executionParameters, deadlineType, - 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": @@ -205,15 +216,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - ScheduledActionsSchedule 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. + ScheduledActionsSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ScheduledActionsSchedule 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 DeserializeScheduledActionsSchedule(document.RootElement, options); } default: @@ -221,6 +237,7 @@ ScheduledActionsSchedule IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.cs index 97cf2bd3e8f3..c766c84ed92d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsSchedule.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// Specify the schedule in which the scheduled action is supposed to follow. public partial class ScheduledActionsSchedule { - /// - /// 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 time the scheduled action is supposed to run on. @@ -75,8 +47,8 @@ public ScheduledActionsSchedule(TimeSpan scheduledTime, string timeZone, IEnumer /// The days of the month the scheduled action is supposed to run on. If empty, it means it will run on every day of the month. /// The execution parameters the scheduled action is supposed to follow. /// The type of deadline the scheduled action is supposed to follow for the schedule. If no value is passed, it will default to InitiateAt. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionsSchedule(TimeSpan scheduledTime, string timeZone, IList requestedWeekDays, IList requestedMonths, IList requestedDaysOfTheMonth, ScheduledActionExecutionParameterDetail executionParameters, ScheduledActionDeadlineType? deadlineType, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ScheduledActionsSchedule(TimeSpan scheduledTime, string timeZone, IList requestedWeekDays, IList requestedMonths, IList requestedDaysOfTheMonth, ScheduledActionExecutionParameterDetail executionParameters, ScheduledActionDeadlineType? deadlineType, IDictionary additionalBinaryDataProperties) { ScheduledTime = scheduledTime; TimeZone = timeZone; @@ -85,26 +57,27 @@ internal ScheduledActionsSchedule(TimeSpan scheduledTime, string timeZone, IList RequestedDaysOfTheMonth = requestedDaysOfTheMonth; ExecutionParameters = executionParameters; DeadlineType = deadlineType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionsSchedule() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time the scheduled action is supposed to run on. public TimeSpan ScheduledTime { get; set; } + /// The timezone the scheduled time is specified on. public string TimeZone { get; set; } + /// The week days the scheduled action is supposed to run on. public IList RequestedWeekDays { get; } + /// The months the scheduled action is supposed to run on. public IList RequestedMonths { get; } + /// The days of the month the scheduled action is supposed to run on. If empty, it means it will run on every day of the month. public IList RequestedDaysOfTheMonth { get; } + /// The execution parameters the scheduled action is supposed to follow. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; set; } + /// The type of deadline the scheduled action is supposed to follow for the schedule. If no value is passed, it will default to InitiateAt. public ScheduledActionDeadlineType? DeadlineType { get; set; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleMonth.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleMonth.cs index dc669cd80fc9..8797dab48f35 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleMonth.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleMonth.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,71 +15,112 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionsScheduleMonth : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledActionsScheduleMonth(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The January month. private const string JanuaryValue = "January"; + /// The February month. private const string FebruaryValue = "February"; + /// The March month. private const string MarchValue = "March"; + /// The April month. private const string AprilValue = "April"; + /// The May month. private const string MayValue = "May"; + /// The June month. private const string JuneValue = "June"; + /// The July month. private const string JulyValue = "July"; + /// The August month. private const string AugustValue = "August"; + /// The September month. private const string SeptemberValue = "September"; + /// The October month. private const string OctoberValue = "October"; + /// The November month. private const string NovemberValue = "November"; + /// The December month. private const string DecemberValue = "December"; + /// All months. private const string AllValue = "All"; + /// Initializes a new instance of . + /// The value. + /// is null. + public ScheduledActionsScheduleMonth(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The January month. public static ScheduledActionsScheduleMonth January { get; } = new ScheduledActionsScheduleMonth(JanuaryValue); + /// The February month. public static ScheduledActionsScheduleMonth February { get; } = new ScheduledActionsScheduleMonth(FebruaryValue); + /// The March month. public static ScheduledActionsScheduleMonth March { get; } = new ScheduledActionsScheduleMonth(MarchValue); + /// The April month. public static ScheduledActionsScheduleMonth April { get; } = new ScheduledActionsScheduleMonth(AprilValue); + /// The May month. public static ScheduledActionsScheduleMonth May { get; } = new ScheduledActionsScheduleMonth(MayValue); + /// The June month. public static ScheduledActionsScheduleMonth June { get; } = new ScheduledActionsScheduleMonth(JuneValue); + /// The July month. public static ScheduledActionsScheduleMonth July { get; } = new ScheduledActionsScheduleMonth(JulyValue); + /// The August month. public static ScheduledActionsScheduleMonth August { get; } = new ScheduledActionsScheduleMonth(AugustValue); + /// The September month. public static ScheduledActionsScheduleMonth September { get; } = new ScheduledActionsScheduleMonth(SeptemberValue); + /// The October month. public static ScheduledActionsScheduleMonth October { get; } = new ScheduledActionsScheduleMonth(OctoberValue); + /// The November month. public static ScheduledActionsScheduleMonth November { get; } = new ScheduledActionsScheduleMonth(NovemberValue); + /// The December month. public static ScheduledActionsScheduleMonth December { get; } = new ScheduledActionsScheduleMonth(DecemberValue); + /// All months. public static ScheduledActionsScheduleMonth All { get; } = new ScheduledActionsScheduleMonth(AllValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionsScheduleMonth left, ScheduledActionsScheduleMonth 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 !=(ScheduledActionsScheduleMonth left, ScheduledActionsScheduleMonth right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionsScheduleMonth(string value) => new ScheduledActionsScheduleMonth(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionsScheduleMonth?(string value) => value == null ? null : new ScheduledActionsScheduleMonth(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionsScheduleMonth other && Equals(other); - /// + + /// public bool Equals(ScheduledActionsScheduleMonth 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleWeekDay.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleWeekDay.cs index de30058e3485..e2209b8e90d7 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleWeekDay.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ScheduledActionsScheduleWeekDay.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { @@ -14,56 +15,87 @@ namespace Azure.ResourceManager.ComputeSchedule.Models public readonly partial struct ScheduledActionsScheduleWeekDay : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledActionsScheduleWeekDay(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// Monday weekday. private const string MondayValue = "Monday"; + /// Tuesday weekday. private const string TuesdayValue = "Tuesday"; + /// Wednesday weekday. private const string WednesdayValue = "Wednesday"; + /// Thursday weekday. private const string ThursdayValue = "Thursday"; + /// Friday weekday. private const string FridayValue = "Friday"; + /// Saturday weekday. private const string SaturdayValue = "Saturday"; + /// Sunday weekday. private const string SundayValue = "Sunday"; + /// All week days. private const string AllValue = "All"; + /// Initializes a new instance of . + /// The value. + /// is null. + public ScheduledActionsScheduleWeekDay(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// Monday weekday. public static ScheduledActionsScheduleWeekDay Monday { get; } = new ScheduledActionsScheduleWeekDay(MondayValue); + /// Tuesday weekday. public static ScheduledActionsScheduleWeekDay Tuesday { get; } = new ScheduledActionsScheduleWeekDay(TuesdayValue); + /// Wednesday weekday. public static ScheduledActionsScheduleWeekDay Wednesday { get; } = new ScheduledActionsScheduleWeekDay(WednesdayValue); + /// Thursday weekday. public static ScheduledActionsScheduleWeekDay Thursday { get; } = new ScheduledActionsScheduleWeekDay(ThursdayValue); + /// Friday weekday. public static ScheduledActionsScheduleWeekDay Friday { get; } = new ScheduledActionsScheduleWeekDay(FridayValue); + /// Saturday weekday. public static ScheduledActionsScheduleWeekDay Saturday { get; } = new ScheduledActionsScheduleWeekDay(SaturdayValue); + /// Sunday weekday. public static ScheduledActionsScheduleWeekDay Sunday { get; } = new ScheduledActionsScheduleWeekDay(SundayValue); + /// All week days. public static ScheduledActionsScheduleWeekDay All { get; } = new ScheduledActionsScheduleWeekDay(AllValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ScheduledActionsScheduleWeekDay left, ScheduledActionsScheduleWeekDay 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 !=(ScheduledActionsScheduleWeekDay left, ScheduledActionsScheduleWeekDay right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ScheduledActionsScheduleWeekDay(string value) => new ScheduledActionsScheduleWeekDay(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator ScheduledActionsScheduleWeekDay?(string value) => value == null ? null : new ScheduledActionsScheduleWeekDay(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScheduledActionsScheduleWeekDay other && Equals(other); - /// + + /// public bool Equals(ScheduledActionsScheduleWeekDay 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs index 8c414230ac56..dfa6b8d5ffe9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.Serialization.cs @@ -9,14 +9,22 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class StartResourceOperationResult : IUtf8JsonSerializable, IJsonModel + /// The response from a start request. + public partial class StartResourceOperationResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StartResourceOperationResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// 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(StartResourceOperationResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("type"u8); @@ -44,21 +51,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("results"u8); writer.WriteStartArray(); - foreach (var item in Results) + foreach (ResourceOperationResult item in Results) { 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); } @@ -67,57 +74,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StartResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StartResourceOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StartResourceOperationResult 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(StartResourceOperationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStartResourceOperationResult(document.RootElement, options); } - internal static StartResourceOperationResult DeserializeStartResourceOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StartResourceOperationResult DeserializeStartResourceOperationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string description = default; - string type = default; + string resourceType = default; AzureLocation location = default; IReadOnlyList results = 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("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + resourceType = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("results"u8)) + if (prop.NameEquals("results"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(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); } @@ -126,17 +137,19 @@ internal static StartResourceOperationResult DeserializeStartResourceOperationRe } 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 StartResourceOperationResult(description, type, location, results ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new StartResourceOperationResult(description, resourceType, location, results ?? 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": @@ -146,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - StartResourceOperationResult 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. + StartResourceOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StartResourceOperationResult 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 DeserializeStartResourceOperationResult(document.RootElement, options); } default: @@ -162,6 +180,14 @@ StartResourceOperationResult IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static StartResourceOperationResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStartResourceOperationResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.cs index 70152dd089af..82930b284b6e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/StartResourceOperationResult.cs @@ -8,54 +8,22 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The response from a start request. public partial class StartResourceOperationResult { - /// - /// 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 description of the operation response. /// The type of resources used in the start request eg virtual machines. /// The location of the start request eg westus. - /// or is null. internal StartResourceOperationResult(string description, string resourceType, AzureLocation location) { - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(resourceType, nameof(resourceType)); - Description = description; ResourceType = resourceType; Location = location; @@ -67,27 +35,25 @@ internal StartResourceOperationResult(string description, string resourceType, A /// The type of resources used in the start request eg virtual machines. /// The location of the start request eg westus. /// The results from the start request if no errors exist. - /// Keeps track of any properties unknown to the library. - internal StartResourceOperationResult(string description, string resourceType, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StartResourceOperationResult(string description, string resourceType, AzureLocation location, IReadOnlyList results, IDictionary additionalBinaryDataProperties) { Description = description; ResourceType = resourceType; Location = location; Results = results; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StartResourceOperationResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The description of the operation response. public string Description { get; } + /// The type of resources used in the start request eg virtual machines. public string ResourceType { get; } + /// The location of the start request eg westus. public AzureLocation Location { get; } + /// The results from the start request if no errors exist. public IReadOnlyList Results { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs index 897a68dc2fc5..f64a689321b3 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class SubmitDeallocateContent : IUtf8JsonSerializable, IJsonModel + /// The deallocate request for resources. + public partial class SubmitDeallocateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SubmitDeallocateContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,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(SubmitDeallocateContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("schedule"u8); writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("executionParameters"u8); @@ -42,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(Resources, options); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -59,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubmitDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SubmitDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SubmitDeallocateContent 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(SubmitDeallocateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSubmitDeallocateContent(document.RootElement, options); } - internal static SubmitDeallocateContent DeserializeSubmitDeallocateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SubmitDeallocateContent DeserializeSubmitDeallocateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -82,44 +93,45 @@ internal static SubmitDeallocateContent DeserializeSubmitDeallocateContent(JsonE UserRequestSchedule schedule = default; ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("schedule"u8)) + if (prop.NameEquals("schedule"u8)) { - schedule = UserRequestSchedule.DeserializeUserRequestSchedule(property.Value, options); + schedule = UserRequestSchedule.DeserializeUserRequestSchedule(prop.Value, options); continue; } - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 SubmitDeallocateContent(schedule, executionParameters, resources, correlationid, serializedAdditionalRawData); + return new SubmitDeallocateContent(schedule, executionParameters, resources, correlationId, 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": @@ -129,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - SubmitDeallocateContent 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. + SubmitDeallocateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SubmitDeallocateContent 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 DeserializeSubmitDeallocateContent(document.RootElement, options); } default: @@ -145,6 +162,19 @@ SubmitDeallocateContent IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(SubmitDeallocateContent submitDeallocateContent) + { + if (submitDeallocateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(submitDeallocateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.cs index 2952a6bd1942..da0cfbfabee6 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeallocateContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The deallocate request for resources. public partial class SubmitDeallocateContent { - /// - /// 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 schedule for the request. @@ -70,34 +42,35 @@ public SubmitDeallocateContent(UserRequestSchedule schedule, ScheduledActionExec /// The execution parameters for the request. /// The resources for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal SubmitDeallocateContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SubmitDeallocateContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary additionalBinaryDataProperties) { Schedule = schedule; ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SubmitDeallocateContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The schedule for the request. public UserRequestSchedule Schedule { get; } + /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } + + /// CorrelationId item. + public string CorrelationId { get; } + /// The resource ids used for the request. public IList ResourcesIds { - get => Resources?.Ids; + get + { + return Resources is null ? default : Resources.Ids; + } } - - /// CorrelationId item. - public string CorrelationId { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs index 661bed7e89bb..12f843699f2b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class SubmitHibernateContent : IUtf8JsonSerializable, IJsonModel + /// This is the request for hibernate. + public partial class SubmitHibernateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SubmitHibernateContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,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(SubmitHibernateContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("schedule"u8); writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("executionParameters"u8); @@ -42,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(Resources, options); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -59,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubmitHibernateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SubmitHibernateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SubmitHibernateContent 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(SubmitHibernateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSubmitHibernateContent(document.RootElement, options); } - internal static SubmitHibernateContent DeserializeSubmitHibernateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SubmitHibernateContent DeserializeSubmitHibernateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -82,44 +93,45 @@ internal static SubmitHibernateContent DeserializeSubmitHibernateContent(JsonEle UserRequestSchedule schedule = default; ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("schedule"u8)) + if (prop.NameEquals("schedule"u8)) { - schedule = UserRequestSchedule.DeserializeUserRequestSchedule(property.Value, options); + schedule = UserRequestSchedule.DeserializeUserRequestSchedule(prop.Value, options); continue; } - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 SubmitHibernateContent(schedule, executionParameters, resources, correlationid, serializedAdditionalRawData); + return new SubmitHibernateContent(schedule, executionParameters, resources, correlationId, 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": @@ -129,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - SubmitHibernateContent 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. + SubmitHibernateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SubmitHibernateContent 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 DeserializeSubmitHibernateContent(document.RootElement, options); } default: @@ -145,6 +162,19 @@ SubmitHibernateContent IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(SubmitHibernateContent submitHibernateContent) + { + if (submitHibernateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(submitHibernateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.cs index b1041e8e6daf..e775023bbd6b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitHibernateContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// This is the request for hibernate. public partial class SubmitHibernateContent { - /// - /// 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 schedule for the request. @@ -70,34 +42,35 @@ public SubmitHibernateContent(UserRequestSchedule schedule, ScheduledActionExecu /// The execution parameters for the request. /// The resources for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal SubmitHibernateContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SubmitHibernateContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary additionalBinaryDataProperties) { Schedule = schedule; ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SubmitHibernateContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The schedule for the request. public UserRequestSchedule Schedule { get; } + /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } + + /// CorrelationId item. + public string CorrelationId { get; } + /// The resource ids used for the request. public IList ResourcesIds { - get => Resources?.Ids; + get + { + return Resources is null ? default : Resources.Ids; + } } - - /// CorrelationId item. - public string CorrelationId { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs index 4cf83cb53be2..7e3c3ca61094 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class SubmitStartContent : IUtf8JsonSerializable, IJsonModel + /// This is the request for start. + public partial class SubmitStartContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SubmitStartContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// 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(SubmitStartContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("schedule"u8); writer.WriteObjectValue(Schedule, options); writer.WritePropertyName("executionParameters"u8); @@ -42,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(Resources, options); writer.WritePropertyName("correlationid"u8); writer.WriteStringValue(CorrelationId); - 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); } @@ -59,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubmitStartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SubmitStartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SubmitStartContent 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(SubmitStartContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSubmitStartContent(document.RootElement, options); } - internal static SubmitStartContent DeserializeSubmitStartContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SubmitStartContent DeserializeSubmitStartContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -82,44 +93,45 @@ internal static SubmitStartContent DeserializeSubmitStartContent(JsonElement ele UserRequestSchedule schedule = default; ScheduledActionExecutionParameterDetail executionParameters = default; UserRequestResources resources = default; - string correlationid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string correlationId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("schedule"u8)) + if (prop.NameEquals("schedule"u8)) { - schedule = UserRequestSchedule.DeserializeUserRequestSchedule(property.Value, options); + schedule = UserRequestSchedule.DeserializeUserRequestSchedule(prop.Value, options); continue; } - if (property.NameEquals("executionParameters"u8)) + if (prop.NameEquals("executionParameters"u8)) { - executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(prop.Value, options); continue; } - if (property.NameEquals("resources"u8)) + if (prop.NameEquals("resources"u8)) { - resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + resources = UserRequestResources.DeserializeUserRequestResources(prop.Value, options); continue; } - if (property.NameEquals("correlationid"u8)) + if (prop.NameEquals("correlationid"u8)) { - correlationid = property.Value.GetString(); + correlationId = 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 SubmitStartContent(schedule, executionParameters, resources, correlationid, serializedAdditionalRawData); + return new SubmitStartContent(schedule, executionParameters, resources, correlationId, 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": @@ -129,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - SubmitStartContent 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. + SubmitStartContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SubmitStartContent 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 DeserializeSubmitStartContent(document.RootElement, options); } default: @@ -145,6 +162,19 @@ SubmitStartContent IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(SubmitStartContent submitStartContent) + { + if (submitStartContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(submitStartContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.cs index 93fe60a99c9b..3fbbd72d7b1c 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitStartContent.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// This is the request for start. public partial class SubmitStartContent { - /// - /// 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 schedule for the request. @@ -70,34 +42,35 @@ public SubmitStartContent(UserRequestSchedule schedule, ScheduledActionExecution /// The execution parameters for the request. /// The resources for the request. /// CorrelationId item. - /// Keeps track of any properties unknown to the library. - internal SubmitStartContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SubmitStartContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationId, IDictionary additionalBinaryDataProperties) { Schedule = schedule; ExecutionParameters = executionParameters; Resources = resources; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SubmitStartContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The schedule for the request. public UserRequestSchedule Schedule { get; } + /// The execution parameters for the request. public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. internal UserRequestResources Resources { get; } + + /// CorrelationId item. + public string CorrelationId { get; } + /// The resource ids used for the request. public IList ResourcesIds { - get => Resources?.Ids; + get + { + return Resources is null ? default : Resources.Ids; + } } - - /// CorrelationId item. - public string CorrelationId { get; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs index 1a8e75496ed7..19b9447554e1 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class UserRequestResources : IUtf8JsonSerializable, IJsonModel + /// The resources needed for the user request. + public partial class UserRequestResources : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal UserRequestResources() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ 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(UserRequestResources)} does not support writing '{format}' format."); } - writer.WritePropertyName("ids"u8); writer.WriteStartArray(); - foreach (var item in Ids) + foreach (ResourceIdentifier item in Ids) { if (item == null) { @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(item); } 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); } @@ -63,35 +69,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UserRequestResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + UserRequestResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual UserRequestResources 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(UserRequestResources)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeUserRequestResources(document.RootElement, options); } - internal static UserRequestResources DeserializeUserRequestResources(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static UserRequestResources DeserializeUserRequestResources(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList ids = 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("ids"u8)) + if (prop.NameEquals("ids"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { @@ -107,17 +117,19 @@ internal static UserRequestResources DeserializeUserRequestResources(JsonElement } 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 UserRequestResources(ids, serializedAdditionalRawData); + return new UserRequestResources(ids, 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": @@ -127,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - UserRequestResources 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. + UserRequestResources IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual UserRequestResources 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 DeserializeUserRequestResources(document.RootElement, options); } default: @@ -143,6 +160,7 @@ UserRequestResources IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.cs index e4f9ec4a7e76..04a0c52bc2be 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestResources.cs @@ -9,43 +9,15 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { /// The resources needed for the user request. public partial class UserRequestResources { - /// - /// 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 resource ids used for the request. @@ -59,16 +31,11 @@ public UserRequestResources(IEnumerable ids) /// Initializes a new instance of . /// The resource ids used for the request. - /// Keeps track of any properties unknown to the library. - internal UserRequestResources(IList ids, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal UserRequestResources(IList ids, IDictionary additionalBinaryDataProperties) { Ids = ids; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal UserRequestResources() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The resource ids used for the request. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs index 42cd88f1a579..2646c2d04af9 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class UserRequestRetryPolicy : IUtf8JsonSerializable, IJsonModel + /// The retry policy for the user request. + public partial class UserRequestRetryPolicy : 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(UserRequestRetryPolicy)} does not support writing '{format}' format."); } - if (Optional.IsDefined(RetryCount)) { writer.WritePropertyName("retryCount"u8); @@ -44,15 +44,20 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("retryWindowInMinutes"u8); writer.WriteNumberValue(RetryWindowInMinutes.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (Optional.IsDefined(OnFailureAction)) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("onFailureAction"u8); + writer.WriteStringValue(OnFailureAction.Value.ToString()); + } + 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); } @@ -61,63 +66,79 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UserRequestRetryPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + UserRequestRetryPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual UserRequestRetryPolicy 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(UserRequestRetryPolicy)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeUserRequestRetryPolicy(document.RootElement, options); } - internal static UserRequestRetryPolicy DeserializeUserRequestRetryPolicy(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static UserRequestRetryPolicy DeserializeUserRequestRetryPolicy(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int? retryCount = default; int? retryWindowInMinutes = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + ResourceOperationType? onFailureAction = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("retryCount"u8)) + if (prop.NameEquals("retryCount"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - retryCount = property.Value.GetInt32(); + retryCount = prop.Value.GetInt32(); continue; } - if (property.NameEquals("retryWindowInMinutes"u8)) + if (prop.NameEquals("retryWindowInMinutes"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - retryWindowInMinutes = property.Value.GetInt32(); + retryWindowInMinutes = prop.Value.GetInt32(); + continue; + } + if (prop.NameEquals("onFailureAction"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onFailureAction = new ResourceOperationType(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 UserRequestRetryPolicy(retryCount, retryWindowInMinutes, serializedAdditionalRawData); + return new UserRequestRetryPolicy(retryCount, retryWindowInMinutes, onFailureAction, 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": @@ -127,15 +148,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - UserRequestRetryPolicy 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. + UserRequestRetryPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual UserRequestRetryPolicy 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 DeserializeUserRequestRetryPolicy(document.RootElement, options); } default: @@ -143,6 +169,7 @@ UserRequestRetryPolicy IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.cs index e993f3c7cf3e..d37e960f5f00 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestRetryPolicy.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The retry policy for the user request. public partial class UserRequestRetryPolicy { - /// - /// 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 UserRequestRetryPolicy() @@ -53,17 +24,23 @@ public UserRequestRetryPolicy() /// Initializes a new instance of . /// Retry count for user request. /// Retry window in minutes for user request. - /// Keeps track of any properties unknown to the library. - internal UserRequestRetryPolicy(int? retryCount, int? retryWindowInMinutes, IDictionary serializedAdditionalRawData) + /// Action to take on failure. + /// Keeps track of any properties unknown to the library. + internal UserRequestRetryPolicy(int? retryCount, int? retryWindowInMinutes, ResourceOperationType? onFailureAction, IDictionary additionalBinaryDataProperties) { RetryCount = retryCount; RetryWindowInMinutes = retryWindowInMinutes; - _serializedAdditionalRawData = serializedAdditionalRawData; + OnFailureAction = onFailureAction; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Retry count for user request. public int? RetryCount { get; set; } + /// Retry window in minutes for user request. public int? RetryWindowInMinutes { get; set; } + + /// Action to take on failure. + public ResourceOperationType? OnFailureAction { get; set; } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs index f152a7e4cccf..64522875f614 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.ComputeSchedule; namespace Azure.ResourceManager.ComputeSchedule.Models { - public partial class UserRequestSchedule : IUtf8JsonSerializable, IJsonModel + /// The schedule details for the user request. + public partial class UserRequestSchedule : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal UserRequestSchedule() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ 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(UserRequestSchedule)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Deadline)) { writer.WritePropertyName("deadline"u8); @@ -56,15 +61,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("deadlineType"u8); writer.WriteStringValue(DeadlineType.ToString()); - 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); } @@ -73,87 +78,93 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UserRequestSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + UserRequestSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual UserRequestSchedule 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(UserRequestSchedule)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeUserRequestSchedule(document.RootElement, options); } - internal static UserRequestSchedule DeserializeUserRequestSchedule(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static UserRequestSchedule DeserializeUserRequestSchedule(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DateTimeOffset? deadline = default; - DateTimeOffset? deadLine = default; + DateTimeOffset? userRequestDeadline = default; string timezone = default; - string timeZone = default; + string userRequestTimezone = default; ScheduledActionDeadlineType deadlineType = 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("deadline"u8)) + if (prop.NameEquals("deadline"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - deadline = property.Value.GetDateTimeOffset("O"); + deadline = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("deadLine"u8)) + if (prop.NameEquals("deadLine"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - deadLine = property.Value.GetDateTimeOffset("O"); + userRequestDeadline = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("timezone"u8)) + if (prop.NameEquals("timezone"u8)) { - timezone = property.Value.GetString(); + timezone = prop.Value.GetString(); continue; } - if (property.NameEquals("timeZone"u8)) + if (prop.NameEquals("timeZone"u8)) { - timeZone = property.Value.GetString(); + userRequestTimezone = prop.Value.GetString(); continue; } - if (property.NameEquals("deadlineType"u8)) + if (prop.NameEquals("deadlineType"u8)) { - deadlineType = new ScheduledActionDeadlineType(property.Value.GetString()); + deadlineType = new ScheduledActionDeadlineType(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 UserRequestSchedule( deadline, - deadLine, + userRequestDeadline, timezone, - timeZone, + userRequestTimezone, deadlineType, - 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": @@ -163,15 +174,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - UserRequestSchedule 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. + UserRequestSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual UserRequestSchedule 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 DeserializeUserRequestSchedule(document.RootElement, options); } default: @@ -179,6 +195,7 @@ UserRequestSchedule IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.cs index 434b4d6cff86..cdde124acf87 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/UserRequestSchedule.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.ComputeSchedule.Models /// The schedule details for the user request. public partial class UserRequestSchedule { - /// - /// 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 deadlinetype of the operation, this can either be InitiateAt or CompleteBy. @@ -58,30 +29,29 @@ public UserRequestSchedule(ScheduledActionDeadlineType deadlineType) /// The timezone for the operation. /// The timezone for the operation. /// The deadlinetype of the operation, this can either be InitiateAt or CompleteBy. - /// Keeps track of any properties unknown to the library. - internal UserRequestSchedule(DateTimeOffset? deadline, DateTimeOffset? userRequestDeadline, string timezone, string userRequestTimezone, ScheduledActionDeadlineType deadlineType, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal UserRequestSchedule(DateTimeOffset? deadline, DateTimeOffset? userRequestDeadline, string timezone, string userRequestTimezone, ScheduledActionDeadlineType deadlineType, IDictionary additionalBinaryDataProperties) { Deadline = deadline; UserRequestDeadline = userRequestDeadline; Timezone = timezone; UserRequestTimezone = userRequestTimezone; DeadlineType = deadlineType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal UserRequestSchedule() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The deadline for the operation. public DateTimeOffset? Deadline { get; set; } + /// The deadline for the operation. public DateTimeOffset? UserRequestDeadline { get; set; } + /// The timezone for the operation. public string Timezone { get; set; } + /// The timezone for the operation. public string UserRequestTimezone { get; set; } + /// The deadlinetype of the operation, this can either be InitiateAt or CompleteBy. public ScheduledActionDeadlineType DeadlineType { get; } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ProviderConstants.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ProviderConstants.cs index 5467c626f981..b79c7834088f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ProviderConstants.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ProviderConstants.cs @@ -9,8 +9,9 @@ namespace Azure.ResourceManager.ComputeSchedule { - 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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrenceExtensionRestOperations.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrenceExtensionRestOperations.cs index 3de3ed2c6f14..6f27b8e594fc 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrenceExtensionRestOperations.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrenceExtensionRestOperations.cs @@ -6,184 +6,67 @@ #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.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule { - internal partial class OccurrenceExtensionRestOperations + internal partial class OccurrenceExtension { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of OccurrenceExtensionRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public OccurrenceExtensionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of OccurrenceExtension for mocking. + protected OccurrenceExtension() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetAssociatedOccurrencesRequestUri(string resourceUri) + /// Initializes a new instance of OccurrenceExtension. + /// 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 OccurrenceExtension(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/associatedOccurrences", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateGetAssociatedOccurrencesRequest(string resourceUri) + /// 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 CreateGetAssociatedOccurrencesRequest(string resourceUri, 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("/", false); uri.AppendPath(resourceUri, false); uri.AppendPath("/providers/Microsoft.ComputeSchedule/associatedOccurrences", 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; } - /// List OccurrenceExtensionResource resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> GetAssociatedOccurrencesAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedOccurrencesRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OccurrenceExtensionResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OccurrenceExtensionResourceListResult.DeserializeOccurrenceExtensionResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List OccurrenceExtensionResource resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response GetAssociatedOccurrences(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedOccurrencesRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OccurrenceExtensionResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OccurrenceExtensionResourceListResult.DeserializeOccurrenceExtensionResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAssociatedOccurrencesNextPageRequestUri(string nextLink, string resourceUri) + internal HttpMessage CreateNextGetAssociatedOccurrencesRequest(Uri nextPage, string resourceUri, RequestContext context) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateGetAssociatedOccurrencesNextPageRequest(string nextLink, string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + 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; } - - /// List OccurrenceExtensionResource resources by parent. - /// The URL to the next page of results. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// or is null. - public async Task> GetAssociatedOccurrencesNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedOccurrencesNextPageRequest(nextLink, resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OccurrenceExtensionResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OccurrenceExtensionResourceListResult.DeserializeOccurrenceExtensionResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List OccurrenceExtensionResource resources by parent. - /// The URL to the next page of results. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// or is null. - public Response GetAssociatedOccurrencesNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedOccurrencesNextPageRequest(nextLink, resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OccurrenceExtensionResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OccurrenceExtensionResourceListResult.DeserializeOccurrenceExtensionResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrencesRestOperations.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrencesRestOperations.cs index 8262b070e33f..2b50de585f47 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrencesRestOperations.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/OccurrencesRestOperations.cs @@ -6,61 +6,47 @@ #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.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule { - internal partial class OccurrencesRestOperations + internal partial class Occurrences { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of OccurrencesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public OccurrencesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of Occurrences for mocking. + protected Occurrences() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) + /// Initializes a new instance of Occurrences. + /// 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 Occurrences(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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/occurrences/", false); - uri.AppendPath(occurrenceId, 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 scheduledActionName, string occurrenceId) + /// 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 CreateGetRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, 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.ComputeSchedule/scheduledActions/", false); @@ -68,198 +54,52 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath("/occurrences/", false); uri.AppendPath(occurrenceId, true); 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; } - /// Get a Occurrence. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// 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 scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionOccurrenceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ScheduledActionOccurrenceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a Occurrence. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// 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 scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) + internal HttpMessage CreateGetByScheduledActionRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionOccurrenceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ScheduledActionOccurrenceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByScheduledActionRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/occurrences", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByScheduledActionRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - 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.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); uri.AppendPath("/occurrences", 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; } - /// List Occurrence resources by ScheduledAction. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByScheduledActionAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateListByScheduledActionRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OccurrenceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OccurrenceListResult.DeserializeOccurrenceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Occurrence resources by ScheduledAction. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByScheduledAction(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateListByScheduledActionRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OccurrenceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OccurrenceListResult.DeserializeOccurrenceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAttachedResourcesRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) + internal HttpMessage CreateNextGetByScheduledActionRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/occurrences/", false); - uri.AppendPath(occurrenceId, true); - uri.AppendPath("/resources", 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 CreateGetAttachedResourcesRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) + internal HttpMessage CreateGetAttachedResourcesRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, 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.ComputeSchedule/scheduledActions/", false); @@ -268,100 +108,32 @@ internal HttpMessage CreateGetAttachedResourcesRequest(string subscriptionId, st uri.AppendPath(occurrenceId, true); uri.AppendPath("/resources", 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; } - /// List resources attached to Scheduled Actions for the given occurrence. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAttachedResourcesAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - - using var message = CreateGetAttachedResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OccurrenceResourceListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OccurrenceResourceListResponse.DeserializeOccurrenceResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List resources attached to Scheduled Actions for the given occurrence. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetAttachedResources(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - - using var message = CreateGetAttachedResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OccurrenceResourceListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OccurrenceResourceListResponse.DeserializeOccurrenceResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceCancelContent content) + internal HttpMessage CreateNextGetAttachedResourcesRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, RequestContext context) { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/occurrences/", false); - uri.AppendPath(occurrenceId, true); - uri.AppendPath("/cancel", 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 CreateCancelRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceCancelContent content) + internal HttpMessage CreateCancelRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/scheduledActions/", false); @@ -370,108 +142,22 @@ internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceG uri.AppendPath(occurrenceId, true); uri.AppendPath("/cancel", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// The content of the action request. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CancelAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceCancelContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// The content of the action request. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceCancelContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDelayRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceDelayContent content) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/occurrences/", false); - uri.AppendPath(occurrenceId, true); - uri.AppendPath("/delay", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDelayRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceDelayContent content) + internal HttpMessage CreateDelayRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/scheduledActions/", false); @@ -480,244 +166,14 @@ internal HttpMessage CreateDelayRequest(string subscriptionId, string resourceGr uri.AppendPath(occurrenceId, true); uri.AppendPath("/delay", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// A long-running resource action. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// The content of the action request. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DelayAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceDelayContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateDelayRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// A long-running resource action. - /// 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 ScheduledAction. - /// The name of the Occurrence. - /// The content of the action request. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delay(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, OccurrenceDelayContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateDelayRequest(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByScheduledActionNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByScheduledActionNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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; - } - - /// List Occurrence resources by ScheduledAction. - /// 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 name of the ScheduledAction. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByScheduledActionNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateListByScheduledActionNextPageRequest(nextLink, subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OccurrenceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OccurrenceListResult.DeserializeOccurrenceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Occurrence resources by ScheduledAction. - /// 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 name of the ScheduledAction. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByScheduledActionNextPage(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateListByScheduledActionNextPageRequest(nextLink, subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OccurrenceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OccurrenceListResult.DeserializeOccurrenceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAttachedResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateGetAttachedResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) - { - 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.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - - /// List resources attached to Scheduled Actions for the given occurrence. - /// 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 name of the ScheduledAction. - /// The name of the Occurrence. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAttachedResourcesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - - using var message = CreateGetAttachedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OccurrenceResourceListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OccurrenceResourceListResponse.DeserializeOccurrenceResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List resources attached to Scheduled Actions for the given occurrence. - /// 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 name of the ScheduledAction. - /// The name of the Occurrence. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetAttachedResourcesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - - using var message = CreateGetAttachedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OccurrenceResourceListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OccurrenceResourceListResponse.DeserializeOccurrenceResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionExtensionRestOperations.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionExtensionRestOperations.cs index dd134a1d24c4..d2d72a4f73e2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionExtensionRestOperations.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionExtensionRestOperations.cs @@ -6,184 +6,67 @@ #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.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule { - internal partial class ScheduledActionExtensionRestOperations + internal partial class ScheduledActionExtension { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of ScheduledActionExtensionRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public ScheduledActionExtensionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of ScheduledActionExtension for mocking. + protected ScheduledActionExtension() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetAssociatedScheduledActionsRequestUri(string resourceUri) + /// Initializes a new instance of ScheduledActionExtension. + /// 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 ScheduledActionExtension(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceUri, false); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/associatedScheduledActions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateGetAssociatedScheduledActionsRequest(string resourceUri) + /// 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 CreateGetAssociatedScheduledActionsRequest(string resourceUri, 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("/", false); uri.AppendPath(resourceUri, false); uri.AppendPath("/providers/Microsoft.ComputeSchedule/associatedScheduledActions", 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; } - /// List ScheduledActionResources resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> GetAssociatedScheduledActionsAsync(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedScheduledActionsRequest(resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourcesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourcesListResult.DeserializeScheduledActionResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ScheduledActionResources resources by parent. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response GetAssociatedScheduledActions(string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedScheduledActionsRequest(resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourcesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourcesListResult.DeserializeScheduledActionResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAssociatedScheduledActionsNextPageRequestUri(string nextLink, string resourceUri) + internal HttpMessage CreateNextGetAssociatedScheduledActionsRequest(Uri nextPage, string resourceUri, RequestContext context) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateGetAssociatedScheduledActionsNextPageRequest(string nextLink, string resourceUri) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + 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; } - - /// List ScheduledActionResources resources by parent. - /// The URL to the next page of results. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// or is null. - public async Task> GetAssociatedScheduledActionsNextPageAsync(string nextLink, string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedScheduledActionsNextPageRequest(nextLink, resourceUri); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourcesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourcesListResult.DeserializeScheduledActionResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ScheduledActionResources resources by parent. - /// The URL to the next page of results. - /// The fully qualified Azure Resource manager identifier of the resource. - /// The cancellation token to use. - /// or is null. - public Response GetAssociatedScheduledActionsNextPage(string nextLink, string resourceUri, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceUri, nameof(resourceUri)); - - using var message = CreateGetAssociatedScheduledActionsNextPageRequest(nextLink, resourceUri); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourcesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourcesListResult.DeserializeScheduledActionResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs index 912bc624b0b6..e9360933d5a2 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs @@ -6,2583 +6,574 @@ #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.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule { - internal partial class ScheduledActionsRestOperations + internal partial class ScheduledActions { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of ScheduledActionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public ScheduledActionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of ScheduledActions for mocking. + protected ScheduledActions() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-04-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateSubmitVirtualMachineDeallocateRequestUri(string subscriptionId, AzureLocation locationparameter, SubmitDeallocateContent content) + /// Initializes a new instance of ScheduledActions. + /// 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 ScheduledActions(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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesSubmitDeallocate", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateSubmitVirtualMachineDeallocateRequest(string subscriptionId, AzureLocation locationparameter, SubmitDeallocateContent content) + /// 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 CreateSubmitVirtualMachineDeallocateRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); + uri.AppendPath(locationparameter.ToString(), true); uri.AppendPath("/virtualMachinesSubmitDeallocate", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> SubmitVirtualMachineDeallocateAsync(string subscriptionId, AzureLocation locationparameter, SubmitDeallocateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSubmitVirtualMachineDeallocateRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeallocateResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeallocateResourceOperationResult.DeserializeDeallocateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual machines at datetime in future. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response SubmitVirtualMachineDeallocate(string subscriptionId, AzureLocation locationparameter, SubmitDeallocateContent content, CancellationToken cancellationToken = default) + internal HttpMessage CreateSubmitVirtualMachineHibernateRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSubmitVirtualMachineDeallocateRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeallocateResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeallocateResourceOperationResult.DeserializeDeallocateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSubmitVirtualMachineHibernateRequestUri(string subscriptionId, AzureLocation locationparameter, SubmitHibernateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesSubmitHibernate", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSubmitVirtualMachineHibernateRequest(string subscriptionId, AzureLocation locationparameter, SubmitHibernateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); + uri.AppendPath(locationparameter.ToString(), true); uri.AppendPath("/virtualMachinesSubmitHibernate", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> SubmitVirtualMachineHibernateAsync(string subscriptionId, AzureLocation locationparameter, SubmitHibernateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSubmitVirtualMachineHibernateRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HibernateResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HibernateResourceOperationResult.DeserializeHibernateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines at datetime in future. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response SubmitVirtualMachineHibernate(string subscriptionId, AzureLocation locationparameter, SubmitHibernateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSubmitVirtualMachineHibernateRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HibernateResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HibernateResourceOperationResult.DeserializeHibernateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSubmitVirtualMachineStartRequestUri(string subscriptionId, AzureLocation locationparameter, SubmitStartContent content) + internal HttpMessage CreateSubmitVirtualMachineStartRequest(Guid subscriptionId, AzureLocation locationparameter, 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(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); + uri.AppendPath(locationparameter.ToString(), true); uri.AppendPath("/virtualMachinesSubmitStart", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateSubmitVirtualMachineStartRequest(string subscriptionId, AzureLocation locationparameter, SubmitStartContent content) + internal HttpMessage CreateExecuteVirtualMachineDeallocateRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesSubmitStart", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesExecuteDeallocate", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> SubmitVirtualMachineStartAsync(string subscriptionId, AzureLocation locationparameter, SubmitStartContent content, CancellationToken cancellationToken = default) + internal HttpMessage CreateExecuteVirtualMachineHibernateRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSubmitVirtualMachineStartRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StartResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = StartResourceOperationResult.DeserializeStartResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime in future. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response SubmitVirtualMachineStart(string subscriptionId, AzureLocation locationparameter, SubmitStartContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSubmitVirtualMachineStartRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StartResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = StartResourceOperationResult.DeserializeStartResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateExecuteVirtualMachineDeallocateRequestUri(string subscriptionId, AzureLocation locationparameter, ExecuteDeallocateContent content) - { - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteDeallocate", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesExecuteHibernate", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateExecuteVirtualMachineDeallocateRequest(string subscriptionId, AzureLocation locationparameter, ExecuteDeallocateContent content) + internal HttpMessage CreateExecuteVirtualMachineStartRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteDeallocate", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesExecuteStart", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ExecuteVirtualMachineDeallocateAsync(string subscriptionId, AzureLocation locationparameter, ExecuteDeallocateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineDeallocateRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeallocateResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeallocateResourceOperationResult.DeserializeDeallocateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ExecuteVirtualMachineDeallocate(string subscriptionId, AzureLocation locationparameter, ExecuteDeallocateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineDeallocateRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeallocateResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeallocateResourceOperationResult.DeserializeDeallocateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateExecuteVirtualMachineHibernateRequestUri(string subscriptionId, AzureLocation locationparameter, ExecuteHibernateContent content) + internal HttpMessage CreateExecuteVirtualMachineCreateOperationRequest(Guid subscriptionId, AzureLocation locationparameter, 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(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteHibernate", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesExecuteCreate", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateExecuteVirtualMachineHibernateRequest(string subscriptionId, AzureLocation locationparameter, ExecuteHibernateContent content) + internal HttpMessage CreateExecuteVirtualMachineDeleteOperationRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteHibernate", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesExecuteDelete", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ExecuteVirtualMachineHibernateAsync(string subscriptionId, AzureLocation locationparameter, ExecuteHibernateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineHibernateRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HibernateResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HibernateResourceOperationResult.DeserializeHibernateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ExecuteVirtualMachineHibernate(string subscriptionId, AzureLocation locationparameter, ExecuteHibernateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineHibernateRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HibernateResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HibernateResourceOperationResult.DeserializeHibernateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateExecuteVirtualMachineStartRequestUri(string subscriptionId, AzureLocation locationparameter, ExecuteStartContent content) + internal HttpMessage CreateGetVirtualMachineOperationStatusRequest(Guid subscriptionId, AzureLocation locationparameter, 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(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteStart", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesGetOperationStatus", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateExecuteVirtualMachineStartRequest(string subscriptionId, AzureLocation locationparameter, ExecuteStartContent content) + internal HttpMessage CreateCancelVirtualMachineOperationsRequest(Guid subscriptionId, AzureLocation locationparameter, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteStart", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesCancelOperations", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ExecuteVirtualMachineStartAsync(string subscriptionId, AzureLocation locationparameter, ExecuteStartContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineStartRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StartResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = StartResourceOperationResult.DeserializeStartResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ExecuteVirtualMachineStart(string subscriptionId, AzureLocation locationparameter, ExecuteStartContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineStartRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StartResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = StartResourceOperationResult.DeserializeStartResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateExecuteVirtualMachineCreateOperationRequestUri(string subscriptionId, AzureLocation locationparameter, ExecuteCreateContent content) + internal HttpMessage CreateGetVirtualMachineOperationErrorsRequest(Guid subscriptionId, AzureLocation locationparameter, 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(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteCreate", false); + uri.AppendPath(locationparameter.ToString(), true); + uri.AppendPath("/virtualMachinesGetOperationErrors", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateExecuteVirtualMachineCreateOperationRequest(string subscriptionId, AzureLocation locationparameter, ExecuteCreateContent content) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteCreate", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); + uri.AppendPath(scheduledActionName, 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ExecuteVirtualMachineCreateOperationAsync(string subscriptionId, AzureLocation locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineCreateOperationRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CreateResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CreateResourceOperationResult.DeserializeCreateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ExecuteVirtualMachineCreateOperation(string subscriptionId, AzureLocation locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineCreateOperationRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CreateResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CreateResourceOperationResult.DeserializeCreateResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateExecuteVirtualMachineDeleteOperationRequestUri(string subscriptionId, AzureLocation locationparameter, ExecuteDeleteContent content) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, 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("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteDelete", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); + uri.AppendPath(scheduledActionName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateExecuteVirtualMachineDeleteOperationRequest(string subscriptionId, AzureLocation locationparameter, ExecuteDeleteContent content) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesExecuteDelete", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); + uri.AppendPath(scheduledActionName, 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); + request.Method = RequestMethod.Patch; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ExecuteVirtualMachineDeleteOperationAsync(string subscriptionId, AzureLocation locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineDeleteOperationRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeleteResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeleteResourceOperationResult.DeserializeDeleteResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ExecuteVirtualMachineDeleteOperation(string subscriptionId, AzureLocation locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateExecuteVirtualMachineDeleteOperationRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeleteResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeleteResourceOperationResult.DeserializeDeleteResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetVirtualMachineOperationStatusRequestUri(string subscriptionId, AzureLocation locationparameter, GetOperationStatusContent content) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesGetOperationStatus", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); + uri.AppendPath(scheduledActionName, 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 CreateGetVirtualMachineOperationStatusRequest(string subscriptionId, AzureLocation locationparameter, GetOperationStatusContent content) + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesGetOperationStatus", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetVirtualMachineOperationStatusAsync(string subscriptionId, AzureLocation locationparameter, GetOperationStatusContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateGetVirtualMachineOperationStatusRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GetOperationStatusResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = GetOperationStatusResult.DeserializeGetOperationStatusResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response GetVirtualMachineOperationStatus(string subscriptionId, AzureLocation locationparameter, GetOperationStatusContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateGetVirtualMachineOperationStatusRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GetOperationStatusResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = GetOperationStatusResult.DeserializeGetOperationStatusResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCancelVirtualMachineOperationsRequestUri(string subscriptionId, AzureLocation locationparameter, CancelOperationsContent content) + 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.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesCancelOperations", 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 CreateCancelVirtualMachineOperationsRequest(string subscriptionId, AzureLocation locationparameter, CancelOperationsContent content) + internal HttpMessage CreateGetBySubscriptionRequest(Guid subscriptionId, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesCancelOperations", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CancelVirtualMachineOperationsAsync(string subscriptionId, AzureLocation locationparameter, CancelOperationsContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCancelVirtualMachineOperationsRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CancelOperationsResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CancelOperationsResult.DeserializeCancelOperationsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response CancelVirtualMachineOperations(string subscriptionId, AzureLocation locationparameter, CancelOperationsContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCancelVirtualMachineOperationsRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CancelOperationsResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CancelOperationsResult.DeserializeCancelOperationsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetVirtualMachineOperationErrorsRequestUri(string subscriptionId, AzureLocation locationparameter, GetOperationErrorsContent content) + internal HttpMessage CreateNextGetBySubscriptionRequest(Uri nextPage, Guid subscriptionId, RequestContext context) { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesGetOperationErrors", 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 CreateGetVirtualMachineOperationErrorsRequest(string subscriptionId, AzureLocation locationparameter, GetOperationErrorsContent content) + internal HttpMessage CreateGetAttachedResourcesRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); - uri.AppendPath(locationparameter, true); - uri.AppendPath("/virtualMachinesGetOperationErrors", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); + uri.AppendPath(scheduledActionName, true); + uri.AppendPath("/resources", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetVirtualMachineOperationErrorsAsync(string subscriptionId, AzureLocation locationparameter, GetOperationErrorsContent content, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetAttachedResourcesRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateGetVirtualMachineOperationErrorsRequest(subscriptionId, locationparameter, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GetOperationErrorsResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = GetOperationErrorsResult.DeserializeGetOperationErrorsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient errors encountered, additional logs) if they exist. - /// The ID of the target subscription. The value must be an UUID. - /// The location name. - /// The request body. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response GetVirtualMachineOperationErrors(string subscriptionId, AzureLocation locationparameter, GetOperationErrorsContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateGetVirtualMachineOperationErrorsRequest(subscriptionId, locationparameter, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GetOperationErrorsResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = GetOperationErrorsResult.DeserializeGetOperationErrorsResult(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 CreateGetRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) + internal HttpMessage CreateAttachResourcesRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); + uri.AppendPath("/attachResources", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) + internal HttpMessage CreateDetachResourcesRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, 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.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); + uri.AppendPath("/detachResources", 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; } - /// Get a ScheduledAction. - /// 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 ScheduledAction. - /// 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 scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionData.DeserializeScheduledActionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ScheduledActionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a ScheduledAction. - /// 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 ScheduledAction. - /// 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 scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionData.DeserializeScheduledActionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ScheduledActionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionData data) + internal HttpMessage CreatePatchResourcesRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); + uri.AppendPath("/patchResources", 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("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionData data) + internal HttpMessage CreateDisableRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, 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.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); + uri.AppendPath("/disable", false); 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.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a ScheduledAction. - /// 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 ScheduledAction. - /// Resource create parameters. - /// 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 scheduledActionName, ScheduledActionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, scheduledActionName, 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); - } - } - - /// Create a ScheduledAction. - /// 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 ScheduledAction. - /// Resource create parameters. - /// 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 scheduledActionName, ScheduledActionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, scheduledActionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionPatch patch) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionPatch 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("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - 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(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update a ScheduledAction. - /// 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 ScheduledAction. - /// The resource properties to be updated. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, scheduledActionName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionData.DeserializeScheduledActionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update a ScheduledAction. - /// 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 ScheduledAction. - /// The resource properties to be updated. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, scheduledActionName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionData.DeserializeScheduledActionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Delete a ScheduledAction. - /// 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 ScheduledAction. - /// 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 scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a ScheduledAction. - /// 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 ScheduledAction. - /// 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 scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - 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.ComputeSchedule/scheduledActions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - 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.ComputeSchedule/scheduledActions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List ScheduledAction resources by 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: - { - ScheduledActionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ScheduledAction resources by 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: - { - ScheduledActionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List ScheduledAction resources by subscription ID. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ScheduledAction resources by subscription ID. - /// 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: - { - ScheduledActionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAttachedResourcesRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetAttachedResourcesRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List resources attached to Scheduled Actions. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAttachedResourcesAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateGetAttachedResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ResourceListResponse.DeserializeResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List resources attached to Scheduled Actions. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetAttachedResources(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateGetAttachedResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ResourceListResponse.DeserializeResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateAttachResourcesRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceAttachContent content) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/attachResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateAttachResourcesRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceAttachContent 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("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/attachResources", 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; } - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> AttachResourcesAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceAttachContent content, CancellationToken cancellationToken = default) + internal HttpMessage CreateEnableRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateAttachResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response AttachResources(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceAttachContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateAttachResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDetachResourcesRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceDetachContent content) - { - 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.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/detachResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDetachResourcesRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceDetachContent 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("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/detachResources", 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; - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> DetachResourcesAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceDetachContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateDetachResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response DetachResources(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourceDetachContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateDetachResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreatePatchResourcesRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourcePatchContent content) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/patchResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePatchResourcesRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourcePatchContent 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("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/patchResources", false); + uri.AppendPath("/enable", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> PatchResourcesAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourcePatchContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreatePatchResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response PatchResources(string subscriptionId, string resourceGroupName, string scheduledActionName, ScheduledActionResourcePatchContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreatePatchResourcesRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDisableRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/disable", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDisableRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/disable", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); return message; } - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DisableAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateDisableRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Disable(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateDisableRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateEnableRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) + internal HttpMessage CreateCancelNextOccurrenceRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/enable", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateEnableRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/enable", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task EnableAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateEnableRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Enable(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateEnableRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCancelNextOccurrenceRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName, OccurrenceCancelContent content) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/cancelNextOccurrence", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCancelNextOccurrenceRequest(string subscriptionId, string resourceGroupName, string scheduledActionName, OccurrenceCancelContent 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); uri.AppendPath("/cancelNextOccurrence", false); 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _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; } - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CancelNextOccurrenceAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, OccurrenceCancelContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCancelNextOccurrenceRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The content of the action request. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CancelNextOccurrence(string subscriptionId, string resourceGroupName, string scheduledActionName, OccurrenceCancelContent content, CancellationToken cancellationToken = default) + internal HttpMessage CreateTriggerManualOccurrenceRequest(Guid subscriptionId, string resourceGroupName, string scheduledActionName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCancelNextOccurrenceRequest(subscriptionId, resourceGroupName, scheduledActionName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionResourceOperationResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionResourceOperationResult.DeserializeScheduledActionResourceOperationResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateTriggerManualOccurrenceRequestUri(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); uri.AppendPath(scheduledActionName, true); uri.AppendPath("/triggerManualOccurrence", false); uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateTriggerManualOccurrenceRequest(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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.ComputeSchedule/scheduledActions/", false); - uri.AppendPath(scheduledActionName, true); - uri.AppendPath("/triggerManualOccurrence", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> TriggerManualOccurrenceAsync(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateTriggerManualOccurrenceRequest(subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionOccurrenceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// A synchronous resource action. - /// 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 ScheduledAction. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response TriggerManualOccurrence(string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateTriggerManualOccurrenceRequest(subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScheduledActionOccurrenceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(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); - return message; - } - - /// List ScheduledAction resources by 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: - { - ScheduledActionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ScheduledAction resources by 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: - { - ScheduledActionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(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); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List ScheduledAction resources by subscription ID. - /// 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: - { - ScheduledActionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List ScheduledAction resources by subscription ID. - /// 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: - { - ScheduledActionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ScheduledActionListResult.DeserializeScheduledActionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetAttachedResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateGetAttachedResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName) - { - 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("Accept", "application/json"); return message; } - - /// List resources attached to Scheduled Actions. - /// 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 name of the ScheduledAction. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAttachedResourcesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateGetAttachedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, scheduledActionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ResourceListResponse.DeserializeResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List resources attached to Scheduled Actions. - /// 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 name of the ScheduledAction. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetAttachedResourcesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string scheduledActionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - - using var message = CreateGetAttachedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, scheduledActionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ResourceListResponse.DeserializeResourceListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionCollection.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionCollection.cs index 9d27c1949f2f..79faaeff7c2d 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionCollection.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionCollection.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.ComputeSchedule @@ -25,51 +26,49 @@ namespace Azure.ResourceManager.ComputeSchedule /// public partial class ScheduledActionCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _scheduledActionClientDiagnostics; - private readonly ScheduledActionsRestOperations _scheduledActionRestClient; + private readonly ClientDiagnostics _scheduledActionsClientDiagnostics; + private readonly ScheduledActions _scheduledActionsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of ScheduledActionCollection for mocking. protected ScheduledActionCollection() { } - /// 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 ScheduledActionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _scheduledActionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ScheduledActionResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(ScheduledActionResource.ResourceType, out string scheduledActionApiVersion); - _scheduledActionRestClient = new ScheduledActionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scheduledActionApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _scheduledActionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ScheduledActionResource.ResourceType.Namespace, Diagnostics); + _scheduledActionsRestClient = new ScheduledActions(_scheduledActionsClientDiagnostics, Pipeline, Endpoint, scheduledActionApiVersion ?? "2026-01-01-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); + } } /// /// Create a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_CreateOrUpdate + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_CreateOrUpdate. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// @@ -77,21 +76,34 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The name of the ScheduledAction. /// Resource create parameters. /// 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 scheduledActionName, ScheduledActionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.CreateOrUpdate"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _scheduledActionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, data, cancellationToken).ConfigureAwait(false); - var operation = new ComputeScheduleArmOperation(new ScheduledActionOperationSource(Client), _scheduledActionClientDiagnostics, Pipeline, _scheduledActionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, ScheduledActionData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + ComputeScheduleArmOperation operation = new ComputeScheduleArmOperation( + new ScheduledActionOperationSource(Client), + _scheduledActionsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -105,20 +117,16 @@ public virtual async Task> CreateOrUpdateA /// Create a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_CreateOrUpdate + /// Operation Id. + /// ScheduledActions_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// @@ -126,21 +134,34 @@ public virtual async Task> CreateOrUpdateA /// The name of the ScheduledAction. /// Resource create parameters. /// 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 scheduledActionName, ScheduledActionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.CreateOrUpdate"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.CreateOrUpdate"); scope.Start(); try { - var response = _scheduledActionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, data, cancellationToken); - var operation = new ComputeScheduleArmOperation(new ScheduledActionOperationSource(Client), _scheduledActionClientDiagnostics, Pipeline, _scheduledActionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, ScheduledActionData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + ComputeScheduleArmOperation operation = new ComputeScheduleArmOperation( + new ScheduledActionOperationSource(Client), + _scheduledActionsClientDiagnostics, + 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 wa /// Get a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Get + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the ScheduledAction. /// 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 scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.Get"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.Get"); scope.Start(); try { - var response = await _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -199,38 +224,42 @@ public virtual async Task> GetAsync(string sch /// Get a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the ScheduledAction. /// 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 scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.Get"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.Get"); scope.Start(); try { - var response = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -244,50 +273,44 @@ public virtual Response Get(string scheduledActionName, /// List ScheduledAction resources by resource group /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions. /// /// - /// Operation Id - /// ScheduledAction_ListByResourceGroup + /// Operation Id. + /// ScheduledActions_ListByResourceGroup. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-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) => _scheduledActionRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScheduledActionResource(Client, ScheduledActionData.DeserializeScheduledActionData(e)), _scheduledActionClientDiagnostics, Pipeline, "ScheduledActionCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new ScheduledActionsGetByResourceGroupAsyncCollectionResultOfT(_scheduledActionsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new ScheduledActionResource(Client, data)); } /// /// List ScheduledAction resources by resource group /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions - /// - /// - /// Operation Id - /// ScheduledAction_ListByResourceGroup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_ListByResourceGroup. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// @@ -295,45 +318,61 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scheduledActionRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScheduledActionResource(Client, ScheduledActionData.DeserializeScheduledActionData(e)), _scheduledActionClientDiagnostics, Pipeline, "ScheduledActionCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new ScheduledActionsGetByResourceGroupCollectionResultOfT(_scheduledActionsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new ScheduledActionResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the ScheduledAction. /// 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 scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.Exists"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.Exists"); scope.Start(); try { - var response = await _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionData)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 scheduledActionName /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Get + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the ScheduledAction. /// 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 scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.Exists"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.Exists"); scope.Start(); try { - var response = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionData)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 scheduledActionName, CancellationTok /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the ScheduledAction. /// 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 scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.GetIfExists"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.GetIfExists"); scope.Start(); try { - var response = await _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -435,38 +504,54 @@ public virtual async Task> GetIfExists /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Get + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the ScheduledAction. /// 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 scheduledActionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(scheduledActionName, nameof(scheduledActionName)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionCollection.GetIfExists"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionCollection.GetIfExists"); scope.Start(); try { - var response = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, scheduledActionName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, scheduledActionName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionResource(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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.Serialization.cs index 7bbfc28ff600..b14de39dd7eb 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.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.ComputeSchedule.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ComputeSchedule { - public partial class ScheduledActionData : IUtf8JsonSerializable, IJsonModel + /// The scheduled action resource. + public partial class ScheduledActionData : TrackedResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ScheduledActionData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// 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(ScheduledActionData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -45,110 +51,131 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ScheduledActionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ScheduledActionData)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(ScheduledActionData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionData(document.RootElement, options); } - internal static ScheduledActionData DeserializeScheduledActionData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionData DeserializeScheduledActionData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ScheduledActionProperties properties = default; - IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + ScheduledActionProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = ScheduledActionProperties.DeserializeScheduledActionProperties(property.Value, options); + 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, AzureResourceManagerComputeScheduleContext.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, AzureResourceManagerComputeScheduleContext.Default); + properties = ScheduledActionProperties.DeserializeScheduledActionProperties(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 ScheduledActionData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, tags ?? new ChangeTrackingDictionary(), location, - properties, - serializedAdditionalRawData); + properties); } - 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": @@ -158,15 +185,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - ScheduledActionData 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. + ScheduledActionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ScheduledActionData)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 DeserializeScheduledActionData(document.RootElement, options); } default: @@ -174,6 +206,26 @@ ScheduledActionData IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(ScheduledActionData scheduledActionData) + { + if (scheduledActionData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(scheduledActionData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static ScheduledActionData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScheduledActionData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.cs index 1b268a5c9820..8aa5dc124a43 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionData.cs @@ -13,68 +13,31 @@ namespace Azure.ResourceManager.ComputeSchedule { - /// - /// A class representing the ScheduledAction data model. - /// The scheduled action resource - /// + /// The scheduled action resource. public partial class ScheduledActionData : 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 ScheduledActionData(AzureLocation location) : base(location) { } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The 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. /// The resource-specific properties for this resource. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ScheduledActionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ScheduledActionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, ScheduledActionProperties properties) : base(id, name, resourceType, systemData, tags, location) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ScheduledActionData() - { } /// The resource-specific properties for this resource. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceCollection.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceCollection.cs index a19c34b33c21..18ec27d0508b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceCollection.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceCollection.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; namespace Azure.ResourceManager.ComputeSchedule { @@ -24,69 +25,75 @@ namespace Azure.ResourceManager.ComputeSchedule /// public partial class ScheduledActionOccurrenceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _scheduledActionOccurrenceOccurrencesClientDiagnostics; - private readonly OccurrencesRestOperations _scheduledActionOccurrenceOccurrencesRestClient; + private readonly ClientDiagnostics _occurrencesClientDiagnostics; + private readonly Occurrences _occurrencesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of ScheduledActionOccurrenceCollection for mocking. protected ScheduledActionOccurrenceCollection() { } - /// 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 ScheduledActionOccurrenceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _scheduledActionOccurrenceOccurrencesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ScheduledActionOccurrenceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ScheduledActionOccurrenceResource.ResourceType, out string scheduledActionOccurrenceOccurrencesApiVersion); - _scheduledActionOccurrenceOccurrencesRestClient = new OccurrencesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scheduledActionOccurrenceOccurrencesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ScheduledActionOccurrenceResource.ResourceType, out string scheduledActionOccurrenceApiVersion); + _occurrencesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ScheduledActionOccurrenceResource.ResourceType.Namespace, Diagnostics); + _occurrencesRestClient = new Occurrences(_occurrencesClientDiagnostics, Pipeline, Endpoint, scheduledActionOccurrenceApiVersion ?? "2026-01-01-preview"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ScheduledActionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ScheduledActionResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ScheduledActionResource.ResourceType), id); + } } /// /// Get a Occurrence /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Operation Id - /// Occurrence_Get + /// Operation Id. + /// Occurrences_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the Occurrence. /// 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 occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Get"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Get"); scope.Start(); try { - var response = await _scheduledActionOccurrenceOccurrencesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, occurrenceId, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, occurrenceId, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -100,38 +107,42 @@ public virtual async Task> GetAsync( /// Get a Occurrence /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} - /// - /// - /// Operation Id - /// Occurrence_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// Occurrences_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the Occurrence. /// 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 occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Get"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Get"); scope.Start(); try { - var response = _scheduledActionOccurrenceOccurrencesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, occurrenceId, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, occurrenceId, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -145,50 +156,44 @@ public virtual Response Get(string occurrence /// List Occurrence resources by ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences - /// - /// - /// Operation Id - /// Occurrence_ListByScheduledAction + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// Occurrences_ListByScheduledAction. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-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) => _scheduledActionOccurrenceOccurrencesRestClient.CreateListByScheduledActionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionOccurrenceOccurrencesRestClient.CreateListByScheduledActionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScheduledActionOccurrenceResource(Client, ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(e)), _scheduledActionOccurrenceOccurrencesClientDiagnostics, Pipeline, "ScheduledActionOccurrenceCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new OccurrencesGetByScheduledActionAsyncCollectionResultOfT(_occurrencesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new ScheduledActionOccurrenceResource(Client, data)); } /// /// List Occurrence resources by ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences - /// - /// - /// Operation Id - /// Occurrence_ListByScheduledAction + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// Occurrences_ListByScheduledAction. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// @@ -196,45 +201,61 @@ public virtual AsyncPageable GetAllAsync(Canc /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scheduledActionOccurrenceOccurrencesRestClient.CreateListByScheduledActionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionOccurrenceOccurrencesRestClient.CreateListByScheduledActionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScheduledActionOccurrenceResource(Client, ScheduledActionOccurrenceData.DeserializeScheduledActionOccurrenceData(e)), _scheduledActionOccurrenceOccurrencesClientDiagnostics, Pipeline, "ScheduledActionOccurrenceCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new OccurrencesGetByScheduledActionCollectionResultOfT(_occurrencesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new ScheduledActionOccurrenceResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Operation Id - /// Occurrence_Get + /// Operation Id. + /// Occurrences_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the Occurrence. /// 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 occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Exists"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Exists"); scope.Start(); try { - var response = await _scheduledActionOccurrenceOccurrencesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, occurrenceId, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, occurrenceId, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionOccurrenceData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,36 +269,50 @@ public virtual async Task> ExistsAsync(string occurrenceId, Cance /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Operation Id - /// Occurrence_Get + /// Operation Id. + /// Occurrences_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the Occurrence. /// 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 occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Exists"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.Exists"); scope.Start(); try { - var response = _scheduledActionOccurrenceOccurrencesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, occurrenceId, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, occurrenceId, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionOccurrenceData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -291,38 +326,54 @@ public virtual Response Exists(string occurrenceId, CancellationToken canc /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Operation Id - /// Occurrence_Get + /// Operation Id. + /// Occurrences_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the Occurrence. /// 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 occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.GetIfExists"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.GetIfExists"); scope.Start(); try { - var response = await _scheduledActionOccurrenceOccurrencesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, occurrenceId, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, occurrenceId, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionOccurrenceData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -336,38 +387,54 @@ public virtual async Task> G /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} - /// - /// - /// Operation Id - /// Occurrence_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Operation Id. + /// Occurrences_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2026-01-01-preview. /// /// /// /// The name of the Occurrence. /// 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 occurrenceId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.GetIfExists"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceCollection.GetIfExists"); scope.Start(); try { - var response = _scheduledActionOccurrenceOccurrencesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, occurrenceId, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, occurrenceId, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((ScheduledActionOccurrenceData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -387,6 +454,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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.Serialization.cs index 1e2569e6454f..a57d743d04bd 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.Serialization.cs @@ -10,16 +10,18 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.ComputeSchedule.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.ComputeSchedule { - public partial class ScheduledActionOccurrenceData : IUtf8JsonSerializable, IJsonModel + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + public partial class ScheduledActionOccurrenceData : ResourceData, 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(); @@ -31,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(ScheduledActionOccurrenceData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -45,87 +46,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ScheduledActionOccurrenceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ScheduledActionOccurrenceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ScheduledActionOccurrenceData)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(ScheduledActionOccurrenceData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeScheduledActionOccurrenceData(document.RootElement, options); } - internal static ScheduledActionOccurrenceData DeserializeScheduledActionOccurrenceData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ScheduledActionOccurrenceData DeserializeScheduledActionOccurrenceData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ScheduledActionOccurrenceProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + ScheduledActionOccurrenceProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = ScheduledActionOccurrenceProperties.DeserializeScheduledActionOccurrenceProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("systemData"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerComputeScheduleContext.Default); 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, AzureResourceManagerComputeScheduleContext.Default); + properties = ScheduledActionOccurrenceProperties.DeserializeScheduledActionOccurrenceProperties(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 ScheduledActionOccurrenceData( id, name, - type, + resourceType, systemData, - properties, - serializedAdditionalRawData); + additionalBinaryDataProperties, + properties); } - 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": @@ -135,15 +150,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ScheduledActionOccurrenceData 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. + ScheduledActionOccurrenceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ScheduledActionOccurrenceData)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 DeserializeScheduledActionOccurrenceData(document.RootElement, options); } default: @@ -151,6 +171,14 @@ ScheduledActionOccurrenceData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static ScheduledActionOccurrenceData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScheduledActionOccurrenceData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.cs index 93db560041d0..66ed78fc9780 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceData.cs @@ -13,43 +13,11 @@ namespace Azure.ResourceManager.ComputeSchedule { - /// - /// A class representing the ScheduledActionOccurrence data model. - /// Concrete proxy resource types can be created by aliasing this type using a specific property type. - /// + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. public partial class ScheduledActionOccurrenceData : ResourceData { - /// - /// 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 ScheduledActionOccurrenceData() @@ -57,16 +25,16 @@ internal ScheduledActionOccurrenceData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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. - /// Keeps track of any properties unknown to the library. - internal ScheduledActionOccurrenceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ScheduledActionOccurrenceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ScheduledActionOccurrenceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, ScheduledActionOccurrenceProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } /// The resource-specific properties for this resource. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.Serialization.cs index 39a7c9daaff6..f829168e5a5f 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.ComputeSchedule { + /// public partial class ScheduledActionOccurrenceResource : IJsonModel { - private static ScheduledActionOccurrenceData s_dataDeserializationInstance; - private static ScheduledActionOccurrenceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new ScheduledActionOccurrenceData(); + + /// 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); - ScheduledActionOccurrenceData 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. + ScheduledActionOccurrenceData 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, AzureResourceManagerComputeScheduleContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. ScheduledActionOccurrenceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerComputeScheduleContext.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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.cs index e16d4da0958e..65c66b91182b 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionOccurrenceResource.cs @@ -6,48 +6,36 @@ #nullable disable using System; -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.ComputeSchedule.Models; namespace Azure.ResourceManager.ComputeSchedule { /// - /// A Class representing a ScheduledActionOccurrence 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 GetScheduledActionOccurrenceResource method. - /// Otherwise you can get one from its parent resource using the GetScheduledActionOccurrence method. + /// A class representing a ScheduledActionOccurrence 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 GetScheduledActionOccurrences method. /// public partial class ScheduledActionOccurrenceResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The scheduledActionName. - /// The occurrenceId. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _scheduledActionOccurrenceOccurrencesClientDiagnostics; - private readonly OccurrencesRestOperations _scheduledActionOccurrenceOccurrencesRestClient; + private readonly ClientDiagnostics _occurrencesClientDiagnostics; + private readonly Occurrences _occurrencesRestClient; private readonly ScheduledActionOccurrenceData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.ComputeSchedule/scheduledActions/occurrences"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of ScheduledActionOccurrenceResource for mocking. protected ScheduledActionOccurrenceResource() { } - /// 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 ScheduledActionOccurrenceResource(ArmClient client, ScheduledActionOccurrenceData data) : this(client, data.Id) @@ -56,71 +44,93 @@ internal ScheduledActionOccurrenceResource(ArmClient client, ScheduledActionOccu _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 ScheduledActionOccurrenceResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _scheduledActionOccurrenceOccurrencesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string scheduledActionOccurrenceOccurrencesApiVersion); - _scheduledActionOccurrenceOccurrencesRestClient = new OccurrencesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scheduledActionOccurrenceOccurrencesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string scheduledActionOccurrenceApiVersion); + _occurrencesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ResourceType.Namespace, Diagnostics); + _occurrencesRestClient = new Occurrences(_occurrencesClientDiagnostics, Pipeline, Endpoint, scheduledActionOccurrenceApiVersion ?? "2026-01-01-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 ScheduledActionOccurrenceData 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 scheduledActionName. + /// The occurrenceId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scheduledActionName, string occurrenceId) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}"; + 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); + } } /// /// Get a Occurrence /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Operation Id - /// Occurrence_Get + /// Operation Id. + /// Occurrences_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Get"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Get"); scope.Start(); try { - var response = await _scheduledActionOccurrenceOccurrencesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -134,33 +144,41 @@ public virtual async Task> GetAsync( /// Get a Occurrence /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}. /// /// - /// Operation Id - /// Occurrence_Get + /// Operation Id. + /// Occurrences_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Get"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Get"); scope.Start(); try { - var response = _scheduledActionOccurrenceOccurrencesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -170,84 +188,24 @@ public virtual Response Get(CancellationToken } } - /// - /// List resources attached to Scheduled Actions for the given occurrence - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/resources - /// - /// - /// Operation Id - /// OccurrenceResource_GetAttachedResources - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAttachedResourcesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scheduledActionOccurrenceOccurrencesRestClient.CreateGetAttachedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionOccurrenceOccurrencesRestClient.CreateGetAttachedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => OccurrenceResourceData.DeserializeOccurrenceResourceData(e), _scheduledActionOccurrenceOccurrencesClientDiagnostics, Pipeline, "ScheduledActionOccurrenceResource.GetAttachedResources", "value", "nextLink", cancellationToken); - } - - /// - /// List resources attached to Scheduled Actions for the given occurrence - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/resources - /// - /// - /// Operation Id - /// OccurrenceResource_GetAttachedResources - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAttachedResources(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scheduledActionOccurrenceOccurrencesRestClient.CreateGetAttachedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionOccurrenceOccurrencesRestClient.CreateGetAttachedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => OccurrenceResourceData.DeserializeOccurrenceResourceData(e), _scheduledActionOccurrenceOccurrencesClientDiagnostics, Pipeline, "ScheduledActionOccurrenceResource.GetAttachedResources", "value", "nextLink", cancellationToken); - } - /// /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/cancel + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/cancel. /// /// - /// Operation Id - /// Occurrences_Cancel + /// Operation Id. + /// Occurrences_Cancel. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -258,11 +216,21 @@ public virtual async Task> Canc { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Cancel"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Cancel"); scope.Start(); try { - var response = await _scheduledActionOccurrenceOccurrencesRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateCancelRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, OccurrenceCancelContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -276,20 +244,20 @@ public virtual async Task> Canc /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/cancel + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/cancel. /// /// - /// Operation Id - /// Occurrences_Cancel + /// Operation Id. + /// Occurrences_Cancel. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -300,11 +268,21 @@ public virtual Response Cancel(Occurrenc { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Cancel"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Cancel"); scope.Start(); try { - var response = _scheduledActionOccurrenceOccurrencesRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateCancelRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, OccurrenceCancelContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -318,20 +296,20 @@ public virtual Response Cancel(Occurrenc /// A long-running resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/delay + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/delay. /// /// - /// Operation Id - /// Occurrences_Delay + /// Operation Id. + /// Occurrences_Delay. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -343,14 +321,27 @@ public virtual async Task> { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Delay"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Delay"); scope.Start(); try { - var response = await _scheduledActionOccurrenceOccurrencesRestClient.DelayAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ComputeScheduleArmOperation(new ScheduledActionResourceOperationResultOperationSource(), _scheduledActionOccurrenceOccurrencesClientDiagnostics, Pipeline, _scheduledActionOccurrenceOccurrencesRestClient.CreateDelayRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateDelayRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, OccurrenceDelayContent.ToRequestContent(content), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + ComputeScheduleArmOperation operation = new ComputeScheduleArmOperation( + new ScheduledActionResourceOperationResultOperationSource(), + _occurrencesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -364,20 +355,20 @@ public virtual async Task> /// A long-running resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/delay + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId}/delay. /// /// - /// Operation Id - /// Occurrences_Delay + /// Operation Id. + /// Occurrences_Delay. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -389,14 +380,27 @@ public virtual ArmOperation Delay(WaitUn { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionOccurrenceOccurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Delay"); + using DiagnosticScope scope = _occurrencesClientDiagnostics.CreateScope("ScheduledActionOccurrenceResource.Delay"); scope.Start(); try { - var response = _scheduledActionOccurrenceOccurrencesRestClient.Delay(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ComputeScheduleArmOperation(new ScheduledActionResourceOperationResultOperationSource(), _scheduledActionOccurrenceOccurrencesClientDiagnostics, Pipeline, _scheduledActionOccurrenceOccurrencesRestClient.CreateDelayRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _occurrencesRestClient.CreateDelayRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, OccurrenceDelayContent.ToRequestContent(content), context); + Response response = Pipeline.ProcessMessage(message, context); + ComputeScheduleArmOperation operation = new ComputeScheduleArmOperation( + new ScheduledActionResourceOperationResultOperationSource(), + _occurrencesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.Serialization.cs index 6ac8a6bd21fb..213ffbea7158 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.Serialization.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.ComputeSchedule { + /// public partial class ScheduledActionResource : IJsonModel { - private static ScheduledActionData s_dataDeserializationInstance; - private static ScheduledActionData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new ScheduledActionData(); + + /// 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); - ScheduledActionData 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. + ScheduledActionData 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, AzureResourceManagerComputeScheduleContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. ScheduledActionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerComputeScheduleContext.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/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.cs index e9b5b4d26f41..550ff70e3b55 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ScheduledActionResource.cs @@ -7,48 +7,37 @@ using System; 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.ComputeSchedule.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ComputeSchedule { /// - /// A Class representing a ScheduledAction 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 GetScheduledActionResource method. - /// Otherwise you can get one from its parent resource using the GetScheduledAction method. + /// A class representing a ScheduledAction 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 GetScheduledActions method. /// public partial class ScheduledActionResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The scheduledActionName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scheduledActionName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _scheduledActionClientDiagnostics; - private readonly ScheduledActionsRestOperations _scheduledActionRestClient; + private readonly ClientDiagnostics _scheduledActionsClientDiagnostics; + private readonly ScheduledActions _scheduledActionsRestClient; private readonly ScheduledActionData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.ComputeSchedule/scheduledActions"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of ScheduledActionResource for mocking. protected ScheduledActionResource() { } - /// 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 ScheduledActionResource(ArmClient client, ScheduledActionData data) : this(client, data.Id) @@ -57,140 +46,92 @@ internal ScheduledActionResource(ArmClient client, ScheduledActionData data) : t _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 ScheduledActionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _scheduledActionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string scheduledActionApiVersion); - _scheduledActionRestClient = new ScheduledActionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scheduledActionApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _scheduledActionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeSchedule", ResourceType.Namespace, Diagnostics); + _scheduledActionsRestClient = new ScheduledActions(_scheduledActionsClientDiagnostics, Pipeline, Endpoint, scheduledActionApiVersion ?? "2026-01-01-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 ScheduledActionData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } - 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)); - } - - /// Gets a collection of ScheduledActionOccurrenceResources in the ScheduledAction. - /// An object representing collection of ScheduledActionOccurrenceResources and their operations over a ScheduledActionOccurrenceResource. - public virtual ScheduledActionOccurrenceCollection GetScheduledActionOccurrences() - { - return GetCachedClient(client => new ScheduledActionOccurrenceCollection(client, Id)); - } - - /// - /// Get a Occurrence - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} - /// - /// - /// Operation Id - /// Occurrence_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Occurrence. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetScheduledActionOccurrenceAsync(string occurrenceId, CancellationToken cancellationToken = default) + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The scheduledActionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scheduledActionName) { - return await GetScheduledActionOccurrences().GetAsync(occurrenceId, cancellationToken).ConfigureAwait(false); + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}"; + return new ResourceIdentifier(resourceId); } - /// - /// Get a Occurrence - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/occurrences/{occurrenceId} - /// - /// - /// Operation Id - /// Occurrence_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Occurrence. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetScheduledActionOccurrence(string occurrenceId, CancellationToken cancellationToken = default) + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) { - return GetScheduledActionOccurrences().Get(occurrenceId, cancellationToken); + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Get a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Get + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Get"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Get"); scope.Start(); try { - var response = await _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -204,33 +145,41 @@ public virtual async Task> GetAsync(Cancellati /// Get a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Get + /// Operation Id. + /// ScheduledActions_Get. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Get"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Get"); scope.Start(); try { - var response = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -241,39 +190,49 @@ public virtual Response Get(CancellationToken cancellat } /// - /// Delete a ScheduledAction + /// Update a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Delete + /// Operation Id. + /// ScheduledActions_Update. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-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. + /// The resource properties to be updated. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(ScheduledActionPatch patch, CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Delete"); + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Update"); scope.Start(); try { - var response = await _scheduledActionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ComputeScheduleArmOperation(_scheduledActionClientDiagnostics, Pipeline, _scheduledActionRestClient.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 = _scheduledActionsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionPatch.ToRequestContent(patch), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -283,39 +242,49 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Delete a ScheduledAction + /// Update a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Delete + /// Operation Id. + /// ScheduledActions_Update. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-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. + /// The resource properties to be updated. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual Response Update(ScheduledActionPatch patch, CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Delete"); + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Update"); scope.Start(); try { - var response = _scheduledActionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ComputeScheduleArmOperation(_scheduledActionClientDiagnostics, Pipeline, _scheduledActionRestClient.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 = _scheduledActionsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionPatch.ToRequestContent(patch), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -325,39 +294,46 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Update a ScheduledAction + /// Delete a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Update + /// Operation Id. + /// ScheduledActions_Delete. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// The resource properties to be updated. + /// 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(ScheduledActionPatch patch, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Update"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Delete"); scope.Start(); try { - var response = await _scheduledActionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + ComputeScheduleArmOperation operation = new ComputeScheduleArmOperation(_scheduledActionsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } + return operation; } catch (Exception e) { @@ -367,39 +343,46 @@ public virtual async Task> UpdateAsync(Schedul } /// - /// Update a ScheduledAction + /// Delete a ScheduledAction /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}. /// /// - /// Operation Id - /// ScheduledAction_Update + /// Operation Id. + /// ScheduledActions_Delete. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// The resource properties to be updated. + /// 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(ScheduledActionPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Update"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Delete"); scope.Start(); try { - var response = _scheduledActionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + ComputeScheduleArmOperation operation = new ComputeScheduleArmOperation(_scheduledActionsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletionResponse(cancellationToken); + } + return operation; } catch (Exception e) { @@ -412,50 +395,52 @@ public virtual Response Update(ScheduledActionPatch pat /// List resources attached to Scheduled Actions /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/resources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/resources. /// /// - /// Operation Id - /// ScheduledActions_GetAttachedResources + /// Operation Id. + /// ScheduledActions_ListResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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 GetAttachedResourcesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scheduledActionRestClient.CreateGetAttachedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionRestClient.CreateGetAttachedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ScheduledActionResourceData.DeserializeScheduledActionResourceData(e), _scheduledActionClientDiagnostics, Pipeline, "ScheduledActionResource.GetAttachedResources", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new ScheduledActionsGetAttachedResourcesAsyncCollectionResultOfT(_scheduledActionsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// /// List resources attached to Scheduled Actions /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/resources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/resources. /// /// - /// Operation Id - /// ScheduledActions_GetAttachedResources + /// Operation Id. + /// ScheduledActions_ListResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -463,29 +448,31 @@ public virtual AsyncPageable GetAttachedResourcesAs /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAttachedResources(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scheduledActionRestClient.CreateGetAttachedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scheduledActionRestClient.CreateGetAttachedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ScheduledActionResourceData.DeserializeScheduledActionResourceData(e), _scheduledActionClientDiagnostics, Pipeline, "ScheduledActionResource.GetAttachedResources", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new ScheduledActionsGetAttachedResourcesCollectionResultOfT(_scheduledActionsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/attachResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/attachResources. /// /// - /// Operation Id - /// ScheduledActions_AttachResources + /// Operation Id. + /// ScheduledActions_AttachResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -496,11 +483,21 @@ public virtual async Task> Atta { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.AttachResources"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.AttachResources"); scope.Start(); try { - var response = await _scheduledActionRestClient.AttachResourcesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateAttachResourcesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionResourceAttachContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -514,20 +511,20 @@ public virtual async Task> Atta /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/attachResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/attachResources. /// /// - /// Operation Id - /// ScheduledActions_AttachResources + /// Operation Id. + /// ScheduledActions_AttachResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -538,11 +535,21 @@ public virtual Response AttachResources( { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.AttachResources"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.AttachResources"); scope.Start(); try { - var response = _scheduledActionRestClient.AttachResources(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateAttachResourcesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionResourceAttachContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -556,20 +563,20 @@ public virtual Response AttachResources( /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/detachResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/detachResources. /// /// - /// Operation Id - /// ScheduledActions_DetachResources + /// Operation Id. + /// ScheduledActions_DetachResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -580,11 +587,21 @@ public virtual async Task> Deta { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.DetachResources"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.DetachResources"); scope.Start(); try { - var response = await _scheduledActionRestClient.DetachResourcesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateDetachResourcesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionResourceDetachContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -598,20 +615,20 @@ public virtual async Task> Deta /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/detachResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/detachResources. /// /// - /// Operation Id - /// ScheduledActions_DetachResources + /// Operation Id. + /// ScheduledActions_DetachResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -622,11 +639,21 @@ public virtual Response DetachResources( { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.DetachResources"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.DetachResources"); scope.Start(); try { - var response = _scheduledActionRestClient.DetachResources(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateDetachResourcesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionResourceDetachContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -640,20 +667,20 @@ public virtual Response DetachResources( /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/patchResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/patchResources. /// /// - /// Operation Id - /// ScheduledActions_PatchResources + /// Operation Id. + /// ScheduledActions_PatchResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -664,11 +691,21 @@ public virtual async Task> Patc { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.PatchResources"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.PatchResources"); scope.Start(); try { - var response = await _scheduledActionRestClient.PatchResourcesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreatePatchResourcesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionResourcePatchContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -682,20 +719,20 @@ public virtual async Task> Patc /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/patchResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/patchResources. /// /// - /// Operation Id - /// ScheduledActions_PatchResources + /// Operation Id. + /// ScheduledActions_PatchResources. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -706,11 +743,21 @@ public virtual Response PatchResources(S { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.PatchResources"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.PatchResources"); scope.Start(); try { - var response = _scheduledActionRestClient.PatchResources(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreatePatchResourcesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, ScheduledActionResourcePatchContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -724,31 +771,36 @@ public virtual Response PatchResources(S /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/disable + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/disable. /// /// - /// Operation Id - /// ScheduledActions_Disable + /// Operation Id. + /// ScheduledActions_Disable. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task DisableAsync(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Disable"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Disable"); scope.Start(); try { - var response = await _scheduledActionRestClient.DisableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateDisableRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); return response; } catch (Exception e) @@ -762,31 +814,36 @@ public virtual async Task DisableAsync(CancellationToken cancellationT /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/disable + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/disable. /// /// - /// Operation Id - /// ScheduledActions_Disable + /// Operation Id. + /// ScheduledActions_Disable. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Disable(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Disable"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Disable"); scope.Start(); try { - var response = _scheduledActionRestClient.Disable(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateDisableRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); return response; } catch (Exception e) @@ -800,31 +857,36 @@ public virtual Response Disable(CancellationToken cancellationToken = default) /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/enable + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/enable. /// /// - /// Operation Id - /// ScheduledActions_Enable + /// Operation Id. + /// ScheduledActions_Enable. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task EnableAsync(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Enable"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Enable"); scope.Start(); try { - var response = await _scheduledActionRestClient.EnableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateEnableRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); return response; } catch (Exception e) @@ -838,31 +900,36 @@ public virtual async Task EnableAsync(CancellationToken cancellationTo /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/enable + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/enable. /// /// - /// Operation Id - /// ScheduledActions_Enable + /// Operation Id. + /// ScheduledActions_Enable. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Enable(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.Enable"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.Enable"); scope.Start(); try { - var response = _scheduledActionRestClient.Enable(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateEnableRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); return response; } catch (Exception e) @@ -876,20 +943,20 @@ public virtual Response Enable(CancellationToken cancellationToken = default) /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/cancelNextOccurrence + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/cancelNextOccurrence. /// /// - /// Operation Id - /// ScheduledActions_CancelNextOccurrence + /// Operation Id. + /// ScheduledActions_CancelNextOccurrence. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -900,11 +967,21 @@ public virtual async Task> Canc { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.CancelNextOccurrence"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.CancelNextOccurrence"); scope.Start(); try { - var response = await _scheduledActionRestClient.CancelNextOccurrenceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateCancelNextOccurrenceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, OccurrenceCancelContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -918,20 +995,20 @@ public virtual async Task> Canc /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/cancelNextOccurrence + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/cancelNextOccurrence. /// /// - /// Operation Id - /// ScheduledActions_CancelNextOccurrence + /// Operation Id. + /// ScheduledActions_CancelNextOccurrence. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -942,11 +1019,21 @@ public virtual Response CancelNextOccurr { Argument.AssertNotNull(content, nameof(content)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.CancelNextOccurrence"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.CancelNextOccurrence"); scope.Start(); try { - var response = _scheduledActionRestClient.CancelNextOccurrence(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateCancelNextOccurrenceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, OccurrenceCancelContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionResourceOperationResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return response; } catch (Exception e) @@ -960,31 +1047,41 @@ public virtual Response CancelNextOccurr /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/triggerManualOccurrence + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/triggerManualOccurrence. /// /// - /// Operation Id - /// ScheduledActions_TriggerManualOccurrence + /// Operation Id. + /// ScheduledActions_TriggerManualOccurrence. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> TriggerManualOccurrenceAsync(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.TriggerManualOccurrence"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.TriggerManualOccurrence"); scope.Start(); try { - var response = await _scheduledActionRestClient.TriggerManualOccurrenceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateTriggerManualOccurrenceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -998,31 +1095,41 @@ public virtual async Task> TriggerMa /// A synchronous resource action. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/triggerManualOccurrence + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName}/triggerManualOccurrence. /// /// - /// Operation Id - /// ScheduledActions_TriggerManualOccurrence + /// Operation Id. + /// ScheduledActions_TriggerManualOccurrence. /// /// - /// Default Api Version - /// 2025-04-15-preview + /// Default Api Version. + /// 2026-01-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response TriggerManualOccurrence(CancellationToken cancellationToken = default) { - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.TriggerManualOccurrence"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.TriggerManualOccurrence"); scope.Start(); try { - var response = _scheduledActionRestClient.TriggerManualOccurrence(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateTriggerManualOccurrenceRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionOccurrenceData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new ScheduledActionOccurrenceResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -1032,27 +1139,7 @@ public virtual Response TriggerManualOccurren } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -1062,29 +1149,35 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.AddTag"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.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 _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ScheduledActionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ScheduledActionPatch(); - foreach (var tag in current.Tags) + ScheduledActionData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + ScheduledActionPatch patch = new ScheduledActionPatch(); + 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) @@ -1094,27 +1187,7 @@ public virtual async Task> AddTagAsync(string } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -1124,29 +1197,35 @@ public virtual Response AddTag(string key, string value Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.AddTag"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.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 = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ScheduledActionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ScheduledActionPatch(); - foreach (var tag in current.Tags) + ScheduledActionData current = Get(cancellationToken: cancellationToken).Value.Data; + ScheduledActionPatch patch = new ScheduledActionPatch(); + 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) @@ -1156,54 +1235,40 @@ public virtual Response AddTag(string key, string value } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-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 = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.SetTags"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.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 _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ScheduledActionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ScheduledActionPatch(); + ScheduledActionData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + ScheduledActionPatch patch = new ScheduledActionPatch(); 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) @@ -1213,54 +1278,40 @@ public virtual async Task> SetTagsAsync(IDicti } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-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 = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.SetTags"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.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 = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ScheduledActionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ScheduledActionPatch(); + ScheduledActionData current = Get(cancellationToken: cancellationToken).Value.Data; + ScheduledActionPatch patch = new ScheduledActionPatch(); 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) @@ -1270,27 +1321,7 @@ public virtual Response SetTags(IDictionary - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -1298,29 +1329,35 @@ public virtual async Task> RemoveTagAsync(stri { Argument.AssertNotNull(key, nameof(key)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.RemoveTag"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.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 _scheduledActionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ScheduledActionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ScheduledActionPatch(); - foreach (var tag in current.Tags) + ScheduledActionData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + ScheduledActionPatch patch = new ScheduledActionPatch(); + 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) @@ -1330,27 +1367,7 @@ public virtual async Task> RemoveTagAsync(stri } } - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeSchedule/scheduledActions/{scheduledActionName} - /// - /// - /// Operation Id - /// ScheduledAction_Get - /// - /// - /// Default Api Version - /// 2025-04-15-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -1358,29 +1375,35 @@ public virtual Response RemoveTag(string key, Cancellat { Argument.AssertNotNull(key, nameof(key)); - using var scope = _scheduledActionClientDiagnostics.CreateScope("ScheduledActionResource.RemoveTag"); + using DiagnosticScope scope = _scheduledActionsClientDiagnostics.CreateScope("ScheduledActionResource.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 = _scheduledActionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new ScheduledActionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _scheduledActionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(ScheduledActionData.FromResponse(result), result); + return Response.FromValue(new ScheduledActionResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ScheduledActionPatch(); - foreach (var tag in current.Tags) + ScheduledActionData current = Get(cancellationToken: cancellationToken).Value.Data; + ScheduledActionPatch patch = new ScheduledActionPatch(); + 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) @@ -1389,5 +1412,38 @@ public virtual Response RemoveTag(string key, Cancellat throw; } } + + /// Gets a collection of ScheduledActionOccurrences in the . + /// An object representing collection of ScheduledActionOccurrences and their operations over a ScheduledActionOccurrenceResource. + public virtual ScheduledActionOccurrenceCollection GetScheduledActionOccurrences() + { + return GetCachedClient(client => new ScheduledActionOccurrenceCollection(client, Id)); + } + + /// Get a Occurrence. + /// The name of the Occurrence. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScheduledActionOccurrenceAsync(string occurrenceId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); + + return await GetScheduledActionOccurrences().GetAsync(occurrenceId, cancellationToken).ConfigureAwait(false); + } + + /// Get a Occurrence. + /// The name of the Occurrence. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScheduledActionOccurrence(string occurrenceId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(occurrenceId, nameof(occurrenceId)); + + return GetScheduledActionOccurrences().Get(occurrenceId, cancellationToken); + } } } diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/GlobalSuppressions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/GlobalSuppressions.cs index c4621b445d2a..603a8f6426b1 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/GlobalSuppressions.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/GlobalSuppressions.cs @@ -18,3 +18,7 @@ [assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "This defines the optional parameters used for schedules in ScheduledActions", Scope = "type", Target = "~T:Azure.ResourceManager.ComputeSchedule.Models.ExecutionParameters")] [assembly: SuppressMessage("Naming", "AZC0033:Improper model name suffix", Justification = "This defines the details of operations done on resources using ScheduledActions", Scope = "type", Target = "~T:Azure.ResourceManager.ComputeSchedule.Models.ResourceOperation")] + +[assembly: SuppressMessage("Naming", "AZC0032:Improper model name suffix", Justification = "Keep the Data as the name suffix to be backward compatible", Scope = "type", Target = "~T:Azure.ResourceManager.ComputeSchedule.Models.OccurrenceResourceData")] + +[assembly: SuppressMessage("Naming", "AZC0032:Improper model name suffix", Justification = "Keep the Data as the name suffix to be backward compatible", Scope = "type", Target = "~T:Azure.ResourceManager.ComputeSchedule.Models.ScheduledActionResourceData")] diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ArmClientExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ArmClientExtensions.cs similarity index 100% rename from sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ArmClientExtensions.cs rename to sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ArmClientExtensions.cs diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ResourceGroupResourceExtentions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ResourceGroupResourceExtentions.cs new file mode 100644 index 000000000000..6b7f74731449 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ResourceGroupResourceExtentions.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.ComputeSchedule; +using Azure.ResourceManager.ComputeSchedule.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ComputeSchedule.Tests.Samples +{ + public partial class Sample_ResourceGroupResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAttachedResources_Occurrences_ListResources_MaximumSet_Gen() + { + // Generated from example definition: 2025-04-15-preview/Occurrences_ListResources_MaximumSet_Gen.json + // this example is just showing the usage of "Occurrences_ListResources" operation, for the dependent resources, they will have to be created separately + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string scheduledActionName = "myScheduledAction"; + string occurrenceId = "myOccurrence"; + await foreach (OccurrenceResourceData item in resourceGroupResource.GetAttachedResourcesAsync(scheduledActionName, occurrenceId)) + { + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {item.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionCollection.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionCollection.cs similarity index 100% rename from sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionCollection.cs rename to sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionCollection.cs diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionOccurrenceCollection.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionOccurrenceCollection.cs similarity index 100% rename from sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionOccurrenceCollection.cs rename to sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionOccurrenceCollection.cs diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionOccurrenceResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionOccurrenceResource.cs similarity index 77% rename from sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionOccurrenceResource.cs rename to sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionOccurrenceResource.cs index 9b1db5a3f369..555b2a8ef468 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionOccurrenceResource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionOccurrenceResource.cs @@ -47,36 +47,6 @@ public async Task Get_OccurrencesGetMaximumSet() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAttachedResources_OccurrencesListResourcesMaximumSet() - { - // Generated from example definition: 2025-04-15-preview/Occurrences_ListResources_MaximumSet_Gen.json - // this example is just showing the usage of "OccurrenceResource_GetAttachedResources" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ScheduledActionOccurrenceResource created on azure - // for more information of creating ScheduledActionOccurrenceResource, please refer to the document of ScheduledActionOccurrenceResource - string subscriptionId = "CB26D7CB-3E27-465F-99C8-EAF7A4118245"; - string resourceGroupName = "rgcomputeschedule"; - string scheduledActionName = "myScheduledAction"; - string occurrenceId = "CB26D7CB-3E27-465F-99C8-EAF7A4118245"; - ResourceIdentifier scheduledActionOccurrenceResourceId = ScheduledActionOccurrenceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scheduledActionName, occurrenceId); - ScheduledActionOccurrenceResource scheduledActionOccurrence = client.GetScheduledActionOccurrenceResource(scheduledActionOccurrenceResourceId); - - // invoke the operation and iterate over the result - await foreach (OccurrenceResourceData item in scheduledActionOccurrence.GetAttachedResourcesAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task Cancel_OccurrencesCancelMaximumSet() diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionResource.cs similarity index 100% rename from sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_ScheduledActionResource.cs rename to sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_ScheduledActionResource.cs diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_SubscriptionResourceExtensions.cs similarity index 100% rename from sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs rename to sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tests/Samples/Sample_SubscriptionResourceExtensions.cs diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml index 01a370fad5b8..f62d0caf2f8e 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: 9bb1d0cb26f08a96078513e68e6207d078206a58 +commit: 3e5a767cd854ecb2559595228f8b34256cb99b46 repo: Azure/azure-rest-api-specs -emitterPackageJsonPath: eng/legacy-emitter-package.json +emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json"