From 9172da021fe94b173cf47faff214449be552212d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 3 Nov 2022 07:53:23 +0000 Subject: [PATCH] CodeGen from PR 21128 in Azure/azure-rest-api-specs Added Response Schema for Runbook Operation (#21128) * Added Response Schema for Runbook Operation * Update resopnse of Runbook Operation * Updated example to fix Avacado errors * Update resopnse of Runbook Operation * Updated example to fix Avacado errors * Fix Lint diff errors * Fix Avacado errors * Fix Avacado errors Co-authored-by: Sushil Upadhyay --- ...sourceManager.Automation.netstandard2.0.cs | 118 ++- ...tomationAccountPython2PackageCollection.cs | 20 +- ...AutomationAccountPython2PackageResource.cs | 32 +- ...tomationAccountPython3PackageCollection.cs | 334 +++++++ ...AutomationAccountPython3PackageResource.cs | 505 ++++++++++ .../Generated/AutomationAccountResource.cs | 893 +++++++++--------- .../Generated/AutomationRunbookResource.cs | 8 +- .../Extensions/AutomationExtensions.cs | 315 +++--- .../SubscriptionResourceExtensionClient.cs | 102 +- .../AutomationModuleData.Serialization.cs | 4 +- .../ModuleProvisioningState.Serialization.cs | 56 -- .../Models/ModuleProvisioningState.cs | 81 +- ...nPackageCreateParameters.Serialization.cs} | 2 +- ...nt.cs => PythonPackageCreateParameters.cs} | 6 +- ...nPackageUpdateParameters.Serialization.cs} | 2 +- ...ch.cs => PythonPackageUpdateParameters.cs} | 6 +- .../RestOperations/ActivityRestOperations.cs | 2 +- .../AutomationAccountRestOperations.cs | 2 +- .../AutomationRestOperations.cs | 2 +- .../CertificateRestOperations.cs | 2 +- .../ConnectionRestOperations.cs | 2 +- .../ConnectionTypeRestOperations.cs | 2 +- .../CredentialRestOperations.cs | 2 +- .../DscConfigurationRestOperations.cs | 2 +- .../DscNodeConfigurationRestOperations.cs | 2 +- .../RestOperations/FieldsRestOperations.cs | 2 +- .../HybridRunbookWorkerGroupRestOperations.cs | 4 +- .../HybridRunbookWorkersRestOperations.cs | 4 +- .../RestOperations/JobRestOperations.cs | 2 +- .../JobScheduleRestOperations.cs | 2 +- .../RestOperations/JobStreamRestOperations.cs | 2 +- .../RestOperations/KeysRestOperations.cs | 2 +- .../LinkedWorkspaceRestOperations.cs | 2 +- .../RestOperations/ModuleRestOperations.cs | 2 +- .../ObjectDataTypesRestOperations.cs | 2 +- .../Python2PackageRestOperations.cs | 54 +- .../Python3PackageRestOperations.cs | 545 +++++++++++ .../RunbookDraftRestOperations.cs | 6 +- .../RestOperations/RunbookRestOperations.cs | 2 +- .../RestOperations/ScheduleRestOperations.cs | 2 +- ...eConfigurationMachineRunsRestOperations.cs | 2 +- ...reUpdateConfigurationRunsRestOperations.cs | 2 +- .../SourceControlRestOperations.cs | 2 +- .../SourceControlSyncJobRestOperations.cs | 2 +- ...urceControlSyncJobStreamsRestOperations.cs | 2 +- .../StatisticsRestOperations.cs | 2 +- .../RestOperations/TestJobRestOperations.cs | 2 +- .../TestJobStreamsRestOperations.cs | 2 +- .../RestOperations/UsagesRestOperations.cs | 2 +- .../RestOperations/VariableRestOperations.cs | 2 +- .../src/autorest.md | 2 +- 51 files changed, 2322 insertions(+), 835 deletions(-) create mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageCollection.cs create mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageResource.cs delete mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.Serialization.cs rename sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/{AutomationAccountPython2PackageCreateOrUpdateContent.Serialization.cs => PythonPackageCreateParameters.Serialization.cs} (91%) rename sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/{AutomationAccountPython2PackageCreateOrUpdateContent.cs => PythonPackageCreateParameters.cs} (77%) rename sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/{AutomationAccountPython2PackagePatch.Serialization.cs => PythonPackageUpdateParameters.Serialization.cs} (90%) rename sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/{AutomationAccountPython2PackagePatch.cs => PythonPackageUpdateParameters.cs} (72%) create mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python3PackageRestOperations.cs diff --git a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs index 6e605b438817b..d12425dd4a40b 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/api/Azure.ResourceManager.Automation.netstandard2.0.cs @@ -78,8 +78,8 @@ protected AutomationAccountModuleResource() { } public partial class AutomationAccountPython2PackageCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected AutomationAccountPython2PackageCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string packageName, Azure.ResourceManager.Automation.Models.AutomationAccountPython2PackageCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string packageName, Azure.ResourceManager.Automation.Models.AutomationAccountPython2PackageCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string packageName, Azure.ResourceManager.Automation.Models.PythonPackageCreateParameters pythonPackageCreateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string packageName, Azure.ResourceManager.Automation.Models.PythonPackageCreateParameters pythonPackageCreateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -107,8 +107,43 @@ protected AutomationAccountPython2PackageResource() { } 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; } - public virtual Azure.Response Update(Azure.ResourceManager.Automation.Models.AutomationAccountPython2PackagePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Automation.Models.AutomationAccountPython2PackagePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.Automation.Models.PythonPackageUpdateParameters pythonPackageUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Automation.Models.PythonPackageUpdateParameters pythonPackageUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AutomationAccountPython3PackageCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AutomationAccountPython3PackageCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string packageName, Azure.ResourceManager.Automation.Models.PythonPackageCreateParameters pythonPackageCreateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string packageName, Azure.ResourceManager.Automation.Models.PythonPackageCreateParameters pythonPackageCreateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string packageName, 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 packageName, 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 AutomationAccountPython3PackageResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AutomationAccountPython3PackageResource() { } + public virtual Azure.ResourceManager.Automation.AutomationModuleData 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 static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName) { 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 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.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; } + public virtual Azure.Response Update(Azure.ResourceManager.Automation.Models.PythonPackageUpdateParameters pythonPackageUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Automation.Models.PythonPackageUpdateParameters pythonPackageUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class AutomationAccountResource : Azure.ResourceManager.ArmResource { @@ -141,6 +176,9 @@ protected AutomationAccountResource() { } public virtual Azure.Response GetAutomationAccountPython2Package(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAutomationAccountPython2PackageAsync(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Automation.AutomationAccountPython2PackageCollection GetAutomationAccountPython2Packages() { throw null; } + public virtual Azure.Response GetAutomationAccountPython3Package(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAutomationAccountPython3PackageAsync(string packageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Automation.AutomationAccountPython3PackageCollection GetAutomationAccountPython3Packages() { throw null; } public virtual Azure.Response GetAutomationCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAutomationCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Automation.AutomationCertificateCollection GetAutomationCertificates() { throw null; } @@ -385,6 +423,7 @@ public static partial class AutomationExtensions public static System.Threading.Tasks.Task> GetAutomationAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string automationAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Automation.AutomationAccountModuleResource GetAutomationAccountModuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Automation.AutomationAccountPython2PackageResource GetAutomationAccountPython2PackageResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Automation.AutomationAccountPython3PackageResource GetAutomationAccountPython3PackageResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Automation.AutomationAccountResource GetAutomationAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Automation.AutomationAccountCollection GetAutomationAccounts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetAutomationAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1254,17 +1293,6 @@ public AutomationAccountPatch() { } public Azure.ResourceManager.Automation.Models.AutomationSku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } - public partial class AutomationAccountPython2PackageCreateOrUpdateContent - { - public AutomationAccountPython2PackageCreateOrUpdateContent(Azure.ResourceManager.Automation.Models.AutomationContentLink contentLink) { } - public Azure.ResourceManager.Automation.Models.AutomationContentLink ContentLink { get { throw null; } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - } - public partial class AutomationAccountPython2PackagePatch - { - public AutomationAccountPython2PackagePatch() { } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AutomationAccountState : System.IEquatable { @@ -2263,24 +2291,37 @@ public LinuxUpdateConfigurationProperties() { } public System.Collections.Generic.IList IncludedPackageNameMasks { get { throw null; } } public string RebootSetting { get { throw null; } set { } } } - public enum ModuleProvisioningState - { - Created = 0, - Creating = 1, - StartingImportModuleRunbook = 2, - RunningImportModuleRunbook = 3, - ContentRetrieved = 4, - ContentDownloaded = 5, - ContentValidated = 6, - ConnectionTypeImported = 7, - ContentStored = 8, - ModuleDataStored = 9, - ActivitiesStored = 10, - ModuleImportRunbookComplete = 11, - Succeeded = 12, - Failed = 13, - Cancelled = 14, - Updating = 15, + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModuleProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ModuleProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ActivitiesStored { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState Cancelled { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ConnectionTypeImported { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ContentDownloaded { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ContentRetrieved { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ContentStored { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ContentValidated { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState Created { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ModuleDataStored { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState ModuleImportRunbookComplete { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState RunningImportModuleRunbook { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState StartingImportModuleRunbook { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Automation.Models.ModuleProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Automation.Models.ModuleProvisioningState 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.Automation.Models.ModuleProvisioningState left, Azure.ResourceManager.Automation.Models.ModuleProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Automation.Models.ModuleProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Automation.Models.ModuleProvisioningState left, Azure.ResourceManager.Automation.Models.ModuleProvisioningState right) { throw null; } + public override string ToString() { throw null; } } public partial class NonAzureQueryProperties { @@ -2288,6 +2329,17 @@ public NonAzureQueryProperties() { } public string FunctionAlias { get { throw null; } set { } } public string WorkspaceId { get { throw null; } set { } } } + public partial class PythonPackageCreateParameters + { + public PythonPackageCreateParameters(Azure.ResourceManager.Automation.Models.AutomationContentLink contentLink) { } + public Azure.ResourceManager.Automation.Models.AutomationContentLink ContentLink { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + } + public partial class PythonPackageUpdateParameters + { + public PythonPackageUpdateParameters() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + } public enum QueryTagOperator { All = 0, diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageCollection.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageCollection.cs index f1380e972938d..c90af368b0e11 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageCollection.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageCollection.cs @@ -61,20 +61,20 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// 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 name of python package. - /// The create or update parameters for python package. + /// The create or update parameters for python package. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string packageName, AutomationAccountPython2PackageCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); using var scope = _automationAccountPython2PackagePython2PackageClientDiagnostics.CreateScope("AutomationAccountPython2PackageCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _automationAccountPython2PackagePython2PackageRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, content, cancellationToken).ConfigureAwait(false); + var response = await _automationAccountPython2PackagePython2PackageRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, pythonPackageCreateParameters, cancellationToken).ConfigureAwait(false); var operation = new AutomationArmOperation(Response.FromValue(new AutomationAccountPython2PackageResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); @@ -94,20 +94,20 @@ public virtual async Task> /// /// 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 name of python package. - /// The create or update parameters for python package. + /// The create or update parameters for python package. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string packageName, AutomationAccountPython2PackageCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); using var scope = _automationAccountPython2PackagePython2PackageClientDiagnostics.CreateScope("AutomationAccountPython2PackageCollection.CreateOrUpdate"); scope.Start(); try { - var response = _automationAccountPython2PackagePython2PackageRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, content, cancellationToken); + var response = _automationAccountPython2PackagePython2PackageRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, pythonPackageCreateParameters, cancellationToken); var operation = new AutomationArmOperation(Response.FromValue(new AutomationAccountPython2PackageResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageResource.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageResource.cs index 211293eb368bd..842f758a296b9 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageResource.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython2PackageResource.cs @@ -193,18 +193,18 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName} /// Operation Id: Python2Package_Update /// - /// The update parameters for python package. + /// The update parameters for python package. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(AutomationAccountPython2PackagePatch patch, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); using var scope = _automationAccountPython2PackagePython2PackageClientDiagnostics.CreateScope("AutomationAccountPython2PackageResource.Update"); scope.Start(); try { - var response = await _automationAccountPython2PackagePython2PackageRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var response = await _automationAccountPython2PackagePython2PackageRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, pythonPackageUpdateParameters, cancellationToken).ConfigureAwait(false); return Response.FromValue(new AutomationAccountPython2PackageResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -219,18 +219,18 @@ public virtual async Task> Upd /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName} /// Operation Id: Python2Package_Update /// - /// The update parameters for python package. + /// The update parameters for python package. /// The cancellation token to use. - /// is null. - public virtual Response Update(AutomationAccountPython2PackagePatch patch, CancellationToken cancellationToken = default) + /// is null. + public virtual Response Update(PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); using var scope = _automationAccountPython2PackagePython2PackageClientDiagnostics.CreateScope("AutomationAccountPython2PackageResource.Update"); scope.Start(); try { - var response = _automationAccountPython2PackagePython2PackageRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var response = _automationAccountPython2PackagePython2PackageRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, pythonPackageUpdateParameters, cancellationToken); return Response.FromValue(new AutomationAccountPython2PackageResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -269,7 +269,7 @@ public virtual async Task> Add else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new AutomationAccountPython2PackagePatch(); + var patch = new PythonPackageUpdateParameters(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -315,7 +315,7 @@ public virtual Response AddTag(string k else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new AutomationAccountPython2PackagePatch(); + var patch = new PythonPackageUpdateParameters(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -360,7 +360,7 @@ public virtual async Task> Set else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new AutomationAccountPython2PackagePatch(); + var patch = new PythonPackageUpdateParameters(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); return result; @@ -401,7 +401,7 @@ public virtual Response SetTags(IDictio else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new AutomationAccountPython2PackagePatch(); + var patch = new PythonPackageUpdateParameters(); patch.Tags.ReplaceWith(tags); var result = Update(patch, cancellationToken: cancellationToken); return result; @@ -441,7 +441,7 @@ public virtual async Task> Rem else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new AutomationAccountPython2PackagePatch(); + var patch = new PythonPackageUpdateParameters(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -485,7 +485,7 @@ public virtual Response RemoveTag(strin else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new AutomationAccountPython2PackagePatch(); + var patch = new PythonPackageUpdateParameters(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageCollection.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageCollection.cs new file mode 100644 index 0000000000000..42f2d192ecf7c --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageCollection.cs @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Automation.Models; + +namespace Azure.ResourceManager.Automation +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutomationAccountPython3Packages method from an instance of . + /// + public partial class AutomationAccountPython3PackageCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _automationAccountPython3PackagePython3PackageClientDiagnostics; + private readonly Python3PackageRestOperations _automationAccountPython3PackagePython3PackageRestClient; + + /// Initializes a new instance of the class for mocking. + protected AutomationAccountPython3PackageCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AutomationAccountPython3PackageCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _automationAccountPython3PackagePython3PackageClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", AutomationAccountPython3PackageResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutomationAccountPython3PackageResource.ResourceType, out string automationAccountPython3PackagePython3PackageApiVersion); + _automationAccountPython3PackagePython3PackageRestClient = new Python3PackageRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, automationAccountPython3PackagePython3PackageApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AutomationAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, AutomationAccountResource.ResourceType), nameof(id)); + } + + /// + /// Create or Update the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_CreateOrUpdate + /// + /// 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 name of python package. + /// The create or update parameters for python package. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, pythonPackageCreateParameters, cancellationToken).ConfigureAwait(false); + var operation = new AutomationArmOperation(Response.FromValue(new AutomationAccountPython3PackageResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_CreateOrUpdate + /// + /// 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 name of python package. + /// The create or update parameters for python package. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, pythonPackageCreateParameters, cancellationToken); + var operation = new AutomationArmOperation(Response.FromValue(new AutomationAccountPython3PackageResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The python package name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.Get"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The python package name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.Get"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve a list of python 3 packages. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages + /// Operation Id: Python3Package_ListByAutomationAccount + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.GetAll"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.ListByAutomationAccountAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountPython3PackageResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.GetAll"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.ListByAutomationAccountNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountPython3PackageResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Retrieve a list of python 3 packages. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages + /// Operation Id: Python3Package_ListByAutomationAccount + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.GetAll"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.ListByAutomationAccount(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountPython3PackageResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.GetAll"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.ListByAutomationAccountNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountPython3PackageResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The python package name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.Exists"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The python package name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageCollection.Exists"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, packageName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageResource.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageResource.cs new file mode 100644 index 0000000000000..99cf67217381f --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountPython3PackageResource.cs @@ -0,0 +1,505 @@ +// 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.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Automation.Models; + +namespace Azure.ResourceManager.Automation +{ + /// + /// A Class representing an AutomationAccountPython3Package along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutomationAccountPython3PackageResource method. + /// Otherwise you can get one from its parent resource using the GetAutomationAccountPython3Package method. + /// + public partial class AutomationAccountPython3PackageResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _automationAccountPython3PackagePython3PackageClientDiagnostics; + private readonly Python3PackageRestOperations _automationAccountPython3PackagePython3PackageRestClient; + private readonly AutomationModuleData _data; + + /// Initializes a new instance of the class for mocking. + protected AutomationAccountPython3PackageResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutomationAccountPython3PackageResource(ArmClient client, AutomationModuleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AutomationAccountPython3PackageResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _automationAccountPython3PackagePython3PackageClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string automationAccountPython3PackagePython3PackageApiVersion); + _automationAccountPython3PackagePython3PackageRestClient = new Python3PackageRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, automationAccountPython3PackagePython3PackageApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Automation/automationAccounts/python3Packages"; + + /// 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 AutomationModuleData 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)); + } + + /// + /// Retrieve the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.Get"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.Get"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the python 3 package by name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Delete + /// + /// 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. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.Delete"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AutomationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the python 3 package by name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Delete + /// + /// 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. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.Delete"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AutomationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Update + /// + /// The update parameters for python package. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.Update"); + scope.Start(); + try + { + var response = await _automationAccountPython3PackagePython3PackageRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, pythonPackageUpdateParameters, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Update + /// + /// The update parameters for python package. + /// The cancellation token to use. + /// is null. + public virtual Response Update(PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.Update"); + scope.Start(); + try + { + var response = _automationAccountPython3PackagePython3PackageRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, pythonPackageUpdateParameters, cancellationToken); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var 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 _automationAccountPython3PackagePython3PackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PythonPackageUpdateParameters(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _automationAccountPython3PackagePython3PackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PythonPackageUpdateParameters(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The set of tags to use as replacement. + /// 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 = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var 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 _automationAccountPython3PackagePython3PackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PythonPackageUpdateParameters(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _automationAccountPython3PackagePython3PackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PythonPackageUpdateParameters(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var 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 _automationAccountPython3PackagePython3PackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PythonPackageUpdateParameters(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _automationAccountPython3PackagePython3PackageClientDiagnostics.CreateScope("AutomationAccountPython3PackageResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _automationAccountPython3PackagePython3PackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new AutomationAccountPython3PackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PythonPackageUpdateParameters(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs index 1f53adc0e5125..2d67d5b251655 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs @@ -46,6 +46,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly DscCompilationJobStreamRestOperations _dscCompilationJobStreamRestClient; private readonly ClientDiagnostics _nodeCountInformationClientDiagnostics; private readonly NodeCountInformationRestOperations _nodeCountInformationRestClient; + private readonly ClientDiagnostics _automationWebhookWebhookClientDiagnostics; + private readonly WebhookRestOperations _automationWebhookWebhookRestClient; private readonly ClientDiagnostics _statisticsClientDiagnostics; private readonly StatisticsRestOperations _statisticsRestClient; private readonly ClientDiagnostics _usagesClientDiagnostics; @@ -58,12 +60,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ObjectDataTypesRestOperations _objectDataTypesRestClient; private readonly ClientDiagnostics _defaultClientDiagnostics; private readonly AutomationRestOperations _defaultRestClient; - private readonly ClientDiagnostics _softwareUpdateConfigurationRunsClientDiagnostics; - private readonly SoftwareUpdateConfigurationRunsRestOperations _softwareUpdateConfigurationRunsRestClient; private readonly ClientDiagnostics _softwareUpdateConfigurationMachineRunsClientDiagnostics; private readonly SoftwareUpdateConfigurationMachineRunsRestOperations _softwareUpdateConfigurationMachineRunsRestClient; - private readonly ClientDiagnostics _automationWebhookWebhookClientDiagnostics; - private readonly WebhookRestOperations _automationWebhookWebhookRestClient; + private readonly ClientDiagnostics _softwareUpdateConfigurationRunsClientDiagnostics; + private readonly SoftwareUpdateConfigurationRunsRestOperations _softwareUpdateConfigurationRunsRestClient; private readonly AutomationAccountData _data; /// Initializes a new instance of the class for mocking. @@ -99,6 +99,9 @@ internal AutomationAccountResource(ArmClient client, ResourceIdentifier id) : ba _dscCompilationJobStreamRestClient = new DscCompilationJobStreamRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _nodeCountInformationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); _nodeCountInformationRestClient = new NodeCountInformationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _automationWebhookWebhookClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", AutomationWebhookResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutomationWebhookResource.ResourceType, out string automationWebhookWebhookApiVersion); + _automationWebhookWebhookRestClient = new WebhookRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, automationWebhookWebhookApiVersion); _statisticsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); _statisticsRestClient = new StatisticsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _usagesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); @@ -111,13 +114,10 @@ internal AutomationAccountResource(ArmClient client, ResourceIdentifier id) : ba _objectDataTypesRestClient = new ObjectDataTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _defaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); _defaultRestClient = new AutomationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _softwareUpdateConfigurationRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _softwareUpdateConfigurationRunsRestClient = new SoftwareUpdateConfigurationRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _softwareUpdateConfigurationMachineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); _softwareUpdateConfigurationMachineRunsRestClient = new SoftwareUpdateConfigurationMachineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _automationWebhookWebhookClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", AutomationWebhookResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AutomationWebhookResource.ResourceType, out string automationWebhookWebhookApiVersion); - _automationWebhookWebhookRestClient = new WebhookRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, automationWebhookWebhookApiVersion); + _softwareUpdateConfigurationRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _softwareUpdateConfigurationRunsRestClient = new SoftwareUpdateConfigurationRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -184,80 +184,6 @@ public virtual Response GetAutomati return GetAutomationPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } - /// Gets a collection of AutomationAccountPython2PackageResources in the AutomationAccount. - /// An object representing collection of AutomationAccountPython2PackageResources and their operations over a AutomationAccountPython2PackageResource. - public virtual AutomationAccountPython2PackageCollection GetAutomationAccountPython2Packages() - { - return GetCachedClient(Client => new AutomationAccountPython2PackageCollection(Client, Id)); - } - - /// - /// Retrieve the python 2 package identified by package name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName} - /// Operation Id: Python2Package_Get - /// - /// The python package name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetAutomationAccountPython2PackageAsync(string packageName, CancellationToken cancellationToken = default) - { - return await GetAutomationAccountPython2Packages().GetAsync(packageName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieve the python 2 package identified by package name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName} - /// Operation Id: Python2Package_Get - /// - /// The python package name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetAutomationAccountPython2Package(string packageName, CancellationToken cancellationToken = default) - { - return GetAutomationAccountPython2Packages().Get(packageName, cancellationToken); - } - - /// Gets a collection of AutomationAccountModuleResources in the AutomationAccount. - /// An object representing collection of AutomationAccountModuleResources and their operations over a AutomationAccountModuleResource. - public virtual AutomationAccountModuleCollection GetAutomationAccountModules() - { - return GetCachedClient(Client => new AutomationAccountModuleCollection(Client, Id)); - } - - /// - /// Retrieve the module identified by module name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName} - /// Operation Id: Module_Get - /// - /// The module name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetAutomationAccountModuleAsync(string moduleName, CancellationToken cancellationToken = default) - { - return await GetAutomationAccountModules().GetAsync(moduleName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieve the module identified by module name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName} - /// Operation Id: Module_Get - /// - /// The module name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetAutomationAccountModule(string moduleName, CancellationToken cancellationToken = default) - { - return GetAutomationAccountModules().Get(moduleName, cancellationToken); - } - /// Gets a collection of DscNodeResources in the AutomationAccount. /// An object representing collection of DscNodeResources and their operations over a DscNodeResource. public virtual DscNodeCollection GetDscNodes() @@ -295,43 +221,6 @@ public virtual Response GetDscNode(string nodeId, CancellationT return GetDscNodes().Get(nodeId, cancellationToken); } - /// Gets a collection of DscNodeConfigurationResources in the AutomationAccount. - /// An object representing collection of DscNodeConfigurationResources and their operations over a DscNodeConfigurationResource. - public virtual DscNodeConfigurationCollection GetDscNodeConfigurations() - { - return GetCachedClient(Client => new DscNodeConfigurationCollection(Client, Id)); - } - - /// - /// Retrieve the Dsc node configurations by node configuration. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName} - /// Operation Id: DscNodeConfiguration_Get - /// - /// The Dsc node configuration name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetDscNodeConfigurationAsync(string nodeConfigurationName, CancellationToken cancellationToken = default) - { - return await GetDscNodeConfigurations().GetAsync(nodeConfigurationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieve the Dsc node configurations by node configuration. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName} - /// Operation Id: DscNodeConfiguration_Get - /// - /// The Dsc node configuration name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetDscNodeConfiguration(string nodeConfigurationName, CancellationToken cancellationToken = default) - { - return GetDscNodeConfigurations().Get(nodeConfigurationName, cancellationToken); - } - /// Gets a collection of DscCompilationJobResources in the AutomationAccount. /// An object representing collection of DscCompilationJobResources and their operations over a DscCompilationJobResource. public virtual DscCompilationJobCollection GetDscCompilationJobs() @@ -369,41 +258,117 @@ public virtual Response GetDscCompilationJob(string c return GetDscCompilationJobs().Get(compilationJobName, cancellationToken); } - /// Gets a collection of AutomationSourceControlResources in the AutomationAccount. - /// An object representing collection of AutomationSourceControlResources and their operations over a AutomationSourceControlResource. - public virtual AutomationSourceControlCollection GetAutomationSourceControls() + /// Gets a collection of AutomationWatcherResources in the AutomationAccount. + /// An object representing collection of AutomationWatcherResources and their operations over a AutomationWatcherResource. + public virtual AutomationWatcherCollection GetAutomationWatchers() { - return GetCachedClient(Client => new AutomationSourceControlCollection(Client, Id)); + return GetCachedClient(Client => new AutomationWatcherCollection(Client, Id)); } /// - /// Retrieve the source control identified by source control name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName} - /// Operation Id: SourceControl_Get + /// Retrieve the watcher identified by watcher name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName} + /// Operation Id: Watcher_Get /// - /// The name of source control. + /// The watcher name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationSourceControlAsync(string sourceControlName, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationWatcherAsync(string watcherName, CancellationToken cancellationToken = default) { - return await GetAutomationSourceControls().GetAsync(sourceControlName, cancellationToken).ConfigureAwait(false); + return await GetAutomationWatchers().GetAsync(watcherName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the source control identified by source control name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName} - /// Operation Id: SourceControl_Get + /// Retrieve the watcher identified by watcher name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName} + /// Operation Id: Watcher_Get /// - /// The name of source control. + /// The watcher name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationSourceControl(string sourceControlName, CancellationToken cancellationToken = default) + public virtual Response GetAutomationWatcher(string watcherName, CancellationToken cancellationToken = default) { - return GetAutomationSourceControls().Get(sourceControlName, cancellationToken); + return GetAutomationWatchers().Get(watcherName, cancellationToken); + } + + /// Gets a collection of SoftwareUpdateConfigurationResources in the AutomationAccount. + /// An object representing collection of SoftwareUpdateConfigurationResources and their operations over a SoftwareUpdateConfigurationResource. + public virtual SoftwareUpdateConfigurationCollection GetSoftwareUpdateConfigurations() + { + return GetCachedClient(Client => new SoftwareUpdateConfigurationCollection(Client, Id)); + } + + /// + /// Get a single software update configuration by name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName} + /// Operation Id: SoftwareUpdateConfigurations_GetByName + /// + /// The name of the software update configuration to be created. + /// Identifies this specific client request. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetSoftwareUpdateConfigurationAsync(string softwareUpdateConfigurationName, string clientRequestId = null, CancellationToken cancellationToken = default) + { + return await GetSoftwareUpdateConfigurations().GetAsync(softwareUpdateConfigurationName, clientRequestId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a single software update configuration by name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName} + /// Operation Id: SoftwareUpdateConfigurations_GetByName + /// + /// The name of the software update configuration to be created. + /// Identifies this specific client request. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetSoftwareUpdateConfiguration(string softwareUpdateConfigurationName, string clientRequestId = null, CancellationToken cancellationToken = default) + { + return GetSoftwareUpdateConfigurations().Get(softwareUpdateConfigurationName, clientRequestId, cancellationToken); + } + + /// Gets a collection of AutomationWebhookResources in the AutomationAccount. + /// An object representing collection of AutomationWebhookResources and their operations over a AutomationWebhookResource. + public virtual AutomationWebhookCollection GetAutomationWebhooks() + { + return GetCachedClient(Client => new AutomationWebhookCollection(Client, Id)); + } + + /// + /// Retrieve the webhook identified by webhook name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName} + /// Operation Id: Webhook_Get + /// + /// The webhook name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAutomationWebhookAsync(string webhookName, CancellationToken cancellationToken = default) + { + return await GetAutomationWebhooks().GetAsync(webhookName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the webhook identified by webhook name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName} + /// Operation Id: Webhook_Get + /// + /// The webhook name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAutomationWebhook(string webhookName, CancellationToken cancellationToken = default) + { + return GetAutomationWebhooks().Get(webhookName, cancellationToken); } /// Gets a collection of AutomationCertificateResources in the AutomationAccount. @@ -554,263 +519,298 @@ public virtual Response GetAutomationCredential(st return GetAutomationCredentials().Get(credentialName, cancellationToken); } - /// Gets a collection of AutomationJobScheduleResources in the AutomationAccount. - /// An object representing collection of AutomationJobScheduleResources and their operations over a AutomationJobScheduleResource. - public virtual AutomationJobScheduleCollection GetAutomationJobSchedules() + /// Gets a collection of DscConfigurationResources in the AutomationAccount. + /// An object representing collection of DscConfigurationResources and their operations over a DscConfigurationResource. + public virtual DscConfigurationCollection GetDscConfigurations() { - return GetCachedClient(Client => new AutomationJobScheduleCollection(Client, Id)); + return GetCachedClient(Client => new DscConfigurationCollection(Client, Id)); } /// - /// Retrieve the job schedule identified by job schedule name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId} - /// Operation Id: JobSchedule_Get + /// Retrieve the configuration identified by configuration name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName} + /// Operation Id: DscConfiguration_Get /// - /// The job schedule name. + /// The configuration name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationJobScheduleAsync(Guid jobScheduleId, CancellationToken cancellationToken = default) + public virtual async Task> GetDscConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { - return await GetAutomationJobSchedules().GetAsync(jobScheduleId, cancellationToken).ConfigureAwait(false); + return await GetDscConfigurations().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the job schedule identified by job schedule name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId} - /// Operation Id: JobSchedule_Get + /// Retrieve the configuration identified by configuration name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName} + /// Operation Id: DscConfiguration_Get /// - /// The job schedule name. + /// The configuration name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationJobSchedule(Guid jobScheduleId, CancellationToken cancellationToken = default) + public virtual Response GetDscConfiguration(string configurationName, CancellationToken cancellationToken = default) { - return GetAutomationJobSchedules().Get(jobScheduleId, cancellationToken); + return GetDscConfigurations().Get(configurationName, cancellationToken); } - /// Gets a collection of AutomationScheduleResources in the AutomationAccount. - /// An object representing collection of AutomationScheduleResources and their operations over a AutomationScheduleResource. - public virtual AutomationScheduleCollection GetAutomationSchedules() + /// Gets a collection of DscNodeConfigurationResources in the AutomationAccount. + /// An object representing collection of DscNodeConfigurationResources and their operations over a DscNodeConfigurationResource. + public virtual DscNodeConfigurationCollection GetDscNodeConfigurations() { - return GetCachedClient(Client => new AutomationScheduleCollection(Client, Id)); + return GetCachedClient(Client => new DscNodeConfigurationCollection(Client, Id)); } /// - /// Retrieve the schedule identified by schedule name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName} - /// Operation Id: Schedule_Get + /// Retrieve the Dsc node configurations by node configuration. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName} + /// Operation Id: DscNodeConfiguration_Get /// - /// The schedule name. + /// The Dsc node configuration name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationScheduleAsync(string scheduleName, CancellationToken cancellationToken = default) + public virtual async Task> GetDscNodeConfigurationAsync(string nodeConfigurationName, CancellationToken cancellationToken = default) { - return await GetAutomationSchedules().GetAsync(scheduleName, cancellationToken).ConfigureAwait(false); + return await GetDscNodeConfigurations().GetAsync(nodeConfigurationName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the schedule identified by schedule name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName} - /// Operation Id: Schedule_Get + /// Retrieve the Dsc node configurations by node configuration. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName} + /// Operation Id: DscNodeConfiguration_Get /// - /// The schedule name. + /// The Dsc node configuration name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationSchedule(string scheduleName, CancellationToken cancellationToken = default) + public virtual Response GetDscNodeConfiguration(string nodeConfigurationName, CancellationToken cancellationToken = default) { - return GetAutomationSchedules().Get(scheduleName, cancellationToken); + return GetDscNodeConfigurations().Get(nodeConfigurationName, cancellationToken); } - /// Gets a collection of AutomationVariableResources in the AutomationAccount. - /// An object representing collection of AutomationVariableResources and their operations over a AutomationVariableResource. - public virtual AutomationVariableCollection GetAutomationVariables() + /// Gets a collection of HybridRunbookWorkerGroupResources in the AutomationAccount. + /// An object representing collection of HybridRunbookWorkerGroupResources and their operations over a HybridRunbookWorkerGroupResource. + public virtual HybridRunbookWorkerGroupCollection GetHybridRunbookWorkerGroups() { - return GetCachedClient(Client => new AutomationVariableCollection(Client, Id)); + return GetCachedClient(Client => new HybridRunbookWorkerGroupCollection(Client, Id)); } /// - /// Retrieve the variable identified by variable name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName} - /// Operation Id: Variable_Get + /// Retrieve a hybrid runbook worker group. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName} + /// Operation Id: HybridRunbookWorkerGroup_Get /// - /// The name of variable. + /// The hybrid runbook worker group name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationVariableAsync(string variableName, CancellationToken cancellationToken = default) + public virtual async Task> GetHybridRunbookWorkerGroupAsync(string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default) { - return await GetAutomationVariables().GetAsync(variableName, cancellationToken).ConfigureAwait(false); + return await GetHybridRunbookWorkerGroups().GetAsync(hybridRunbookWorkerGroupName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the variable identified by variable name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName} - /// Operation Id: Variable_Get + /// Retrieve a hybrid runbook worker group. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName} + /// Operation Id: HybridRunbookWorkerGroup_Get /// - /// The name of variable. + /// The hybrid runbook worker group name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationVariable(string variableName, CancellationToken cancellationToken = default) + public virtual Response GetHybridRunbookWorkerGroup(string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default) { - return GetAutomationVariables().Get(variableName, cancellationToken); + return GetHybridRunbookWorkerGroups().Get(hybridRunbookWorkerGroupName, cancellationToken); } - /// Gets a collection of AutomationWatcherResources in the AutomationAccount. - /// An object representing collection of AutomationWatcherResources and their operations over a AutomationWatcherResource. - public virtual AutomationWatcherCollection GetAutomationWatchers() + /// Gets a collection of AutomationJobResources in the AutomationAccount. + /// An object representing collection of AutomationJobResources and their operations over a AutomationJobResource. + public virtual AutomationJobCollection GetAutomationJobs() { - return GetCachedClient(Client => new AutomationWatcherCollection(Client, Id)); + return GetCachedClient(Client => new AutomationJobCollection(Client, Id)); } /// - /// Retrieve the watcher identified by watcher name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName} - /// Operation Id: Watcher_Get + /// Retrieve the job identified by job name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName} + /// Operation Id: Job_Get /// - /// The watcher name. + /// The job name. + /// Identifies this specific client request. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationWatcherAsync(string watcherName, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationJobAsync(string jobName, string clientRequestId = null, CancellationToken cancellationToken = default) { - return await GetAutomationWatchers().GetAsync(watcherName, cancellationToken).ConfigureAwait(false); + return await GetAutomationJobs().GetAsync(jobName, clientRequestId, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the watcher identified by watcher name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName} - /// Operation Id: Watcher_Get + /// Retrieve the job identified by job name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName} + /// Operation Id: Job_Get /// - /// The watcher name. + /// The job name. + /// Identifies this specific client request. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationWatcher(string watcherName, CancellationToken cancellationToken = default) + public virtual Response GetAutomationJob(string jobName, string clientRequestId = null, CancellationToken cancellationToken = default) { - return GetAutomationWatchers().Get(watcherName, cancellationToken); + return GetAutomationJobs().Get(jobName, clientRequestId, cancellationToken); } - /// Gets a collection of DscConfigurationResources in the AutomationAccount. - /// An object representing collection of DscConfigurationResources and their operations over a DscConfigurationResource. - public virtual DscConfigurationCollection GetDscConfigurations() + /// Gets a collection of AutomationJobScheduleResources in the AutomationAccount. + /// An object representing collection of AutomationJobScheduleResources and their operations over a AutomationJobScheduleResource. + public virtual AutomationJobScheduleCollection GetAutomationJobSchedules() { - return GetCachedClient(Client => new DscConfigurationCollection(Client, Id)); + return GetCachedClient(Client => new AutomationJobScheduleCollection(Client, Id)); } /// - /// Retrieve the configuration identified by configuration name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName} - /// Operation Id: DscConfiguration_Get + /// Retrieve the job schedule identified by job schedule name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId} + /// Operation Id: JobSchedule_Get /// - /// The configuration name. + /// The job schedule name. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. [ForwardsClientCalls] - public virtual async Task> GetDscConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationJobScheduleAsync(Guid jobScheduleId, CancellationToken cancellationToken = default) { - return await GetDscConfigurations().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); + return await GetAutomationJobSchedules().GetAsync(jobScheduleId, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the configuration identified by configuration name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName} - /// Operation Id: DscConfiguration_Get + /// Retrieve the job schedule identified by job schedule name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId} + /// Operation Id: JobSchedule_Get /// - /// The configuration name. + /// The job schedule name. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. [ForwardsClientCalls] - public virtual Response GetDscConfiguration(string configurationName, CancellationToken cancellationToken = default) + public virtual Response GetAutomationJobSchedule(Guid jobScheduleId, CancellationToken cancellationToken = default) { - return GetDscConfigurations().Get(configurationName, cancellationToken); + return GetAutomationJobSchedules().Get(jobScheduleId, cancellationToken); } - /// Gets a collection of AutomationJobResources in the AutomationAccount. - /// An object representing collection of AutomationJobResources and their operations over a AutomationJobResource. - public virtual AutomationJobCollection GetAutomationJobs() + /// Gets a collection of AutomationAccountModuleResources in the AutomationAccount. + /// An object representing collection of AutomationAccountModuleResources and their operations over a AutomationAccountModuleResource. + public virtual AutomationAccountModuleCollection GetAutomationAccountModules() { - return GetCachedClient(Client => new AutomationJobCollection(Client, Id)); + return GetCachedClient(Client => new AutomationAccountModuleCollection(Client, Id)); } /// - /// Retrieve the job identified by job name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName} - /// Operation Id: Job_Get + /// Retrieve the module identified by module name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName} + /// Operation Id: Module_Get /// - /// The job name. - /// Identifies this specific client request. + /// The module name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationJobAsync(string jobName, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationAccountModuleAsync(string moduleName, CancellationToken cancellationToken = default) { - return await GetAutomationJobs().GetAsync(jobName, clientRequestId, cancellationToken).ConfigureAwait(false); + return await GetAutomationAccountModules().GetAsync(moduleName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the job identified by job name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName} - /// Operation Id: Job_Get + /// Retrieve the module identified by module name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName} + /// Operation Id: Module_Get /// - /// The job name. - /// Identifies this specific client request. + /// The module name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationJob(string jobName, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual Response GetAutomationAccountModule(string moduleName, CancellationToken cancellationToken = default) { - return GetAutomationJobs().Get(jobName, clientRequestId, cancellationToken); + return GetAutomationAccountModules().Get(moduleName, cancellationToken); } - /// Gets a collection of SoftwareUpdateConfigurationResources in the AutomationAccount. - /// An object representing collection of SoftwareUpdateConfigurationResources and their operations over a SoftwareUpdateConfigurationResource. - public virtual SoftwareUpdateConfigurationCollection GetSoftwareUpdateConfigurations() + /// Gets a collection of AutomationAccountPython2PackageResources in the AutomationAccount. + /// An object representing collection of AutomationAccountPython2PackageResources and their operations over a AutomationAccountPython2PackageResource. + public virtual AutomationAccountPython2PackageCollection GetAutomationAccountPython2Packages() { - return GetCachedClient(Client => new SoftwareUpdateConfigurationCollection(Client, Id)); + return GetCachedClient(Client => new AutomationAccountPython2PackageCollection(Client, Id)); } /// - /// Get a single software update configuration by name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName} - /// Operation Id: SoftwareUpdateConfigurations_GetByName + /// Retrieve the python 2 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName} + /// Operation Id: Python2Package_Get /// - /// The name of the software update configuration to be created. - /// Identifies this specific client request. + /// The python package name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetSoftwareUpdateConfigurationAsync(string softwareUpdateConfigurationName, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationAccountPython2PackageAsync(string packageName, CancellationToken cancellationToken = default) { - return await GetSoftwareUpdateConfigurations().GetAsync(softwareUpdateConfigurationName, clientRequestId, cancellationToken).ConfigureAwait(false); + return await GetAutomationAccountPython2Packages().GetAsync(packageName, cancellationToken).ConfigureAwait(false); } /// - /// Get a single software update configuration by name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName} - /// Operation Id: SoftwareUpdateConfigurations_GetByName + /// Retrieve the python 2 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName} + /// Operation Id: Python2Package_Get /// - /// The name of the software update configuration to be created. - /// Identifies this specific client request. + /// The python package name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetSoftwareUpdateConfiguration(string softwareUpdateConfigurationName, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual Response GetAutomationAccountPython2Package(string packageName, CancellationToken cancellationToken = default) { - return GetSoftwareUpdateConfigurations().Get(softwareUpdateConfigurationName, clientRequestId, cancellationToken); + return GetAutomationAccountPython2Packages().Get(packageName, cancellationToken); + } + + /// Gets a collection of AutomationAccountPython3PackageResources in the AutomationAccount. + /// An object representing collection of AutomationAccountPython3PackageResources and their operations over a AutomationAccountPython3PackageResource. + public virtual AutomationAccountPython3PackageCollection GetAutomationAccountPython3Packages() + { + return GetCachedClient(Client => new AutomationAccountPython3PackageCollection(Client, Id)); + } + + /// + /// Retrieve the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The python package name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAutomationAccountPython3PackageAsync(string packageName, CancellationToken cancellationToken = default) + { + return await GetAutomationAccountPython3Packages().GetAsync(packageName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the python 3 package identified by package name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName} + /// Operation Id: Python3Package_Get + /// + /// The python package name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAutomationAccountPython3Package(string packageName, CancellationToken cancellationToken = default) + { + return GetAutomationAccountPython3Packages().Get(packageName, cancellationToken); } /// Gets a collection of AutomationRunbookResources in the AutomationAccount. @@ -850,78 +850,115 @@ public virtual Response GetAutomationRunbook(string r return GetAutomationRunbooks().Get(runbookName, cancellationToken); } - /// Gets a collection of AutomationWebhookResources in the AutomationAccount. - /// An object representing collection of AutomationWebhookResources and their operations over a AutomationWebhookResource. - public virtual AutomationWebhookCollection GetAutomationWebhooks() + /// Gets a collection of AutomationScheduleResources in the AutomationAccount. + /// An object representing collection of AutomationScheduleResources and their operations over a AutomationScheduleResource. + public virtual AutomationScheduleCollection GetAutomationSchedules() { - return GetCachedClient(Client => new AutomationWebhookCollection(Client, Id)); + return GetCachedClient(Client => new AutomationScheduleCollection(Client, Id)); } /// - /// Retrieve the webhook identified by webhook name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName} - /// Operation Id: Webhook_Get + /// Retrieve the schedule identified by schedule name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName} + /// Operation Id: Schedule_Get /// - /// The webhook name. + /// The schedule name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetAutomationWebhookAsync(string webhookName, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationScheduleAsync(string scheduleName, CancellationToken cancellationToken = default) { - return await GetAutomationWebhooks().GetAsync(webhookName, cancellationToken).ConfigureAwait(false); + return await GetAutomationSchedules().GetAsync(scheduleName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the webhook identified by webhook name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName} - /// Operation Id: Webhook_Get + /// Retrieve the schedule identified by schedule name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName} + /// Operation Id: Schedule_Get /// - /// The webhook name. + /// The schedule name. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetAutomationWebhook(string webhookName, CancellationToken cancellationToken = default) + public virtual Response GetAutomationSchedule(string scheduleName, CancellationToken cancellationToken = default) { - return GetAutomationWebhooks().Get(webhookName, cancellationToken); + return GetAutomationSchedules().Get(scheduleName, cancellationToken); + } + + /// Gets a collection of AutomationSourceControlResources in the AutomationAccount. + /// An object representing collection of AutomationSourceControlResources and their operations over a AutomationSourceControlResource. + public virtual AutomationSourceControlCollection GetAutomationSourceControls() + { + return GetCachedClient(Client => new AutomationSourceControlCollection(Client, Id)); + } + + /// + /// Retrieve the source control identified by source control name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName} + /// Operation Id: SourceControl_Get + /// + /// The name of source control. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAutomationSourceControlAsync(string sourceControlName, CancellationToken cancellationToken = default) + { + return await GetAutomationSourceControls().GetAsync(sourceControlName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the source control identified by source control name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName} + /// Operation Id: SourceControl_Get + /// + /// The name of source control. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAutomationSourceControl(string sourceControlName, CancellationToken cancellationToken = default) + { + return GetAutomationSourceControls().Get(sourceControlName, cancellationToken); } - /// Gets a collection of HybridRunbookWorkerGroupResources in the AutomationAccount. - /// An object representing collection of HybridRunbookWorkerGroupResources and their operations over a HybridRunbookWorkerGroupResource. - public virtual HybridRunbookWorkerGroupCollection GetHybridRunbookWorkerGroups() + /// Gets a collection of AutomationVariableResources in the AutomationAccount. + /// An object representing collection of AutomationVariableResources and their operations over a AutomationVariableResource. + public virtual AutomationVariableCollection GetAutomationVariables() { - return GetCachedClient(Client => new HybridRunbookWorkerGroupCollection(Client, Id)); + return GetCachedClient(Client => new AutomationVariableCollection(Client, Id)); } /// - /// Retrieve a hybrid runbook worker group. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName} - /// Operation Id: HybridRunbookWorkerGroup_Get + /// Retrieve the variable identified by variable name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName} + /// Operation Id: Variable_Get /// - /// The hybrid runbook worker group name. + /// The name of variable. /// 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. + /// is null. [ForwardsClientCalls] - public virtual async Task> GetHybridRunbookWorkerGroupAsync(string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default) + public virtual async Task> GetAutomationVariableAsync(string variableName, CancellationToken cancellationToken = default) { - return await GetHybridRunbookWorkerGroups().GetAsync(hybridRunbookWorkerGroupName, cancellationToken).ConfigureAwait(false); + return await GetAutomationVariables().GetAsync(variableName, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve a hybrid runbook worker group. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName} - /// Operation Id: HybridRunbookWorkerGroup_Get + /// Retrieve the variable identified by variable name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName} + /// Operation Id: Variable_Get /// - /// The hybrid runbook worker group name. + /// The name of variable. /// 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. + /// is null. [ForwardsClientCalls] - public virtual Response GetHybridRunbookWorkerGroup(string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default) + public virtual Response GetAutomationVariable(string variableName, CancellationToken cancellationToken = default) { - return GetHybridRunbookWorkerGroups().Get(hybridRunbookWorkerGroupName, cancellationToken); + return GetAutomationVariables().Get(variableName, cancellationToken); } /// @@ -1394,6 +1431,50 @@ Page FirstPageFunc(int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, null); } + /// + /// Generates a Uri for use in creating a webhook. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri + /// Operation Id: Webhook_GenerateUri + /// + /// The cancellation token to use. + public virtual async Task> GenerateUriWebhookAsync(CancellationToken cancellationToken = default) + { + using var scope = _automationWebhookWebhookClientDiagnostics.CreateScope("AutomationAccountResource.GenerateUriWebhook"); + scope.Start(); + try + { + var response = await _automationWebhookWebhookRestClient.GenerateUriAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generates a Uri for use in creating a webhook. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri + /// Operation Id: Webhook_GenerateUri + /// + /// The cancellation token to use. + public virtual Response GenerateUriWebhook(CancellationToken cancellationToken = default) + { + using var scope = _automationWebhookWebhookClientDiagnostics.CreateScope("AutomationAccountResource.GenerateUriWebhook"); + scope.Start(); + try + { + var response = _automationWebhookWebhookRestClient.GenerateUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Retrieve the statistics for the account. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics @@ -1719,20 +1800,20 @@ public virtual Response ConvertGraphRunbookContent(Grap } /// - /// Get a single software update configuration Run by Id. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId} - /// Operation Id: SoftwareUpdateConfigurationRuns_GetById + /// Get a single software update configuration machine run by Id. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId} + /// Operation Id: SoftwareUpdateConfigurationMachineRuns_GetById /// - /// The Id of the software update configuration run. + /// The Id of the software update configuration machine run. /// Identifies this specific client request. /// The cancellation token to use. - public virtual async Task> GetSoftwareUpdateConfigurationRunAsync(Guid softwareUpdateConfigurationRunId, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual async Task> GetSoftwareUpdateConfigurationMachineRunAsync(Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = null, CancellationToken cancellationToken = default) { - using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRun"); + using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRun"); scope.Start(); try { - var response = await _softwareUpdateConfigurationRunsRestClient.GetByIdAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationRunId, clientRequestId, cancellationToken).ConfigureAwait(false); + var response = await _softwareUpdateConfigurationMachineRunsRestClient.GetByIdAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationMachineRunId, clientRequestId, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -1743,20 +1824,20 @@ public virtual async Task> GetSoftwareU } /// - /// Get a single software update configuration Run by Id. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId} - /// Operation Id: SoftwareUpdateConfigurationRuns_GetById + /// Get a single software update configuration machine run by Id. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId} + /// Operation Id: SoftwareUpdateConfigurationMachineRuns_GetById /// - /// The Id of the software update configuration run. + /// The Id of the software update configuration machine run. /// Identifies this specific client request. /// The cancellation token to use. - public virtual Response GetSoftwareUpdateConfigurationRun(Guid softwareUpdateConfigurationRunId, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual Response GetSoftwareUpdateConfigurationMachineRun(Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = null, CancellationToken cancellationToken = default) { - using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRun"); + using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRun"); scope.Start(); try { - var response = _softwareUpdateConfigurationRunsRestClient.GetById(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationRunId, clientRequestId, cancellationToken); + var response = _softwareUpdateConfigurationMachineRunsRestClient.GetById(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationMachineRunId, clientRequestId, cancellationToken); return response; } catch (Exception e) @@ -1767,25 +1848,25 @@ public virtual Response GetSoftwareUpdateConfigu } /// - /// Return list of software update configuration runs - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns - /// Operation Id: SoftwareUpdateConfigurationRuns_List + /// Return list of software update configuration machine runs + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns + /// Operation Id: SoftwareUpdateConfigurationMachineRuns_List /// /// Identifies this specific client request. /// The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'. - /// Number of entries you skip before returning results. + /// number of entries you skip before returning results. /// Maximum number of entries returned in the results collection. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSoftwareUpdateConfigurationRunsAsync(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSoftwareUpdateConfigurationMachineRunsAsync(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) { - async Task> FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRuns"); + using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRuns"); scope.Start(); try { - var response = await _softwareUpdateConfigurationRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _softwareUpdateConfigurationMachineRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -1798,25 +1879,25 @@ async Task> FirstPageFunc(int? pageSizeHint } /// - /// Return list of software update configuration runs - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns - /// Operation Id: SoftwareUpdateConfigurationRuns_List + /// Return list of software update configuration machine runs + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns + /// Operation Id: SoftwareUpdateConfigurationMachineRuns_List /// /// Identifies this specific client request. /// The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'. - /// Number of entries you skip before returning results. + /// number of entries you skip before returning results. /// Maximum number of entries returned in the results collection. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSoftwareUpdateConfigurationRuns(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSoftwareUpdateConfigurationMachineRuns(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) { - Page FirstPageFunc(int? pageSizeHint) + Page FirstPageFunc(int? pageSizeHint) { - using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRuns"); + using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRuns"); scope.Start(); try { - var response = _softwareUpdateConfigurationRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken); + var response = _softwareUpdateConfigurationMachineRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -1829,20 +1910,20 @@ Page FirstPageFunc(int? pageSizeHint) } /// - /// Get a single software update configuration machine run by Id. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId} - /// Operation Id: SoftwareUpdateConfigurationMachineRuns_GetById + /// Get a single software update configuration Run by Id. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId} + /// Operation Id: SoftwareUpdateConfigurationRuns_GetById /// - /// The Id of the software update configuration machine run. + /// The Id of the software update configuration run. /// Identifies this specific client request. /// The cancellation token to use. - public virtual async Task> GetSoftwareUpdateConfigurationMachineRunAsync(Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual async Task> GetSoftwareUpdateConfigurationRunAsync(Guid softwareUpdateConfigurationRunId, string clientRequestId = null, CancellationToken cancellationToken = default) { - using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRun"); + using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRun"); scope.Start(); try { - var response = await _softwareUpdateConfigurationMachineRunsRestClient.GetByIdAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationMachineRunId, clientRequestId, cancellationToken).ConfigureAwait(false); + var response = await _softwareUpdateConfigurationRunsRestClient.GetByIdAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationRunId, clientRequestId, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -1853,20 +1934,20 @@ public virtual async Task> GetSo } /// - /// Get a single software update configuration machine run by Id. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId} - /// Operation Id: SoftwareUpdateConfigurationMachineRuns_GetById + /// Get a single software update configuration Run by Id. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId} + /// Operation Id: SoftwareUpdateConfigurationRuns_GetById /// - /// The Id of the software update configuration machine run. + /// The Id of the software update configuration run. /// Identifies this specific client request. /// The cancellation token to use. - public virtual Response GetSoftwareUpdateConfigurationMachineRun(Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = null, CancellationToken cancellationToken = default) + public virtual Response GetSoftwareUpdateConfigurationRun(Guid softwareUpdateConfigurationRunId, string clientRequestId = null, CancellationToken cancellationToken = default) { - using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRun"); + using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRun"); scope.Start(); try { - var response = _softwareUpdateConfigurationMachineRunsRestClient.GetById(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationMachineRunId, clientRequestId, cancellationToken); + var response = _softwareUpdateConfigurationRunsRestClient.GetById(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, softwareUpdateConfigurationRunId, clientRequestId, cancellationToken); return response; } catch (Exception e) @@ -1877,25 +1958,25 @@ public virtual Response GetSoftwareUpdate } /// - /// Return list of software update configuration machine runs - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns - /// Operation Id: SoftwareUpdateConfigurationMachineRuns_List + /// Return list of software update configuration runs + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns + /// Operation Id: SoftwareUpdateConfigurationRuns_List /// /// Identifies this specific client request. /// The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'. - /// number of entries you skip before returning results. + /// Number of entries you skip before returning results. /// Maximum number of entries returned in the results collection. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSoftwareUpdateConfigurationMachineRunsAsync(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSoftwareUpdateConfigurationRunsAsync(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) { - async Task> FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRuns"); + using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRuns"); scope.Start(); try { - var response = await _softwareUpdateConfigurationMachineRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _softwareUpdateConfigurationRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -1908,25 +1989,25 @@ async Task> FirstPageFunc(int? pageS } /// - /// Return list of software update configuration machine runs - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns - /// Operation Id: SoftwareUpdateConfigurationMachineRuns_List + /// Return list of software update configuration runs + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns + /// Operation Id: SoftwareUpdateConfigurationRuns_List /// /// Identifies this specific client request. /// The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'. - /// number of entries you skip before returning results. + /// Number of entries you skip before returning results. /// Maximum number of entries returned in the results collection. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSoftwareUpdateConfigurationMachineRuns(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSoftwareUpdateConfigurationRuns(string clientRequestId = null, string filter = null, string skip = null, string top = null, CancellationToken cancellationToken = default) { - Page FirstPageFunc(int? pageSizeHint) + Page FirstPageFunc(int? pageSizeHint) { - using var scope = _softwareUpdateConfigurationMachineRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationMachineRuns"); + using var scope = _softwareUpdateConfigurationRunsClientDiagnostics.CreateScope("AutomationAccountResource.GetSoftwareUpdateConfigurationRuns"); scope.Start(); try { - var response = _softwareUpdateConfigurationMachineRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken); + var response = _softwareUpdateConfigurationRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, clientRequestId, filter, skip, top, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -1938,50 +2019,6 @@ Page FirstPageFunc(int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, null); } - /// - /// Generates a Uri for use in creating a webhook. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri - /// Operation Id: Webhook_GenerateUri - /// - /// The cancellation token to use. - public virtual async Task> GenerateUriWebhookAsync(CancellationToken cancellationToken = default) - { - using var scope = _automationWebhookWebhookClientDiagnostics.CreateScope("AutomationAccountResource.GenerateUriWebhook"); - scope.Start(); - try - { - var response = await _automationWebhookWebhookRestClient.GenerateUriAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Generates a Uri for use in creating a webhook. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri - /// Operation Id: Webhook_GenerateUri - /// - /// The cancellation token to use. - public virtual Response GenerateUriWebhook(CancellationToken cancellationToken = default) - { - using var scope = _automationWebhookWebhookClientDiagnostics.CreateScope("AutomationAccountResource.GenerateUriWebhook"); - scope.Start(); - try - { - var response = _automationWebhookWebhookRestClient.GenerateUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationRunbookResource.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationRunbookResource.cs index 1baace54d94c7..8a4b80427bdf3 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationRunbookResource.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationRunbookResource.cs @@ -303,7 +303,7 @@ public virtual Response GetContentRunbookDraft(CancellationToken cancell /// Operation Id: RunbookDraft_ReplaceContent /// /// 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 runbook draft content. + /// The runbook draft content. /// The cancellation token to use. /// is null. public virtual async Task ReplaceContentRunbookDraftAsync(WaitUntil waitUntil, Stream runbookContent, CancellationToken cancellationToken = default) @@ -315,7 +315,7 @@ public virtual async Task ReplaceContentRunbookDraftAsync(WaitUnti try { var response = await _runbookDraftRestClient.ReplaceContentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runbookContent, cancellationToken).ConfigureAwait(false); - var operation = new AutomationArmOperation(_runbookDraftClientDiagnostics, Pipeline, _runbookDraftRestClient.CreateReplaceContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runbookContent).Request, response, OperationFinalStateVia.Location); + var operation = new AutomationArmOperation(_runbookDraftClientDiagnostics, Pipeline, _runbookDraftRestClient.CreateReplaceContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runbookContent).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -333,7 +333,7 @@ public virtual async Task ReplaceContentRunbookDraftAsync(WaitUnti /// Operation Id: RunbookDraft_ReplaceContent /// /// 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 runbook draft content. + /// The runbook draft content. /// The cancellation token to use. /// is null. public virtual ArmOperation ReplaceContentRunbookDraft(WaitUntil waitUntil, Stream runbookContent, CancellationToken cancellationToken = default) @@ -345,7 +345,7 @@ public virtual ArmOperation ReplaceContentRunbookDraft(WaitUntil waitUntil, Stre try { var response = _runbookDraftRestClient.ReplaceContent(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runbookContent, cancellationToken); - var operation = new AutomationArmOperation(_runbookDraftClientDiagnostics, Pipeline, _runbookDraftRestClient.CreateReplaceContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runbookContent).Request, response, OperationFinalStateVia.Location); + var operation = new AutomationArmOperation(_runbookDraftClientDiagnostics, Pipeline, _runbookDraftRestClient.CreateReplaceContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, runbookContent).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs index 9d5f2c9411af0..d54b0721ac845 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs @@ -29,55 +29,55 @@ private static SubscriptionResourceExtensionClient GetExtensionClient(Subscripti } /// - /// Retrieve a list of accounts within a given subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts - /// Operation Id: AutomationAccount_List + /// Retrieve deleted automation account. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts + /// Operation Id: deletedAutomationAccounts_ListBySubscription /// /// The instance the method will execute against. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAutomationAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeletedAutomationAccountsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetAutomationAccountsAsync(cancellationToken); + return GetExtensionClient(subscriptionResource).GetDeletedAutomationAccountsBySubscriptionAsync(cancellationToken); } /// - /// Retrieve a list of accounts within a given subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts - /// Operation Id: AutomationAccount_List + /// Retrieve deleted automation account. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts + /// Operation Id: deletedAutomationAccounts_ListBySubscription /// /// The instance the method will execute against. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAutomationAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeletedAutomationAccountsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetAutomationAccounts(cancellationToken); + return GetExtensionClient(subscriptionResource).GetDeletedAutomationAccountsBySubscription(cancellationToken); } /// - /// Retrieve deleted automation account. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts - /// Operation Id: deletedAutomationAccounts_ListBySubscription + /// Retrieve a list of accounts within a given subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts + /// Operation Id: AutomationAccount_List /// /// The instance the method will execute against. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDeletedAutomationAccountsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetAutomationAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetDeletedAutomationAccountsBySubscriptionAsync(cancellationToken); + return GetExtensionClient(subscriptionResource).GetAutomationAccountsAsync(cancellationToken); } /// - /// Retrieve deleted automation account. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts - /// Operation Id: deletedAutomationAccounts_ListBySubscription + /// Retrieve a list of accounts within a given subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts + /// Operation Id: AutomationAccount_List /// /// The instance the method will execute against. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDeletedAutomationAccountsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetAutomationAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetDeletedAutomationAccountsBySubscription(cancellationToken); + return GetExtensionClient(subscriptionResource).GetAutomationAccounts(cancellationToken); } private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource) @@ -148,115 +148,96 @@ public static AutomationPrivateEndpointConnectionResource GetAutomationPrivateEn } #endregion - #region AutomationAccountPython2PackageResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationAccountPython2PackageResource GetAutomationAccountPython2PackageResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomationAccountPython2PackageResource.ValidateResourceId(id); - return new AutomationAccountPython2PackageResource(client, id); - } - ); - } - #endregion - - #region AutomationAccountModuleResource + #region DscNodeResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// 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 instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationAccountModuleResource GetAutomationAccountModuleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DscNodeResource GetDscNodeResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationAccountModuleResource.ValidateResourceId(id); - return new AutomationAccountModuleResource(client, id); + DscNodeResource.ValidateResourceId(id); + return new DscNodeResource(client, id); } ); } #endregion - #region DscNodeResource + #region DscCompilationJobResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static DscNodeResource GetDscNodeResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DscCompilationJobResource GetDscCompilationJobResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - DscNodeResource.ValidateResourceId(id); - return new DscNodeResource(client, id); + DscCompilationJobResource.ValidateResourceId(id); + return new DscCompilationJobResource(client, id); } ); } #endregion - #region DscNodeConfigurationResource + #region AutomationWatcherResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static DscNodeConfigurationResource GetDscNodeConfigurationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationWatcherResource GetAutomationWatcherResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - DscNodeConfigurationResource.ValidateResourceId(id); - return new DscNodeConfigurationResource(client, id); + AutomationWatcherResource.ValidateResourceId(id); + return new AutomationWatcherResource(client, id); } ); } #endregion - #region DscCompilationJobResource + #region SoftwareUpdateConfigurationResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static DscCompilationJobResource GetDscCompilationJobResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static SoftwareUpdateConfigurationResource GetSoftwareUpdateConfigurationResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - DscCompilationJobResource.ValidateResourceId(id); - return new DscCompilationJobResource(client, id); + SoftwareUpdateConfigurationResource.ValidateResourceId(id); + return new SoftwareUpdateConfigurationResource(client, id); } ); } #endregion - #region AutomationSourceControlResource + #region AutomationWebhookResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationSourceControlResource GetAutomationSourceControlResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationWebhookResource GetAutomationWebhookResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationSourceControlResource.ValidateResourceId(id); - return new AutomationSourceControlResource(client, id); + AutomationWebhookResource.ValidateResourceId(id); + return new AutomationWebhookResource(client, id); } ); } @@ -357,134 +338,172 @@ public static AutomationCredentialResource GetAutomationCredentialResource(this } #endregion - #region AutomationJobScheduleResource + #region DscConfigurationResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// 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 instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationJobScheduleResource GetAutomationJobScheduleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DscConfigurationResource GetDscConfigurationResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationJobScheduleResource.ValidateResourceId(id); - return new AutomationJobScheduleResource(client, id); + DscConfigurationResource.ValidateResourceId(id); + return new DscConfigurationResource(client, id); } ); } #endregion - #region AutomationScheduleResource + #region DscNodeConfigurationResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// 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 instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationScheduleResource GetAutomationScheduleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DscNodeConfigurationResource GetDscNodeConfigurationResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationScheduleResource.ValidateResourceId(id); - return new AutomationScheduleResource(client, id); + DscNodeConfigurationResource.ValidateResourceId(id); + return new DscNodeConfigurationResource(client, id); } ); } #endregion - #region AutomationVariableResource + #region HybridRunbookWorkerResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// 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 instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationVariableResource GetAutomationVariableResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static HybridRunbookWorkerResource GetHybridRunbookWorkerResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationVariableResource.ValidateResourceId(id); - return new AutomationVariableResource(client, id); + HybridRunbookWorkerResource.ValidateResourceId(id); + return new HybridRunbookWorkerResource(client, id); } ); } #endregion - #region AutomationWatcherResource + #region HybridRunbookWorkerGroupResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// 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 instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationWatcherResource GetAutomationWatcherResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static HybridRunbookWorkerGroupResource GetHybridRunbookWorkerGroupResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationWatcherResource.ValidateResourceId(id); - return new AutomationWatcherResource(client, id); + HybridRunbookWorkerGroupResource.ValidateResourceId(id); + return new HybridRunbookWorkerGroupResource(client, id); } ); } #endregion - #region DscConfigurationResource + #region AutomationJobResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static DscConfigurationResource GetDscConfigurationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationJobResource GetAutomationJobResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - DscConfigurationResource.ValidateResourceId(id); - return new DscConfigurationResource(client, id); + AutomationJobResource.ValidateResourceId(id); + return new AutomationJobResource(client, id); } ); } #endregion - #region AutomationJobResource + #region AutomationJobScheduleResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationJobResource GetAutomationJobResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationJobScheduleResource GetAutomationJobScheduleResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationJobResource.ValidateResourceId(id); - return new AutomationJobResource(client, id); + AutomationJobScheduleResource.ValidateResourceId(id); + return new AutomationJobScheduleResource(client, id); } ); } #endregion - #region SoftwareUpdateConfigurationResource + #region AutomationAccountModuleResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SoftwareUpdateConfigurationResource GetSoftwareUpdateConfigurationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationAccountModuleResource GetAutomationAccountModuleResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - SoftwareUpdateConfigurationResource.ValidateResourceId(id); - return new SoftwareUpdateConfigurationResource(client, id); + AutomationAccountModuleResource.ValidateResourceId(id); + return new AutomationAccountModuleResource(client, id); + } + ); + } + #endregion + + #region AutomationAccountPython2PackageResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomationAccountPython2PackageResource GetAutomationAccountPython2PackageResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + AutomationAccountPython2PackageResource.ValidateResourceId(id); + return new AutomationAccountPython2PackageResource(client, id); + } + ); + } + #endregion + + #region AutomationAccountPython3PackageResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomationAccountPython3PackageResource GetAutomationAccountPython3PackageResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + AutomationAccountPython3PackageResource.ValidateResourceId(id); + return new AutomationAccountPython3PackageResource(client, id); } ); } @@ -509,58 +528,58 @@ public static AutomationRunbookResource GetAutomationRunbookResource(this ArmCli } #endregion - #region AutomationWebhookResource + #region AutomationScheduleResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static AutomationWebhookResource GetAutomationWebhookResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationScheduleResource GetAutomationScheduleResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - AutomationWebhookResource.ValidateResourceId(id); - return new AutomationWebhookResource(client, id); + AutomationScheduleResource.ValidateResourceId(id); + return new AutomationScheduleResource(client, id); } ); } #endregion - #region HybridRunbookWorkerResource + #region AutomationSourceControlResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static HybridRunbookWorkerResource GetHybridRunbookWorkerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationSourceControlResource GetAutomationSourceControlResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - HybridRunbookWorkerResource.ValidateResourceId(id); - return new HybridRunbookWorkerResource(client, id); + AutomationSourceControlResource.ValidateResourceId(id); + return new AutomationSourceControlResource(client, id); } ); } #endregion - #region HybridRunbookWorkerGroupResource + #region AutomationVariableResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static HybridRunbookWorkerGroupResource GetHybridRunbookWorkerGroupResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AutomationVariableResource GetAutomationVariableResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - HybridRunbookWorkerGroupResource.ValidateResourceId(id); - return new HybridRunbookWorkerGroupResource(client, id); + AutomationVariableResource.ValidateResourceId(id); + return new AutomationVariableResource(client, id); } ); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 23bf1006f10e9..d2e395d581225 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -20,10 +20,10 @@ namespace Azure.ResourceManager.Automation /// A class to add extension methods to SubscriptionResource. internal partial class SubscriptionResourceExtensionClient : ArmResource { - private ClientDiagnostics _automationAccountClientDiagnostics; - private AutomationAccountRestOperations _automationAccountRestClient; private ClientDiagnostics _deletedAutomationAccountsClientDiagnostics; private DeletedAutomationAccountsRestOperations _deletedAutomationAccountsRestClient; + private ClientDiagnostics _automationAccountClientDiagnostics; + private AutomationAccountRestOperations _automationAccountRestClient; /// Initializes a new instance of the class for mocking. protected SubscriptionResourceExtensionClient() @@ -37,10 +37,10 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie { } - private ClientDiagnostics AutomationAccountClientDiagnostics => _automationAccountClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Automation", AutomationAccountResource.ResourceType.Namespace, Diagnostics); - private AutomationAccountRestOperations AutomationAccountRestClient => _automationAccountRestClient ??= new AutomationAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AutomationAccountResource.ResourceType)); private ClientDiagnostics deletedAutomationAccountsClientDiagnostics => _deletedAutomationAccountsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Automation", ProviderConstants.DefaultProviderNamespace, Diagnostics); private DeletedAutomationAccountsRestOperations deletedAutomationAccountsRestClient => _deletedAutomationAccountsRestClient ??= new DeletedAutomationAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics AutomationAccountClientDiagnostics => _automationAccountClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Automation", AutomationAccountResource.ResourceType.Namespace, Diagnostics); + private AutomationAccountRestOperations AutomationAccountRestClient => _automationAccountRestClient ??= new AutomationAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AutomationAccountResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -49,22 +49,22 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// Retrieve a list of accounts within a given subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts - /// Operation Id: AutomationAccount_List + /// Retrieve deleted automation account. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts + /// Operation Id: deletedAutomationAccounts_ListBySubscription /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAutomationAccountsAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDeletedAutomationAccountsBySubscriptionAsync(CancellationToken cancellationToken = default) { - async Task> FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = AutomationAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAutomationAccounts"); + using var scope = deletedAutomationAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDeletedAutomationAccountsBySubscription"); scope.Start(); try { - var response = await AutomationAccountRestClient.ListAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + var response = await deletedAutomationAccountsRestClient.ListBySubscriptionAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) { @@ -72,14 +72,26 @@ async Task> FirstPageFunc(int? pageSizeHint) throw; } } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Retrieve deleted automation account. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts + /// Operation Id: deletedAutomationAccounts_ListBySubscription + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDeletedAutomationAccountsBySubscription(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) { - using var scope = AutomationAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAutomationAccounts"); + using var scope = deletedAutomationAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDeletedAutomationAccountsBySubscription"); scope.Start(); try { - var response = await AutomationAccountRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + var response = deletedAutomationAccountsRestClient.ListBySubscription(Id.SubscriptionId, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) { @@ -87,7 +99,7 @@ async Task> NextPageFunc(string nextLink, int? p throw; } } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); } /// @@ -96,16 +108,16 @@ async Task> NextPageFunc(string nextLink, int? p /// Operation Id: AutomationAccount_List /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAutomationAccounts(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAutomationAccountsAsync(CancellationToken cancellationToken = default) { - Page FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { using var scope = AutomationAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAutomationAccounts"); scope.Start(); try { - var response = AutomationAccountRestClient.List(Id.SubscriptionId, cancellationToken: cancellationToken); + var response = await AutomationAccountRestClient.ListAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -114,13 +126,13 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - Page NextPageFunc(string nextLink, int? pageSizeHint) + async Task> NextPageFunc(string nextLink, int? pageSizeHint) { using var scope = AutomationAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAutomationAccounts"); scope.Start(); try { - var response = AutomationAccountRestClient.ListNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken); + var response = await AutomationAccountRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -129,26 +141,26 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) throw; } } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } /// - /// Retrieve deleted automation account. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts - /// Operation Id: deletedAutomationAccounts_ListBySubscription + /// Retrieve a list of accounts within a given subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts + /// Operation Id: AutomationAccount_List /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeletedAutomationAccountsBySubscriptionAsync(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAutomationAccounts(CancellationToken cancellationToken = default) { - async Task> FirstPageFunc(int? pageSizeHint) + Page FirstPageFunc(int? pageSizeHint) { - using var scope = deletedAutomationAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDeletedAutomationAccountsBySubscription"); + using var scope = AutomationAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAutomationAccounts"); scope.Start(); try { - var response = await deletedAutomationAccountsRestClient.ListBySubscriptionAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + var response = AutomationAccountRestClient.List(Id.SubscriptionId, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -156,26 +168,14 @@ async Task> FirstPageFunc(int? pageSizeHint) throw; } } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); - } - - /// - /// Retrieve deleted automation account. - /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts - /// Operation Id: deletedAutomationAccounts_ListBySubscription - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeletedAutomationAccountsBySubscription(CancellationToken cancellationToken = default) - { - Page FirstPageFunc(int? pageSizeHint) + Page NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = deletedAutomationAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDeletedAutomationAccountsBySubscription"); + using var scope = AutomationAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAutomationAccounts"); scope.Start(); try { - var response = deletedAutomationAccountsRestClient.ListBySubscription(Id.SubscriptionId, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + var response = AutomationAccountRestClient.ListNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AutomationAccountResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -183,7 +183,7 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } } } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationModuleData.Serialization.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationModuleData.Serialization.cs index 1e265cb538173..a0e84cbaabbc0 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationModuleData.Serialization.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationModuleData.Serialization.cs @@ -63,7 +63,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"); - writer.WriteStringValue(ProvisioningState.Value.ToSerialString()); + writer.WriteStringValue(ProvisioningState.Value.ToString()); } if (Optional.IsDefined(ContentLink)) { @@ -227,7 +227,7 @@ internal static AutomationModuleData DeserializeAutomationModuleData(JsonElement property0.ThrowNonNullablePropertyIsNull(); continue; } - provisioningState = property0.Value.GetString().ToModuleProvisioningState(); + provisioningState = new ModuleProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("contentLink")) diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.Serialization.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.Serialization.cs deleted file mode 100644 index 8f79681ca2ede..0000000000000 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.Automation.Models -{ - internal static partial class ModuleProvisioningStateExtensions - { - public static string ToSerialString(this ModuleProvisioningState value) => value switch - { - ModuleProvisioningState.Created => "Created", - ModuleProvisioningState.Creating => "Creating", - ModuleProvisioningState.StartingImportModuleRunbook => "StartingImportModuleRunbook", - ModuleProvisioningState.RunningImportModuleRunbook => "RunningImportModuleRunbook", - ModuleProvisioningState.ContentRetrieved => "ContentRetrieved", - ModuleProvisioningState.ContentDownloaded => "ContentDownloaded", - ModuleProvisioningState.ContentValidated => "ContentValidated", - ModuleProvisioningState.ConnectionTypeImported => "ConnectionTypeImported", - ModuleProvisioningState.ContentStored => "ContentStored", - ModuleProvisioningState.ModuleDataStored => "ModuleDataStored", - ModuleProvisioningState.ActivitiesStored => "ActivitiesStored", - ModuleProvisioningState.ModuleImportRunbookComplete => "ModuleImportRunbookComplete", - ModuleProvisioningState.Succeeded => "Succeeded", - ModuleProvisioningState.Failed => "Failed", - ModuleProvisioningState.Cancelled => "Cancelled", - ModuleProvisioningState.Updating => "Updating", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ModuleProvisioningState value.") - }; - - public static ModuleProvisioningState ToModuleProvisioningState(this string value) - { - if (string.Equals(value, "Created", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.Created; - if (string.Equals(value, "Creating", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.Creating; - if (string.Equals(value, "StartingImportModuleRunbook", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.StartingImportModuleRunbook; - if (string.Equals(value, "RunningImportModuleRunbook", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.RunningImportModuleRunbook; - if (string.Equals(value, "ContentRetrieved", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ContentRetrieved; - if (string.Equals(value, "ContentDownloaded", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ContentDownloaded; - if (string.Equals(value, "ContentValidated", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ContentValidated; - if (string.Equals(value, "ConnectionTypeImported", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ConnectionTypeImported; - if (string.Equals(value, "ContentStored", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ContentStored; - if (string.Equals(value, "ModuleDataStored", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ModuleDataStored; - if (string.Equals(value, "ActivitiesStored", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ActivitiesStored; - if (string.Equals(value, "ModuleImportRunbookComplete", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.ModuleImportRunbookComplete; - if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.Succeeded; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.Failed; - if (string.Equals(value, "Cancelled", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.Cancelled; - if (string.Equals(value, "Updating", StringComparison.InvariantCultureIgnoreCase)) return ModuleProvisioningState.Updating; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ModuleProvisioningState value."); - } - } -} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.cs index 630023c2ebd53..72dc334a5108c 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/ModuleProvisioningState.cs @@ -5,42 +5,89 @@ #nullable disable +using System; +using System.ComponentModel; + namespace Azure.ResourceManager.Automation.Models { /// Gets or sets the provisioning state of the module. - public enum ModuleProvisioningState + public readonly partial struct ModuleProvisioningState : IEquatable { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModuleProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedValue = "Created"; + private const string CreatingValue = "Creating"; + private const string StartingImportModuleRunbookValue = "StartingImportModuleRunbook"; + private const string RunningImportModuleRunbookValue = "RunningImportModuleRunbook"; + private const string ContentRetrievedValue = "ContentRetrieved"; + private const string ContentDownloadedValue = "ContentDownloaded"; + private const string ContentValidatedValue = "ContentValidated"; + private const string ConnectionTypeImportedValue = "ConnectionTypeImported"; + private const string ContentStoredValue = "ContentStored"; + private const string ModuleDataStoredValue = "ModuleDataStored"; + private const string ActivitiesStoredValue = "ActivitiesStored"; + private const string ModuleImportRunbookCompleteValue = "ModuleImportRunbookComplete"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string UpdatingValue = "Updating"; + /// Created. - Created, + public static ModuleProvisioningState Created { get; } = new ModuleProvisioningState(CreatedValue); /// Creating. - Creating, + public static ModuleProvisioningState Creating { get; } = new ModuleProvisioningState(CreatingValue); /// StartingImportModuleRunbook. - StartingImportModuleRunbook, + public static ModuleProvisioningState StartingImportModuleRunbook { get; } = new ModuleProvisioningState(StartingImportModuleRunbookValue); /// RunningImportModuleRunbook. - RunningImportModuleRunbook, + public static ModuleProvisioningState RunningImportModuleRunbook { get; } = new ModuleProvisioningState(RunningImportModuleRunbookValue); /// ContentRetrieved. - ContentRetrieved, + public static ModuleProvisioningState ContentRetrieved { get; } = new ModuleProvisioningState(ContentRetrievedValue); /// ContentDownloaded. - ContentDownloaded, + public static ModuleProvisioningState ContentDownloaded { get; } = new ModuleProvisioningState(ContentDownloadedValue); /// ContentValidated. - ContentValidated, + public static ModuleProvisioningState ContentValidated { get; } = new ModuleProvisioningState(ContentValidatedValue); /// ConnectionTypeImported. - ConnectionTypeImported, + public static ModuleProvisioningState ConnectionTypeImported { get; } = new ModuleProvisioningState(ConnectionTypeImportedValue); /// ContentStored. - ContentStored, + public static ModuleProvisioningState ContentStored { get; } = new ModuleProvisioningState(ContentStoredValue); /// ModuleDataStored. - ModuleDataStored, + public static ModuleProvisioningState ModuleDataStored { get; } = new ModuleProvisioningState(ModuleDataStoredValue); /// ActivitiesStored. - ActivitiesStored, + public static ModuleProvisioningState ActivitiesStored { get; } = new ModuleProvisioningState(ActivitiesStoredValue); /// ModuleImportRunbookComplete. - ModuleImportRunbookComplete, + public static ModuleProvisioningState ModuleImportRunbookComplete { get; } = new ModuleProvisioningState(ModuleImportRunbookCompleteValue); /// Succeeded. - Succeeded, + public static ModuleProvisioningState Succeeded { get; } = new ModuleProvisioningState(SucceededValue); /// Failed. - Failed, + public static ModuleProvisioningState Failed { get; } = new ModuleProvisioningState(FailedValue); /// Cancelled. - Cancelled, + public static ModuleProvisioningState Cancelled { get; } = new ModuleProvisioningState(CancelledValue); /// Updating. - Updating + public static ModuleProvisioningState Updating { get; } = new ModuleProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(ModuleProvisioningState left, ModuleProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModuleProvisioningState left, ModuleProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModuleProvisioningState(string value) => new ModuleProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModuleProvisioningState other && Equals(other); + /// + public bool Equals(ModuleProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackageCreateOrUpdateContent.Serialization.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageCreateParameters.Serialization.cs similarity index 91% rename from sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackageCreateOrUpdateContent.Serialization.cs rename to sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageCreateParameters.Serialization.cs index 5959994d939f1..59c7439fdb3e3 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackageCreateOrUpdateContent.Serialization.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageCreateParameters.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Automation.Models { - public partial class AutomationAccountPython2PackageCreateOrUpdateContent : IUtf8JsonSerializable + public partial class PythonPackageCreateParameters : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackageCreateOrUpdateContent.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageCreateParameters.cs similarity index 77% rename from sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackageCreateOrUpdateContent.cs rename to sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageCreateParameters.cs index d5b4e28384f16..1e69b06bd1205 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackageCreateOrUpdateContent.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageCreateParameters.cs @@ -12,12 +12,12 @@ namespace Azure.ResourceManager.Automation.Models { /// The parameters supplied to the create or update module operation. - public partial class AutomationAccountPython2PackageCreateOrUpdateContent + public partial class PythonPackageCreateParameters { - /// Initializes a new instance of AutomationAccountPython2PackageCreateOrUpdateContent. + /// Initializes a new instance of PythonPackageCreateParameters. /// Gets or sets the module content link. /// is null. - public AutomationAccountPython2PackageCreateOrUpdateContent(AutomationContentLink contentLink) + public PythonPackageCreateParameters(AutomationContentLink contentLink) { Argument.AssertNotNull(contentLink, nameof(contentLink)); diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackagePatch.Serialization.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageUpdateParameters.Serialization.cs similarity index 90% rename from sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackagePatch.Serialization.cs rename to sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageUpdateParameters.Serialization.cs index c69043e0a8a0b..6e5f4b7f2a88f 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackagePatch.Serialization.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageUpdateParameters.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Automation.Models { - public partial class AutomationAccountPython2PackagePatch : IUtf8JsonSerializable + public partial class PythonPackageUpdateParameters : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackagePatch.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageUpdateParameters.cs similarity index 72% rename from sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackagePatch.cs rename to sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageUpdateParameters.cs index 8e7e70b8feb30..580027aae8636 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/AutomationAccountPython2PackagePatch.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Models/PythonPackageUpdateParameters.cs @@ -11,10 +11,10 @@ namespace Azure.ResourceManager.Automation.Models { /// The parameters supplied to the update module operation. - public partial class AutomationAccountPython2PackagePatch + public partial class PythonPackageUpdateParameters { - /// Initializes a new instance of AutomationAccountPython2PackagePatch. - public AutomationAccountPython2PackagePatch() + /// Initializes a new instance of PythonPackageUpdateParameters. + public PythonPackageUpdateParameters() { Tags = new ChangeTrackingDictionary(); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ActivityRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ActivityRestOperations.cs index 730c4bf28060f..303efd19eb967 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ActivityRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ActivityRestOperations.cs @@ -33,7 +33,7 @@ public ActivityRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationAccountRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationAccountRestOperations.cs index fb8924576173d..7001db87d1da6 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationAccountRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationAccountRestOperations.cs @@ -33,7 +33,7 @@ public AutomationAccountRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationRestOperations.cs index 8bba8a024da1b..8b8bb7c4deeb5 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/AutomationRestOperations.cs @@ -33,7 +33,7 @@ public AutomationRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CertificateRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CertificateRestOperations.cs index 4c6fa807f5c51..7ee1dac579765 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CertificateRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CertificateRestOperations.cs @@ -33,7 +33,7 @@ public CertificateRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionRestOperations.cs index 9dac78844eae5..6c9d02d6a532f 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionRestOperations.cs @@ -33,7 +33,7 @@ public ConnectionRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionTypeRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionTypeRestOperations.cs index 61912b2814d9f..4a68e697b5c84 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionTypeRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ConnectionTypeRestOperations.cs @@ -33,7 +33,7 @@ public ConnectionTypeRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CredentialRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CredentialRestOperations.cs index 460f78381e05a..e56c4661a0a81 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CredentialRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/CredentialRestOperations.cs @@ -33,7 +33,7 @@ public CredentialRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscConfigurationRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscConfigurationRestOperations.cs index 2fb3243517f36..fd2290995107d 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscConfigurationRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscConfigurationRestOperations.cs @@ -34,7 +34,7 @@ public DscConfigurationRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscNodeConfigurationRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscNodeConfigurationRestOperations.cs index c3894607ede3a..0e95291a76e4e 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscNodeConfigurationRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/DscNodeConfigurationRestOperations.cs @@ -33,7 +33,7 @@ public DscNodeConfigurationRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/FieldsRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/FieldsRestOperations.cs index a44f3f999984e..4e63503ec3b7b 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/FieldsRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/FieldsRestOperations.cs @@ -33,7 +33,7 @@ public FieldsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkerGroupRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkerGroupRestOperations.cs index 6c696bc751526..046456e8dde1f 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkerGroupRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkerGroupRestOperations.cs @@ -33,7 +33,7 @@ public HybridRunbookWorkerGroupRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -247,6 +247,7 @@ public async Task> CreateAsync(string sub switch (message.Response.Status) { case 200: + case 201: { HybridRunbookWorkerGroupData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -280,6 +281,7 @@ public Response Create(string subscriptionId, stri switch (message.Response.Status) { case 200: + case 201: { HybridRunbookWorkerGroupData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkersRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkersRestOperations.cs index eea189dc3f5a3..837e8a68dc0ab 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkersRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/HybridRunbookWorkersRestOperations.cs @@ -33,7 +33,7 @@ public HybridRunbookWorkersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -265,6 +265,7 @@ public async Task> CreateAsync(string subscrip switch (message.Response.Status) { case 200: + case 201: { HybridRunbookWorkerData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -300,6 +301,7 @@ public Response Create(string subscriptionId, string re switch (message.Response.Status) { case 200: + case 201: { HybridRunbookWorkerData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobRestOperations.cs index 030001ee55f88..d60ff02ccbcd4 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobRestOperations.cs @@ -34,7 +34,7 @@ public JobRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoi { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobScheduleRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobScheduleRestOperations.cs index f5e1bbb64e46e..c4cc019dea924 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobScheduleRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobScheduleRestOperations.cs @@ -33,7 +33,7 @@ public JobScheduleRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobStreamRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobStreamRestOperations.cs index 31456023d2bc0..e25415de869e8 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobStreamRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/JobStreamRestOperations.cs @@ -33,7 +33,7 @@ public JobStreamRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/KeysRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/KeysRestOperations.cs index 7533178f3bfb6..ca6a4ecd4cb3c 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/KeysRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/KeysRestOperations.cs @@ -33,7 +33,7 @@ public KeysRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/LinkedWorkspaceRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/LinkedWorkspaceRestOperations.cs index e68393737e084..190972e1055f6 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/LinkedWorkspaceRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/LinkedWorkspaceRestOperations.cs @@ -33,7 +33,7 @@ public LinkedWorkspaceRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ModuleRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ModuleRestOperations.cs index b532922dbd85c..1a371a7a48041 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ModuleRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ModuleRestOperations.cs @@ -33,7 +33,7 @@ public ModuleRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ObjectDataTypesRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ObjectDataTypesRestOperations.cs index a9f1dcd1a258a..580548e8a7e29 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ObjectDataTypesRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ObjectDataTypesRestOperations.cs @@ -33,7 +33,7 @@ public ObjectDataTypesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python2PackageRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python2PackageRestOperations.cs index fa26d06f1a2a5..bdc8e861af293 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python2PackageRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python2PackageRestOperations.cs @@ -33,7 +33,7 @@ public Python2PackageRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -199,7 +199,7 @@ public Response Get(string subscriptionId, string resource } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, AutomationAccountPython2PackageCreateOrUpdateContent content) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -218,9 +218,9 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(pythonPackageCreateParameters); + request.Content = content; _userAgent.Apply(message); return message; } @@ -230,19 +230,19 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Name of an Azure Resource group. /// The name of the automation account. /// The name of python package. - /// The create or update parameters for python package. + /// The create or update parameters for python package. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, AutomationAccountPython2PackageCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, content); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageCreateParameters); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -264,19 +264,19 @@ public async Task> CreateOrUpdateAsync(string sub /// Name of an Azure Resource group. /// The name of the automation account. /// The name of python package. - /// The create or update parameters for python package. + /// The create or update parameters for python package. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, AutomationAccountPython2PackageCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, content); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageCreateParameters); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -293,7 +293,7 @@ public Response CreateOrUpdate(string subscriptionId, stri } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, AutomationAccountPython2PackagePatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageUpdateParameters pythonPackageUpdateParameters) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -313,7 +313,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch); + content.JsonWriter.WriteObjectValue(pythonPackageUpdateParameters); request.Content = content; _userAgent.Apply(message); return message; @@ -324,19 +324,19 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Name of an Azure Resource group. /// The name of the automation account. /// The name of python package. - /// The update parameters for python package. + /// The update parameters for python package. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, AutomationAccountPython2PackagePatch patch, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, patch); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageUpdateParameters); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -357,19 +357,19 @@ public async Task> UpdateAsync(string subscriptio /// Name of an Azure Resource group. /// The name of the automation account. /// The name of python package. - /// The update parameters for python package. + /// The update parameters for python package. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, AutomationAccountPython2PackagePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, patch); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageUpdateParameters); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python3PackageRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python3PackageRestOperations.cs new file mode 100644 index 0000000000000..a95c51b46db14 --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/Python3PackageRestOperations.cs @@ -0,0 +1,545 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Automation.Models; + +namespace Azure.ResourceManager.Automation +{ + internal partial class Python3PackageRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of Python3PackageRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public Python3PackageRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-08-08"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName) + { + 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.Automation/automationAccounts/", false); + uri.AppendPath(automationAccountName, true); + uri.AppendPath("/python3Packages/", false); + uri.AppendPath(packageName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete the python 3 package by name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The python package name. + /// 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 automationAccountName, string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, automationAccountName, packageName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete the python 3 package by name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The python package name. + /// 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 automationAccountName, string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, automationAccountName, packageName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName) + { + 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.Automation/automationAccounts/", false); + uri.AppendPath(automationAccountName, true); + uri.AppendPath("/python3Packages/", false); + uri.AppendPath(packageName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieve the python 3 package identified by package name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The python package name. + /// 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 automationAccountName, string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, automationAccountName, packageName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutomationModuleData.DeserializeAutomationModuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutomationModuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieve the python 3 package identified by package name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The python package name. + /// 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 automationAccountName, string packageName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, automationAccountName, packageName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutomationModuleData.DeserializeAutomationModuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutomationModuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + 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.Automation/automationAccounts/", false); + uri.AppendPath(automationAccountName, true); + uri.AppendPath("/python3Packages/", false); + uri.AppendPath(packageName, 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(pythonPackageCreateParameters); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or Update the python 3 package identified by package name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The name of python package. + /// The create or update parameters for python package. + /// 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 automationAccountName, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageCreateParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + AutomationModuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutomationModuleData.DeserializeAutomationModuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or Update the python 3 package identified by package name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The name of python package. + /// The create or update parameters for python package. + /// 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 automationAccountName, string packageName, PythonPackageCreateParameters pythonPackageCreateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + Argument.AssertNotNull(pythonPackageCreateParameters, nameof(pythonPackageCreateParameters)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageCreateParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + AutomationModuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutomationModuleData.DeserializeAutomationModuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string automationAccountName, string packageName, PythonPackageUpdateParameters pythonPackageUpdateParameters) + { + 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.Automation/automationAccounts/", false); + uri.AppendPath(automationAccountName, true); + uri.AppendPath("/python3Packages/", false); + uri.AppendPath(packageName, 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(pythonPackageUpdateParameters); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the python 3 package identified by package name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The name of python package. + /// The update parameters for python package. + /// 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 automationAccountName, string packageName, PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageUpdateParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutomationModuleData.DeserializeAutomationModuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the python 3 package identified by package name. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The name of python package. + /// The update parameters for python package. + /// 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 automationAccountName, string packageName, PythonPackageUpdateParameters pythonPackageUpdateParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + Argument.AssertNotNullOrEmpty(packageName, nameof(packageName)); + Argument.AssertNotNull(pythonPackageUpdateParameters, nameof(pythonPackageUpdateParameters)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, automationAccountName, packageName, pythonPackageUpdateParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutomationModuleData.DeserializeAutomationModuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByAutomationAccountRequest(string subscriptionId, string resourceGroupName, string automationAccountName) + { + 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.Automation/automationAccounts/", false); + uri.AppendPath(automationAccountName, true); + uri.AppendPath("/python3Packages", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieve a list of python 3 packages. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAutomationAccountAsync(string subscriptionId, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + + using var message = CreateListByAutomationAccountRequest(subscriptionId, resourceGroupName, automationAccountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutomationModuleListResult.DeserializeAutomationModuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieve a list of python 3 packages. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAutomationAccount(string subscriptionId, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + + using var message = CreateListByAutomationAccountRequest(subscriptionId, resourceGroupName, automationAccountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutomationModuleListResult.DeserializeAutomationModuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByAutomationAccountNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string automationAccountName) + { + 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; + } + + /// Retrieve a list of python 3 packages. + /// The URL to the next page of results. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAutomationAccountNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + + using var message = CreateListByAutomationAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, automationAccountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutomationModuleListResult.DeserializeAutomationModuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieve a list of python 3 packages. + /// The URL to the next page of results. + /// Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of an Azure Resource group. + /// The name of the automation account. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAutomationAccountNextPage(string nextLink, string subscriptionId, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(automationAccountName, nameof(automationAccountName)); + + using var message = CreateListByAutomationAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, automationAccountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutomationModuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutomationModuleListResult.DeserializeAutomationModuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookDraftRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookDraftRestOperations.cs index f929d0364bfeb..954a24759808e 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookDraftRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookDraftRestOperations.cs @@ -34,7 +34,7 @@ public RunbookDraftRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2018-06-30"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -151,7 +151,7 @@ internal HttpMessage CreateReplaceContentRequest(string subscriptionId, string r /// Name of an Azure Resource group. /// The name of the automation account. /// The runbook name. - /// The runbook draft content. + /// The runbook draft content. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -180,7 +180,7 @@ public async Task ReplaceContentAsync(string subscriptionId, string re /// Name of an Azure Resource group. /// The name of the automation account. /// The runbook name. - /// The runbook draft content. + /// The runbook draft content. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookRestOperations.cs index db97ed2c36b94..1fa09a3a4f89d 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/RunbookRestOperations.cs @@ -34,7 +34,7 @@ public RunbookRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2018-06-30"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ScheduleRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ScheduleRestOperations.cs index 039481b56683d..17ff94d7f7231 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ScheduleRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/ScheduleRestOperations.cs @@ -33,7 +33,7 @@ public ScheduleRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationMachineRunsRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationMachineRunsRestOperations.cs index 6dc01a377407f..21956d4467861 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationMachineRunsRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationMachineRunsRestOperations.cs @@ -33,7 +33,7 @@ public SoftwareUpdateConfigurationMachineRunsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationRunsRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationRunsRestOperations.cs index dcd6236076f2f..8e8becefbc8ed 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationRunsRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SoftwareUpdateConfigurationRunsRestOperations.cs @@ -33,7 +33,7 @@ public SoftwareUpdateConfigurationRunsRestOperations(HttpPipeline pipeline, stri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-06-01"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlRestOperations.cs index 4c088b7c4aca7..d57ca7c30663c 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlRestOperations.cs @@ -33,7 +33,7 @@ public SourceControlRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobRestOperations.cs index f61bf8c8d4455..6ece79e328d6a 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobRestOperations.cs @@ -33,7 +33,7 @@ public SourceControlSyncJobRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobStreamsRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobStreamsRestOperations.cs index d0155cca67511..2242d91bb2f68 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobStreamsRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/SourceControlSyncJobStreamsRestOperations.cs @@ -33,7 +33,7 @@ public SourceControlSyncJobStreamsRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/StatisticsRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/StatisticsRestOperations.cs index 0b19c3b3b5f9b..36170ebff8c89 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/StatisticsRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/StatisticsRestOperations.cs @@ -33,7 +33,7 @@ public StatisticsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobRestOperations.cs index e051e18faf2d9..7485b923df38b 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobRestOperations.cs @@ -33,7 +33,7 @@ public TestJobRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2018-06-30"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobStreamsRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobStreamsRestOperations.cs index 4f02c96457fd2..5d55334bd5970 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobStreamsRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/TestJobStreamsRestOperations.cs @@ -33,7 +33,7 @@ public TestJobStreamsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2018-06-30"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/UsagesRestOperations.cs index 6e617a03bf322..20e8d405b1da9 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/UsagesRestOperations.cs @@ -33,7 +33,7 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-22"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/VariableRestOperations.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/VariableRestOperations.cs index 070768c9cc0fd..c9e259d650597 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/VariableRestOperations.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/RestOperations/VariableRestOperations.cs @@ -33,7 +33,7 @@ public VariableRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-13-preview"; + _apiVersion = apiVersion ?? "2022-08-08"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md index c79a4d3ea372c..4e1cfd9f945ac 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md +++ b/sdk/automation/Azure.ResourceManager.Automation/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Automation namespace: Azure.ResourceManager.Automation -require: https://github.com/Azure/azure-rest-api-specs/blob/d1b0569d8adbd342a1111d6a69764d099f5f717c/specification/automation/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/automation/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true