From c860c84920d57b46028ae8badfa7ec44142057b5 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Fri, 20 Dec 2024 17:48:38 +0900 Subject: [PATCH] Update to use Gallery 2024-03-03 calls (#26864) * update readme * update readme * update with gallery 2024-03-03 version * changelog * suppress static analysis --- .../Generated/CommunityGalleriesOperations.cs | 2 +- ...CommunityGalleryImageVersionsOperations.cs | 4 +- .../CommunityGalleryImagesOperations.cs | 4 +- .../Generated/ComputeManagementClient.cs | 18 + .../Generated/GalleriesOperations.cs | 12 +- .../GalleryApplicationVersionsOperations.cs | 10 +- .../GalleryApplicationsOperations.cs | 10 +- .../GalleryImageVersionsOperations.cs | 10 +- .../Generated/GalleryImagesOperations.cs | 10 +- ...MAccessControlProfileVersionsOperations.cs | 1483 +++++++++++++++++ ...trolProfileVersionsOperationsExtensions.cs | 561 +++++++ ...leryInVMAccessControlProfilesOperations.cs | 1401 ++++++++++++++++ ...cessControlProfilesOperationsExtensions.cs | 485 ++++++ .../GallerySharingProfileOperations.cs | 2 +- .../Generated/IComputeManagementClient.cs | 15 + ...MAccessControlProfileVersionsOperations.cs | 342 ++++ ...leryInVMAccessControlProfilesOperations.cs | 298 ++++ .../ISoftDeletedResourceOperations.cs | 85 + .../Generated/Models/AccessControlRules.cs | 78 + .../Models/AccessControlRulesIdentity.cs | 100 ++ .../Models/AccessControlRulesMode.cs | 23 + .../Models/AccessControlRulesPrivilege.cs | 91 + .../Models/AccessControlRulesRole.cs | 80 + .../AccessControlRulesRoleAssignment.cs | 83 + .../Generated/Models/AdditionalReplicaSet.cs | 67 + .../Generated/Models/CommunityGallery.cs | 3 + .../Generated/Models/CommunityGalleryImage.cs | 3 + .../Models/CommunityGalleryImageVersion.cs | 3 + .../Generated/Models/DataDisk.cs | 16 +- .../Generated/Models/EndpointAccess.cs | 22 + .../Generated/Models/EndpointTypes.cs | 60 + .../Generated/Models/ExecutedValidation.cs | 84 + .../Generated/Models/Gallery.cs | 11 +- .../GalleryApplicationScriptRebootBehavior.cs | 22 + ...leryApplicationVersionPublishingProfile.cs | 2 +- .../GalleryArtifactPublishingProfileBase.cs | 4 +- .../Generated/Models/GalleryIdentity.cs | 99 ++ .../Generated/Models/GalleryImage.cs | 12 +- .../Generated/Models/GalleryImageFeature.cs | 12 +- .../Generated/Models/GalleryImageUpdate.cs | 12 +- .../Generated/Models/GalleryImageVersion.cs | 18 +- .../GalleryImageVersionPublishingProfile.cs | 2 +- .../GalleryImageVersionSafetyProfile.cs | 13 +- .../Models/GalleryImageVersionUpdate.cs | 18 +- .../Models/GalleryInVMAccessControlProfile.cs | 74 + ...lleryInVMAccessControlProfileProperties.cs | 97 ++ .../GalleryInVMAccessControlProfileUpdate.cs | 72 + .../GalleryInVMAccessControlProfileVersion.cs | 168 ++ ...ryInVMAccessControlProfileVersionUpdate.cs | 166 ++ ...cessControlProfileVersionsDeleteHeaders.cs | 57 + ...yInVMAccessControlProfilesDeleteHeaders.cs | 57 + .../GalleryResourceProfilePropertiesBase.cs | 56 + ...eryResourceProfileVersionPropertiesBase.cs | 97 ++ .../Models/GallerySoftDeletedResource.cs | 93 ++ .../Generated/Models/GalleryUpdate.cs | 11 +- .../Generated/Models/PlatformAttribute.cs | 63 + .../Models/SoftDeletedArtifactTypes.cs | 21 + .../Generated/Models/StorageAccountType.cs | 1 + .../Generated/Models/TargetRegion.cs | 18 +- .../Generated/Models/UserArtifactSettings.cs | 15 +- .../Generated/Models/ValidationStatus.cs | 23 + .../Generated/Models/ValidationsProfile.cs | 70 + .../SdkInfo_ComputeManagementClient.cs | 27 +- .../Generated/SharedGalleriesOperations.cs | 4 +- .../SharedGalleryImageVersionsOperations.cs | 4 +- .../SharedGalleryImagesOperations.cs | 4 +- .../SoftDeletedResourceOperations.cs | 463 +++++ ...SoftDeletedResourceOperationsExtensions.cs | 117 ++ src/Compute/Compute.Management.Sdk/README.md | 10 +- src/Compute/Compute/ChangeLog.md | 1 + .../Az.Compute/GeneratedSdkIssues.csv | 1 + 71 files changed, 7400 insertions(+), 80 deletions(-) create mode 100644 src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs create mode 100644 src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs index 2d5604917a42..e20a04fada55 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs @@ -94,7 +94,7 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs index dbb7c6faec9d..73b93e0dc28b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs @@ -111,7 +111,7 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -316,7 +316,7 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs index b351d5f6557f..854f3f1fde2a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs @@ -101,7 +101,7 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +297,7 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs b/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs index ff91e22a1463..6b4e8d26fd54 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs @@ -253,11 +253,26 @@ public partial class ComputeManagementClient : ServiceClient public virtual IGalleryApplicationVersionsOperations GalleryApplicationVersions { get; private set; } + /// + /// Gets the ISoftDeletedResourceOperations. + /// + public virtual ISoftDeletedResourceOperations SoftDeletedResource { get; private set; } + /// /// Gets the IGallerySharingProfileOperations. /// public virtual IGallerySharingProfileOperations GallerySharingProfile { get; private set; } + /// + /// Gets the IGalleryInVMAccessControlProfilesOperations. + /// + public virtual IGalleryInVMAccessControlProfilesOperations GalleryInVMAccessControlProfiles { get; private set; } + + /// + /// Gets the IGalleryInVMAccessControlProfileVersionsOperations. + /// + public virtual IGalleryInVMAccessControlProfileVersionsOperations GalleryInVMAccessControlProfileVersions { get; private set; } + /// /// Gets the ISharedGalleriesOperations. /// @@ -591,7 +606,10 @@ private void Initialize() GalleryImageVersions = new GalleryImageVersionsOperations(this); GalleryApplications = new GalleryApplicationsOperations(this); GalleryApplicationVersions = new GalleryApplicationVersionsOperations(this); + SoftDeletedResource = new SoftDeletedResourceOperations(this); GallerySharingProfile = new GallerySharingProfileOperations(this); + GalleryInVMAccessControlProfiles = new GalleryInVMAccessControlProfilesOperations(this); + GalleryInVMAccessControlProfileVersions = new GalleryInVMAccessControlProfileVersionsOperations(this); SharedGalleries = new SharedGalleriesOperations(this); SharedGalleryImages = new SharedGalleryImagesOperations(this); SharedGalleryImageVersions = new SharedGalleryImageVersionsOperations(this); diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs index 85d2a88b5b81..59c092e9ae77 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs @@ -156,7 +156,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -375,7 +375,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -553,7 +553,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -756,7 +756,7 @@ internal GalleriesOperations(ComputeManagementClient client) { gallery.Validate(); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1002,7 +1002,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gallery"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1200,7 +1200,7 @@ internal GalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs index 212e89b9e444..ee7e7ec246e5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs @@ -187,7 +187,7 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersionName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -429,7 +429,7 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -656,7 +656,7 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) { galleryApplicationVersion.Validate(); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -923,7 +923,7 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersion"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1141,7 +1141,7 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersionName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs index 1c59dcd791e7..fc6ea8946278 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs @@ -164,7 +164,7 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -387,7 +387,7 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -602,7 +602,7 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) { galleryApplication.Validate(); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -858,7 +858,7 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplication"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1066,7 +1066,7 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs index eb314e79b5c2..b078d9845244 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs @@ -184,7 +184,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -424,7 +424,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -650,7 +650,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { galleryImageVersion.Validate(); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -916,7 +916,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersion"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1133,7 +1133,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs index e2a7e87078c8..38db24826519 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs @@ -164,7 +164,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -387,7 +387,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -602,7 +602,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { galleryImage.Validate(); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -858,7 +858,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImage"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1066,7 +1066,7 @@ internal GalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs new file mode 100644 index 000000000000..1a555bcd14de --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs @@ -0,0 +1,1483 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GalleryInVMAccessControlProfileVersionsOperations operations. + /// + internal partial class GalleryInVMAccessControlProfileVersionsOperations : IServiceOperations, IGalleryInVMAccessControlProfileVersionsOperations + { + /// + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be created. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be updated. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (inVMAccessControlProfileVersionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile from which the + /// inVMAccessControlProfile versions are to be listed. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (galleryName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(galleryName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "galleryName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (inVMAccessControlProfileName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(inVMAccessControlProfileName, "^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "inVMAccessControlProfileName", "^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$"); + } + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryInVMAccessControlProfile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be created. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (galleryName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(galleryName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "galleryName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (inVMAccessControlProfileName != null) + { + if (inVMAccessControlProfileName.Length > 80) + { + throw new ValidationException(ValidationRules.MaxLength, "inVMAccessControlProfileName", 80); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(inVMAccessControlProfileName, "^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "inVMAccessControlProfileName", "^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$"); + } + } + if (inVMAccessControlProfileVersionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); + } + if (inVMAccessControlProfileVersionName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(inVMAccessControlProfileVersionName, "^[0-9]+\\.[0-9]+\\.[0-9]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "inVMAccessControlProfileVersionName", "^[0-9]+\\.[0-9]+\\.[0-9]+$"); + } + } + if (galleryInVMAccessControlProfileVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfileVersion"); + } + if (galleryInVMAccessControlProfileVersion != null) + { + galleryInVMAccessControlProfileVersion.Validate(); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("galleryInVMAccessControlProfileVersion", galleryInVMAccessControlProfileVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(galleryInVMAccessControlProfileVersion != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfileVersion, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be updated. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (inVMAccessControlProfileVersionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); + } + if (galleryInVMAccessControlProfileVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfileVersion"); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("galleryInVMAccessControlProfileVersion", galleryInVMAccessControlProfileVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(galleryInVMAccessControlProfileVersion != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfileVersion, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be deleted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (inVMAccessControlProfileVersionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryInVMAccessControlProfileNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs new file mode 100644 index 000000000000..df01f29541ad --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs @@ -0,0 +1,561 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for GalleryInVMAccessControlProfileVersionsOperations. + /// + public static partial class GalleryInVMAccessControlProfileVersionsOperationsExtensions + { + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be created. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + public static GalleryInVMAccessControlProfileVersion CreateOrUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion) + { + return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } + + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be created. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be updated. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. + /// + public static GalleryInVMAccessControlProfileVersion Update(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion) + { + return operations.UpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } + + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be updated. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves information about a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersion Get(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + { + return operations.GetAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves information about a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be deleted. + /// + public static GalleryInVMAccessControlProfileVersionsDeleteHeaders Delete(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + { + return operations.DeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + } + + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile from which the + /// inVMAccessControlProfile versions are to be listed. + /// + public static IPage ListByGalleryInVMAccessControlProfile(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return operations.ListByGalleryInVMAccessControlProfileAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } + + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile from which the + /// inVMAccessControlProfile versions are to be listed. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByGalleryInVMAccessControlProfileAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be created. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + public static GalleryInVMAccessControlProfileVersion BeginCreateOrUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } + + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be created. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be updated. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. + /// + public static GalleryInVMAccessControlProfileVersion BeginUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion) + { + return operations.BeginUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } + + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be updated. + /// Needs to follow semantic version name pattern: The allowed characters are + /// digit and period. Digits must be within the range of a 32-bit integer. + /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be deleted. + /// + public static GalleryInVMAccessControlProfileVersionsDeleteHeaders BeginDelete(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + { + return operations.BeginDeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + } + + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the inVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByGalleryInVMAccessControlProfileNext(this IGalleryInVMAccessControlProfileVersionsOperations operations, string nextPageLink) + { + return operations.ListByGalleryInVMAccessControlProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByGalleryInVMAccessControlProfileNextAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs new file mode 100644 index 000000000000..8722633aefe5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs @@ -0,0 +1,1401 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GalleryInVMAccessControlProfilesOperations operations. + /// + internal partial class GalleryInVMAccessControlProfilesOperations : IServiceOperations, IGalleryInVMAccessControlProfilesOperations + { + /// + /// Initializes a new instance of the GalleryInVMAccessControlProfilesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or updated. + /// The allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The allowed + /// characters are alphabets and numbers with dots, dashes, and periods allowed + /// in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the InVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be listed. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (galleryName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(galleryName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "galleryName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or updated. + /// The allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (galleryName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(galleryName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "galleryName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (inVMAccessControlProfileName != null) + { + if (inVMAccessControlProfileName.Length > 80) + { + throw new ValidationException(ValidationRules.MaxLength, "inVMAccessControlProfileName", 80); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(inVMAccessControlProfileName, "^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "inVMAccessControlProfileName", "^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$"); + } + } + if (galleryInVMAccessControlProfile == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfile"); + } + if (galleryInVMAccessControlProfile != null) + { + galleryInVMAccessControlProfile.Validate(); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("galleryInVMAccessControlProfile", galleryInVMAccessControlProfile); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(galleryInVMAccessControlProfile != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfile, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The allowed + /// characters are alphabets and numbers with dots, dashes, and periods allowed + /// in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + if (galleryInVMAccessControlProfile == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfile"); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("galleryInVMAccessControlProfile", galleryInVMAccessControlProfile); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(galleryInVMAccessControlProfile != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfile, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the InVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (inVMAccessControlProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs new file mode 100644 index 000000000000..9f7ea5ca7c73 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs @@ -0,0 +1,485 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for GalleryInVMAccessControlProfilesOperations. + /// + public static partial class GalleryInVMAccessControlProfilesOperationsExtensions + { + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or updated. + /// The allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + public static GalleryInVMAccessControlProfile CreateOrUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile) + { + return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } + + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or updated. + /// The allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The allowed + /// characters are alphabets and numbers with dots, dashes, and periods allowed + /// in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + public static GalleryInVMAccessControlProfile Update(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile) + { + return operations.UpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } + + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The allowed + /// characters are alphabets and numbers with dots, dashes, and periods allowed + /// in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfile Get(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return operations.GetAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the InVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + public static GalleryInVMAccessControlProfilesDeleteHeaders Delete(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return operations.DeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } + + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the InVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be listed. + /// + public static IPage ListByGallery(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName) + { + return operations.ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + } + + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be listed. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByGalleryAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or updated. + /// The allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + public static GalleryInVMAccessControlProfile BeginCreateOrUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } + + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or updated. + /// The allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The allowed + /// characters are alphabets and numbers with dots, dashes, and periods allowed + /// in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + public static GalleryInVMAccessControlProfile BeginUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile) + { + return operations.BeginUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } + + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the InVMAccessControlProfile + /// is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The allowed + /// characters are alphabets and numbers with dots, dashes, and periods allowed + /// in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the InVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + public static GalleryInVMAccessControlProfilesDeleteHeaders BeginDelete(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return operations.BeginDeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } + + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the InVMAccessControlProfile + /// resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByGalleryNext(this IGalleryInVMAccessControlProfilesOperations operations, string nextPageLink) + { + return operations.ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByGalleryNextAsync(this IGalleryInVMAccessControlProfilesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs index 116cfdf1f4c3..dd123b1cd1ea 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs @@ -130,7 +130,7 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) { sharingUpdate.Validate(); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs b/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs index dfd4c6b8f49e..7b6c6e90675e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs @@ -250,11 +250,26 @@ public partial interface IComputeManagementClient : System.IDisposable /// IGalleryApplicationVersionsOperations GalleryApplicationVersions { get; } + /// + /// Gets the ISoftDeletedResourceOperations. + /// + ISoftDeletedResourceOperations SoftDeletedResource { get; } + /// /// Gets the IGallerySharingProfileOperations. /// IGallerySharingProfileOperations GallerySharingProfile { get; } + /// + /// Gets the IGalleryInVMAccessControlProfilesOperations. + /// + IGalleryInVMAccessControlProfilesOperations GalleryInVMAccessControlProfiles { get; } + + /// + /// Gets the IGalleryInVMAccessControlProfileVersionsOperations. + /// + IGalleryInVMAccessControlProfileVersionsOperations GalleryInVMAccessControlProfileVersions { get; } + /// /// Gets the ISharedGalleriesOperations. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs new file mode 100644 index 000000000000..e3ea52c15f12 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs @@ -0,0 +1,342 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GalleryInVMAccessControlProfileVersionsOperations operations. + /// + public partial interface IGalleryInVMAccessControlProfileVersionsOperations + { + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// created. Needs to follow semantic version name pattern: The allowed + /// characters are digit and period. Digits must be within the range of + /// a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// updated. Needs to follow semantic version name pattern: The allowed + /// characters are digit and period. Digits must be within the range of + /// a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// version operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves information about a gallery inVMAccessControlProfile + /// version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// retrieved. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile from which the + /// inVMAccessControlProfile versions are to be listed. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// created. Needs to follow semantic version name pattern: The allowed + /// characters are digit and period. Digits must be within the range of + /// a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile version operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// updated. Needs to follow semantic version name pattern: The allowed + /// characters are digit and period. Digits must be within the range of + /// a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// version operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// inVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile in which the + /// inVMAccessControlProfile version resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be + /// deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs new file mode 100644 index 000000000000..6acd3124c4cf --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs @@ -0,0 +1,298 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GalleryInVMAccessControlProfilesOperations operations. + /// + public partial interface IGalleryInVMAccessControlProfilesOperations + { + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// InVMAccessControlProfile is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or + /// updated. The allowed characters are alphabets and numbers with + /// dots, dashes, and periods allowed in the middle. The maximum length + /// is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// InVMAccessControlProfile is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The + /// allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the + /// InVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery from which the + /// InVMAccessControlProfiles are to be listed. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// InVMAccessControlProfile is to be created. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be created or + /// updated. The allowed characters are alphabets and numbers with + /// dots, dashes, and periods allowed in the middle. The maximum length + /// is 80 characters. + /// + /// + /// Parameters supplied to the create or update gallery + /// inVMAccessControlProfile operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Shared Image Gallery in which the + /// InVMAccessControlProfile is to be updated. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be updated. The + /// allowed characters are alphabets and numbers with dots, dashes, and + /// periods allowed in the middle. The maximum length is 80 characters. + /// + /// + /// Parameters supplied to the update gallery inVMAccessControlProfile + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The name of the resource group. + /// + /// + /// he name of the Shared Image Gallery in which the + /// InVMAccessControlProfile resides. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs new file mode 100644 index 000000000000..70603beb4450 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SoftDeletedResourceOperations operations. + /// + public partial interface ISoftDeletedResourceOperations + { + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Gallery in which the soft-deleted resources + /// resides. + /// + /// + /// The type of the artifact to be listed, such as gallery image + /// version. + /// + /// + /// The artifact name to be listed. If artifact type is Images, then + /// the artifact name should be the gallery image name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByArtifactNameWithHttpMessagesAsync(string resourceGroupName, string galleryName, string artifactType, string artifactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByArtifactNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs new file mode 100644 index 000000000000..9f46cd045c90 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This is the Access Control Rules specification for an + /// inVMAccessControlProfile version. + /// + public partial class AccessControlRules + { + /// + /// Initializes a new instance of the AccessControlRules class. + /// + public AccessControlRules() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccessControlRules class. + /// + /// A list of privileges. + /// A list of roles. + /// A list of identities. + /// A list of role assignments. + public AccessControlRules(IList privileges = default(IList), IList roles = default(IList), IList identities = default(IList), IList roleAssignments = default(IList)) + { + Privileges = privileges; + Roles = roles; + Identities = identities; + RoleAssignments = roleAssignments; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of privileges. + /// + [JsonProperty(PropertyName = "privileges")] + public IList Privileges { get; set; } + + /// + /// Gets or sets a list of roles. + /// + [JsonProperty(PropertyName = "roles")] + public IList Roles { get; set; } + + /// + /// Gets or sets a list of identities. + /// + [JsonProperty(PropertyName = "identities")] + public IList Identities { get; set; } + + /// + /// Gets or sets a list of role assignments. + /// + [JsonProperty(PropertyName = "roleAssignments")] + public IList RoleAssignments { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs new file mode 100644 index 000000000000..01551d5604d3 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties of an Access Control Rule Identity. + /// + public partial class AccessControlRulesIdentity + { + /// + /// Initializes a new instance of the AccessControlRulesIdentity class. + /// + public AccessControlRulesIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccessControlRulesIdentity class. + /// + /// The name of the identity. + /// The username corresponding to this + /// identity. + /// The groupName corresponding to this + /// identity. + /// The path to the executable. + /// The process name of the + /// executable. + public AccessControlRulesIdentity(string name, string userName = default(string), string groupName = default(string), string exePath = default(string), string processName = default(string)) + { + Name = name; + UserName = userName; + GroupName = groupName; + ExePath = exePath; + ProcessName = processName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the identity. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the username corresponding to this identity. + /// + [JsonProperty(PropertyName = "userName")] + public string UserName { get; set; } + + /// + /// Gets or sets the groupName corresponding to this identity. + /// + [JsonProperty(PropertyName = "groupName")] + public string GroupName { get; set; } + + /// + /// Gets or sets the path to the executable. + /// + [JsonProperty(PropertyName = "exePath")] + public string ExePath { get; set; } + + /// + /// Gets or sets the process name of the executable. + /// + [JsonProperty(PropertyName = "processName")] + public string ProcessName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs new file mode 100644 index 000000000000..7e99baa50e9c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for AccessControlRulesMode. + /// + public static class AccessControlRulesMode + { + public const string Audit = "Audit"; + public const string Enforce = "Enforce"; + public const string Disabled = "Disabled"; + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs new file mode 100644 index 000000000000..6f695cd360c5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of an Access Control Rule Privilege. + /// + public partial class AccessControlRulesPrivilege + { + /// + /// Initializes a new instance of the AccessControlRulesPrivilege + /// class. + /// + public AccessControlRulesPrivilege() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccessControlRulesPrivilege + /// class. + /// + /// The name of the privilege. + /// The HTTP path corresponding to the + /// privilege. + /// The query parameters to match in the + /// path. + public AccessControlRulesPrivilege(string name, string path, IDictionary queryParameters = default(IDictionary)) + { + Name = name; + Path = path; + QueryParameters = queryParameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the privilege. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the HTTP path corresponding to the privilege. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets the query parameters to match in the path. + /// + [JsonProperty(PropertyName = "queryParameters")] + public IDictionary QueryParameters { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Path == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Path"); + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs new file mode 100644 index 000000000000..98de0923adf7 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of an Access Control Rule Role. + /// + public partial class AccessControlRulesRole + { + /// + /// Initializes a new instance of the AccessControlRulesRole class. + /// + public AccessControlRulesRole() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccessControlRulesRole class. + /// + /// The name of the role. + /// A list of privileges needed by this + /// role. + public AccessControlRulesRole(string name, IList privileges) + { + Name = name; + Privileges = privileges; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the role. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets a list of privileges needed by this role. + /// + [JsonProperty(PropertyName = "privileges")] + public IList Privileges { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Privileges == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Privileges"); + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs new file mode 100644 index 000000000000..e689af996134 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of an Access Control Rule RoleAssignment. + /// + public partial class AccessControlRulesRoleAssignment + { + /// + /// Initializes a new instance of the AccessControlRulesRoleAssignment + /// class. + /// + public AccessControlRulesRoleAssignment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccessControlRulesRoleAssignment + /// class. + /// + /// The name of the role. + /// A list of identities that can access the + /// privileges defined by the role. + public AccessControlRulesRoleAssignment(string role, IList identities) + { + Role = role; + Identities = identities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the role. + /// + [JsonProperty(PropertyName = "role")] + public string Role { get; set; } + + /// + /// Gets or sets a list of identities that can access the privileges + /// defined by the role. + /// + [JsonProperty(PropertyName = "identities")] + public IList Identities { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Role == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Role"); + } + if (Identities == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Identities"); + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs new file mode 100644 index 000000000000..7a30e10ee5d8 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the additional replica set information. + /// + public partial class AdditionalReplicaSet + { + /// + /// Initializes a new instance of the AdditionalReplicaSet class. + /// + public AdditionalReplicaSet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdditionalReplicaSet class. + /// + /// Specifies the storage account type + /// to be used to create the direct drive replicas. Possible values + /// include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', + /// 'PremiumV2_LRS' + /// The number of direct drive + /// replicas of the Image Version to be created.This Property is + /// updatable + public AdditionalReplicaSet(string storageAccountType = default(string), int? regionalReplicaCount = default(int?)) + { + StorageAccountType = storageAccountType; + RegionalReplicaCount = regionalReplicaCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the storage account type to be used to + /// create the direct drive replicas. Possible values include: + /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' + /// + [JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType { get; set; } + + /// + /// Gets or sets the number of direct drive replicas of the Image + /// Version to be created.This Property is updatable + /// + [JsonProperty(PropertyName = "regionalReplicaCount")] + public int? RegionalReplicaCount { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs index b01ec2d9700b..e08e305d5bd6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs @@ -40,6 +40,8 @@ public CommunityGallery() /// Resource type /// The unique id of this community /// gallery. + /// The disclaimer for a community gallery + /// resource. public CommunityGallery(string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string), string disclaimer = default(string), IDictionary artifactTags = default(IDictionary), CommunityGalleryMetadata communityMetadata = default(CommunityGalleryMetadata)) : base(name, location, type, uniqueId) { @@ -55,6 +57,7 @@ public CommunityGallery() partial void CustomInit(); /// + /// Gets or sets the disclaimer for a community gallery resource. /// [JsonProperty(PropertyName = "properties.disclaimer")] public string Disclaimer { get; set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs index 33aff0081db2..7d5160916759 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs @@ -61,6 +61,8 @@ public CommunityGalleryImage() /// current community gallery image. /// The end-user license agreement for the current /// community gallery image. + /// The disclaimer for a community gallery + /// resource. public CommunityGalleryImage(OperatingSystemTypes osType, OperatingSystemStateTypes osState, CommunityGalleryImageIdentifier identifier, string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), string hyperVGeneration = default(string), IList features = default(IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string architecture = default(string), string privacyStatementUri = default(string), string eula = default(string), string disclaimer = default(string), IDictionary artifactTags = default(IDictionary)) : base(name, location, type, uniqueId) { @@ -166,6 +168,7 @@ public CommunityGalleryImage() public string Eula { get; set; } /// + /// Gets or sets the disclaimer for a community gallery resource. /// [JsonProperty(PropertyName = "properties.disclaimer")] public string Disclaimer { get; set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs index b73285bd1f51..bc15e894dec9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs @@ -53,6 +53,8 @@ public CommunityGalleryImageVersion() /// this Image Version. /// Describes the storage profile of the /// image version. + /// The disclaimer for a community gallery + /// resource. public CommunityGalleryImageVersion(string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), string disclaimer = default(string), IDictionary artifactTags = default(IDictionary)) : base(name, location, type, uniqueId) { @@ -101,6 +103,7 @@ public CommunityGalleryImageVersion() public SharedGalleryImageVersionStorageProfile StorageProfile { get; set; } /// + /// Gets or sets the disclaimer for a community gallery resource. /// [JsonProperty(PropertyName = "properties.disclaimer")] public string Disclaimer { get; set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs index 4f34a610d299..f671c70659f5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs @@ -90,10 +90,9 @@ public DataDisk() /// virtual machine and the disk is still not released then use /// force-detach as a last resort option to detach the disk forcibly /// from the VM. All writes might not have been flushed when using this - /// detach behavior. **This feature is still in preview** mode and is - /// not supported for VirtualMachineScaleSet. To force-detach a data - /// disk update toBeDetached to 'true' along with setting detachOption: - /// 'ForceDetach'. Possible values include: 'ForceDetach' + /// detach behavior. To force-detach a data disk update toBeDetached to + /// 'true' along with setting detachOption: 'ForceDetach'. Possible + /// values include: 'ForceDetach' /// Specifies whether data disk should be /// deleted or detached upon VM deletion. Possible values are: /// **Delete.** If this value is used, the data disk is deleted when VM @@ -245,11 +244,10 @@ public DataDisk() /// complete due to an unexpected failure from the virtual machine and /// the disk is still not released then use force-detach as a last /// resort option to detach the disk forcibly from the VM. All writes - /// might not have been flushed when using this detach behavior. **This - /// feature is still in preview** mode and is not supported for - /// VirtualMachineScaleSet. To force-detach a data disk update - /// toBeDetached to 'true' along with setting detachOption: - /// 'ForceDetach'. Possible values include: 'ForceDetach' + /// might not have been flushed when using this detach behavior. To + /// force-detach a data disk update toBeDetached to 'true' along with + /// setting detachOption: 'ForceDetach'. Possible values include: + /// 'ForceDetach' /// [JsonProperty(PropertyName = "detachOption")] public string DetachOption { get; set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs new file mode 100644 index 000000000000..6f528df5b888 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for EndpointAccess. + /// + public static class EndpointAccess + { + public const string Allow = "Allow"; + public const string Deny = "Deny"; + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs new file mode 100644 index 000000000000..61dfa2c01f7b --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for EndpointTypes. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EndpointTypes + { + [EnumMember(Value = "WireServer")] + WireServer, + [EnumMember(Value = "IMDS")] + IMDS + } + internal static class EndpointTypesEnumExtension + { + internal static string ToSerializedValue(this EndpointTypes? value) + { + return value == null ? null : ((EndpointTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this EndpointTypes value) + { + switch( value ) + { + case EndpointTypes.WireServer: + return "WireServer"; + case EndpointTypes.IMDS: + return "IMDS"; + } + return null; + } + + internal static EndpointTypes? ParseEndpointTypes(this string value) + { + switch( value ) + { + case "WireServer": + return EndpointTypes.WireServer; + case "IMDS": + return EndpointTypes.IMDS; + } + return null; + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs new file mode 100644 index 000000000000..f2cd02d20c0c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This is the executed Validation. + /// + public partial class ExecutedValidation + { + /// + /// Initializes a new instance of the ExecutedValidation class. + /// + public ExecutedValidation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExecutedValidation class. + /// + /// This property specifies the type of image + /// version validation. + /// This property specifies the status of the + /// validationProfile of the image version. Possible values include: + /// 'Unknown', 'Failed', 'Succeeded' + /// This property specifies the valid version of + /// the validation. + /// This property specifies the starting + /// timestamp. + public ExecutedValidation(string type = default(string), string status = default(string), string version = default(string), System.DateTime? executionTime = default(System.DateTime?)) + { + Type = type; + Status = status; + Version = version; + ExecutionTime = executionTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this property specifies the type of image version + /// validation. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets this property specifies the status of the + /// validationProfile of the image version. Possible values include: + /// 'Unknown', 'Failed', 'Succeeded' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets this property specifies the valid version of the + /// validation. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + /// + /// Gets or sets this property specifies the starting timestamp. + /// + [JsonProperty(PropertyName = "executionTime")] + public System.DateTime? ExecutionTime { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs index daa223602611..6483ca440a22 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs @@ -45,7 +45,9 @@ public Gallery() /// Possible values include: /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', /// 'Migrating' - public Gallery(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus)) + /// The identity of the gallery, if + /// configured. + public Gallery(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus), GalleryIdentity identity = default(GalleryIdentity)) : base(location, id, name, type, tags) { Description = description; @@ -54,6 +56,7 @@ public Gallery() SharingProfile = sharingProfile; SoftDeletePolicy = softDeletePolicy; SharingStatus = sharingStatus; + Identity = identity; CustomInit(); } @@ -96,6 +99,12 @@ public Gallery() [JsonProperty(PropertyName = "properties.sharingStatus")] public SharingStatus SharingStatus { get; private set; } + /// + /// Gets or sets the identity of the gallery, if configured. + /// + [JsonProperty(PropertyName = "identity")] + public GalleryIdentity Identity { get; set; } + /// /// Validate the object. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs new file mode 100644 index 000000000000..667f51db5418 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for GalleryApplicationScriptRebootBehavior. + /// + public static class GalleryApplicationScriptRebootBehavior + { + public const string None = "None"; + public const string Rerun = "Rerun"; + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs index 25a5c2bc6b8e..8280cb4a15a6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs @@ -52,7 +52,7 @@ public GalleryApplicationVersionPublishingProfile() /// Specifies the storage account type /// to be used to store the image. This property is not updatable. /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS' + /// 'Premium_LRS', 'PremiumV2_LRS' /// Optional parameter which specifies /// the mode to be used for replication. This property is not /// updatable. Possible values include: 'Full', 'Shallow' diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs index c9c643e788df..ccf200f27d37 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs @@ -51,7 +51,7 @@ public GalleryArtifactPublishingProfileBase() /// Specifies the storage account type /// to be used to store the image. This property is not updatable. /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS' + /// 'Premium_LRS', 'PremiumV2_LRS' /// Optional parameter which specifies /// the mode to be used for replication. This property is not /// updatable. Possible values include: 'Full', 'Shallow' @@ -117,7 +117,7 @@ public GalleryArtifactPublishingProfileBase() /// /// Gets or sets specifies the storage account type to be used to store /// the image. This property is not updatable. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS' + /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' /// [JsonProperty(PropertyName = "storageAccountType")] public string StorageAccountType { get; set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs new file mode 100644 index 000000000000..4e8a274ce67c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Identity for the virtual machine. + /// + public partial class GalleryIdentity + { + /// + /// Initializes a new instance of the GalleryIdentity class. + /// + public GalleryIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryIdentity class. + /// + /// The principal id of the gallery identity. + /// This property will only be provided for a system assigned + /// identity. + /// The AAD tenant id of the gallery identity. + /// This property will only be provided for a system assigned + /// identity. + /// The type of identity used for the gallery. The + /// type 'SystemAssigned, UserAssigned' includes both an implicitly + /// created identity and a set of user assigned identities. The type + /// 'None' will remove all identities from the gallery. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// The list of user identities + /// associated with the gallery. The user identity dictionary key + /// references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public GalleryIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of the gallery identity. This property will + /// only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the AAD tenant id of the gallery identity. This property will + /// only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the type of identity used for the gallery. The type + /// 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' + /// will remove all identities from the gallery. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with the + /// gallery. The user identity dictionary key references will be ARM + /// resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs index 88dd23809e6f..3db4f7692672 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs @@ -67,7 +67,9 @@ public GalleryImage() /// A list of gallery image features. /// Possible values include: 'x64', /// 'Arm64' - public GalleryImage(string location, OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList), string architecture = default(string)) + /// Optional. Must be set to true if the + /// gallery image features are being updated. + public GalleryImage(string location, OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList), string architecture = default(string), bool? allowUpdateImage = default(bool?)) : base(location, id, name, type, tags) { Description = description; @@ -85,6 +87,7 @@ public GalleryImage() ProvisioningState = provisioningState; Features = features; Architecture = architecture; + AllowUpdateImage = allowUpdateImage; CustomInit(); } @@ -190,6 +193,13 @@ public GalleryImage() [JsonProperty(PropertyName = "properties.architecture")] public string Architecture { get; set; } + /// + /// Gets or sets optional. Must be set to true if the gallery image + /// features are being updated. + /// + [JsonProperty(PropertyName = "properties.allowUpdateImage")] + public bool? AllowUpdateImage { get; set; } + /// /// Validate the object. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs index 2aa52c29b60b..f1f011aa24f5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs @@ -31,10 +31,13 @@ public GalleryImageFeature() /// /// The name of the gallery image feature. /// The value of the gallery image feature. - public GalleryImageFeature(string name = default(string), string value = default(string)) + /// The minimum gallery image version + /// which supports this feature. + public GalleryImageFeature(string name = default(string), string value = default(string), string startsAtVersion = default(string)) { Name = name; Value = value; + StartsAtVersion = startsAtVersion; CustomInit(); } @@ -55,5 +58,12 @@ public GalleryImageFeature() [JsonProperty(PropertyName = "value")] public string Value { get; set; } + /// + /// Gets or sets the minimum gallery image version which supports this + /// feature. + /// + [JsonProperty(PropertyName = "startsAtVersion")] + public string StartsAtVersion { get; set; } + } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs index 595307cdcee6..80d3507fb961 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs @@ -66,7 +66,9 @@ public GalleryImageUpdate() /// A list of gallery image features. /// Possible values include: 'x64', /// 'Arm64' - public GalleryImageUpdate(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList), string architecture = default(string)) + /// Optional. Must be set to true if the + /// gallery image features are being updated. + public GalleryImageUpdate(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList), string architecture = default(string), bool? allowUpdateImage = default(bool?)) : base(id, name, type, tags) { Description = description; @@ -84,6 +86,7 @@ public GalleryImageUpdate() ProvisioningState = provisioningState; Features = features; Architecture = architecture; + AllowUpdateImage = allowUpdateImage; CustomInit(); } @@ -189,6 +192,13 @@ public GalleryImageUpdate() [JsonProperty(PropertyName = "properties.architecture")] public string Architecture { get; set; } + /// + /// Gets or sets optional. Must be set to true if the gallery image + /// features are being updated. + /// + [JsonProperty(PropertyName = "properties.allowUpdateImage")] + public bool? AllowUpdateImage { get; set; } + /// /// Validate the object. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs index bff5033af078..714b7e85275b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs @@ -43,7 +43,9 @@ public GalleryImageVersion() /// Possible values include: /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', /// 'Migrating' - public GalleryImageVersion(string location, GalleryImageVersionStorageProfile storageProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile)) + /// Indicates if this is a soft-delete resource + /// restoration request. + public GalleryImageVersion(string location, GalleryImageVersionStorageProfile storageProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?), ValidationsProfile validationsProfile = default(ValidationsProfile)) : base(location, id, name, type, tags) { PublishingProfile = publishingProfile; @@ -52,6 +54,8 @@ public GalleryImageVersion() SafetyProfile = safetyProfile; ReplicationStatus = replicationStatus; SecurityProfile = securityProfile; + Restore = restore; + ValidationsProfile = validationsProfile; CustomInit(); } @@ -92,6 +96,18 @@ public GalleryImageVersion() [JsonProperty(PropertyName = "properties.securityProfile")] public ImageVersionSecurityProfile SecurityProfile { get; set; } + /// + /// Gets or sets indicates if this is a soft-delete resource + /// restoration request. + /// + [JsonProperty(PropertyName = "properties.restore")] + public bool? Restore { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.validationsProfile")] + public ValidationsProfile ValidationsProfile { get; private set; } + /// /// Validate the object. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs index b7eb7ddf28eb..10c152139749 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs @@ -50,7 +50,7 @@ public GalleryImageVersionPublishingProfile() /// Specifies the storage account type /// to be used to store the image. This property is not updatable. /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS' + /// 'Premium_LRS', 'PremiumV2_LRS' /// Optional parameter which specifies /// the mode to be used for replication. This property is not /// updatable. Possible values include: 'Full', 'Shallow' diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs index c4dc2a6f2812..0cd96307a815 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs @@ -40,11 +40,15 @@ public GalleryImageVersionSafetyProfile() /// image has been reported as violating Microsoft's policies. /// A list of Policy Violations that /// have been reported for this Gallery Image Version. - public GalleryImageVersionSafetyProfile(bool? allowDeletionOfReplicatedLocations = default(bool?), bool? reportedForPolicyViolation = default(bool?), IList policyViolations = default(IList)) + /// Indicates whether or not + /// the deletion is blocked for this Gallery Image Version if its End + /// Of Life has not expired. + public GalleryImageVersionSafetyProfile(bool? allowDeletionOfReplicatedLocations = default(bool?), bool? reportedForPolicyViolation = default(bool?), IList policyViolations = default(IList), bool? blockDeletionBeforeEndOfLife = default(bool?)) : base(allowDeletionOfReplicatedLocations) { ReportedForPolicyViolation = reportedForPolicyViolation; PolicyViolations = policyViolations; + BlockDeletionBeforeEndOfLife = blockDeletionBeforeEndOfLife; CustomInit(); } @@ -67,5 +71,12 @@ public GalleryImageVersionSafetyProfile() [JsonProperty(PropertyName = "policyViolations")] public IList PolicyViolations { get; private set; } + /// + /// Gets or sets indicates whether or not the deletion is blocked for + /// this Gallery Image Version if its End Of Life has not expired. + /// + [JsonProperty(PropertyName = "blockDeletionBeforeEndOfLife")] + public bool? BlockDeletionBeforeEndOfLife { get; set; } + } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs index c684cac8b528..66341cd66f62 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs @@ -42,7 +42,9 @@ public GalleryImageVersionUpdate() /// Possible values include: /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', /// 'Migrating' - public GalleryImageVersionUpdate(GalleryImageVersionStorageProfile storageProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile)) + /// Indicates if this is a soft-delete resource + /// restoration request. + public GalleryImageVersionUpdate(GalleryImageVersionStorageProfile storageProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?), ValidationsProfile validationsProfile = default(ValidationsProfile)) : base(id, name, type, tags) { PublishingProfile = publishingProfile; @@ -51,6 +53,8 @@ public GalleryImageVersionUpdate() SafetyProfile = safetyProfile; ReplicationStatus = replicationStatus; SecurityProfile = securityProfile; + Restore = restore; + ValidationsProfile = validationsProfile; CustomInit(); } @@ -91,6 +95,18 @@ public GalleryImageVersionUpdate() [JsonProperty(PropertyName = "properties.securityProfile")] public ImageVersionSecurityProfile SecurityProfile { get; set; } + /// + /// Gets or sets indicates if this is a soft-delete resource + /// restoration request. + /// + [JsonProperty(PropertyName = "properties.restore")] + public bool? Restore { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.validationsProfile")] + public ValidationsProfile ValidationsProfile { get; private set; } + /// /// Validate the object. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs new file mode 100644 index 000000000000..0bd68adeafc2 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies information about the gallery inVMAccessControlProfile that + /// you want to create or update. + /// + public partial class GalleryInVMAccessControlProfile : Resource + { + /// + /// Initializes a new instance of the GalleryInVMAccessControlProfile + /// class. + /// + public GalleryInVMAccessControlProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryInVMAccessControlProfile + /// class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + public GalleryInVMAccessControlProfile(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryInVMAccessControlProfileProperties properties = default(GalleryInVMAccessControlProfileProperties)) + : base(location, id, name, type, tags) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public GalleryInVMAccessControlProfileProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs new file mode 100644 index 000000000000..12f36239d249 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the properties of a gallery inVMAccessControlProfile. + /// + public partial class GalleryInVMAccessControlProfileProperties : GalleryResourceProfilePropertiesBase + { + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileProperties class. + /// + public GalleryInVMAccessControlProfileProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileProperties class. + /// + /// This property allows you to specify the OS + /// type of the VMs/VMSS for which this profile can be used against. + /// Possible values are: 'Windows' or 'Linux'. Possible values include: + /// 'Windows', 'Linux' + /// This property allows you to + /// specify the Endpoint type for which this profile is defining the + /// access control for. Possible values are: 'WireServer' or 'IMDS'. + /// Possible values include: 'WireServer', 'IMDS' + /// Possible values include: + /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + /// 'Migrating' + /// The description of this gallery + /// inVMAccessControlProfile resources. This property is + /// updatable. + public GalleryInVMAccessControlProfileProperties(OperatingSystemTypes osType, EndpointTypes applicableHostEndpoint, string provisioningState = default(string), string description = default(string)) + : base(provisioningState) + { + Description = description; + OsType = osType; + ApplicableHostEndpoint = applicableHostEndpoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the description of this gallery + /// inVMAccessControlProfile resources. This property is updatable. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets this property allows you to specify the OS type of the + /// VMs/VMSS for which this profile can be used against. Possible + /// values are: 'Windows' or 'Linux'. Possible values include: + /// 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType { get; set; } + + /// + /// Gets or sets this property allows you to specify the Endpoint type + /// for which this profile is defining the access control for. Possible + /// values are: 'WireServer' or 'IMDS'. Possible values include: + /// 'WireServer', 'IMDS' + /// + [JsonProperty(PropertyName = "applicableHostEndpoint")] + public EndpointTypes ApplicableHostEndpoint { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs new file mode 100644 index 000000000000..dea7d6531825 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies information about the gallery inVMAccessControlProfile that + /// you want to update. + /// + public partial class GalleryInVMAccessControlProfileUpdate : UpdateResourceDefinition + { + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileUpdate class. + /// + public GalleryInVMAccessControlProfileUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileUpdate class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + public GalleryInVMAccessControlProfileUpdate(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryInVMAccessControlProfileProperties properties = default(GalleryInVMAccessControlProfileProperties)) + : base(id, name, type, tags) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public GalleryInVMAccessControlProfileProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs new file mode 100644 index 000000000000..a80c40361b6b --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs @@ -0,0 +1,168 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies information about the gallery inVMAccessControlProfile + /// version that you want to create or update. + /// + [Rest.Serialization.JsonTransformation] + public partial class GalleryInVMAccessControlProfileVersion : Resource + { + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileVersion class. + /// + public GalleryInVMAccessControlProfileVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileVersion class. + /// + /// Resource location + /// This property allows you to specify whether the + /// access control rules are in Audit mode, in Enforce mode or + /// Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. + /// Possible values include: 'Audit', 'Enforce', 'Disabled' + /// This property allows you to specify if + /// the requests will be allowed to access the host endpoints. Possible + /// values are: 'Allow', 'Deny'. Possible values include: 'Allow', + /// 'Deny' + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// The target regions where the Resource + /// Profile version is going to be replicated to. This property is + /// updatable. + /// If set to true, Virtual Machines + /// deployed from the latest version of the Resource Profile won't use + /// this Profile version. + /// The timestamp for when the Resource + /// Profile Version is published. + /// Possible values include: + /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + /// 'Migrating' + public GalleryInVMAccessControlProfileVersion(string location, string mode, string defaultAccess, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList targetLocations = default(IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus), AccessControlRules rules = default(AccessControlRules)) + : base(location, id, name, type, tags) + { + TargetLocations = targetLocations; + ExcludeFromLatest = excludeFromLatest; + PublishedDate = publishedDate; + ProvisioningState = provisioningState; + ReplicationStatus = replicationStatus; + Mode = mode; + DefaultAccess = defaultAccess; + Rules = rules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the target regions where the Resource Profile version + /// is going to be replicated to. This property is updatable. + /// + [JsonProperty(PropertyName = "properties.targetLocations")] + public IList TargetLocations { get; set; } + + /// + /// Gets or sets if set to true, Virtual Machines deployed from the + /// latest version of the Resource Profile won't use this Profile + /// version. + /// + [JsonProperty(PropertyName = "properties.excludeFromLatest")] + public bool? ExcludeFromLatest { get; set; } + + /// + /// Gets the timestamp for when the Resource Profile Version is + /// published. + /// + [JsonProperty(PropertyName = "properties.publishedDate")] + public System.DateTime? PublishedDate { get; private set; } + + /// + /// Gets possible values include: 'Creating', 'Updating', 'Failed', + /// 'Succeeded', 'Deleting', 'Migrating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus { get; private set; } + + /// + /// Gets or sets this property allows you to specify whether the access + /// control rules are in Audit mode, in Enforce mode or Disabled. + /// Possible values are: 'Audit', 'Enforce' or 'Disabled'. Possible + /// values include: 'Audit', 'Enforce', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.mode")] + public string Mode { get; set; } + + /// + /// Gets or sets this property allows you to specify if the requests + /// will be allowed to access the host endpoints. Possible values are: + /// 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + /// + [JsonProperty(PropertyName = "properties.defaultAccess")] + public string DefaultAccess { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.rules")] + public AccessControlRules Rules { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Mode == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Mode"); + } + if (DefaultAccess == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DefaultAccess"); + } + if (TargetLocations != null) + { + foreach (var element in TargetLocations) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs new file mode 100644 index 000000000000..1828395c4229 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs @@ -0,0 +1,166 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies information about the gallery inVMAccessControlProfile + /// version that you want to update. + /// + [Rest.Serialization.JsonTransformation] + public partial class GalleryInVMAccessControlProfileVersionUpdate : UpdateResourceDefinition + { + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileVersionUpdate class. + /// + public GalleryInVMAccessControlProfileVersionUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileVersionUpdate class. + /// + /// This property allows you to specify whether the + /// access control rules are in Audit mode, in Enforce mode or + /// Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. + /// Possible values include: 'Audit', 'Enforce', 'Disabled' + /// This property allows you to specify if + /// the requests will be allowed to access the host endpoints. Possible + /// values are: 'Allow', 'Deny'. Possible values include: 'Allow', + /// 'Deny' + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// The target regions where the Resource + /// Profile version is going to be replicated to. This property is + /// updatable. + /// If set to true, Virtual Machines + /// deployed from the latest version of the Resource Profile won't use + /// this Profile version. + /// The timestamp for when the Resource + /// Profile Version is published. + /// Possible values include: + /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + /// 'Migrating' + public GalleryInVMAccessControlProfileVersionUpdate(string mode, string defaultAccess, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList targetLocations = default(IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus), AccessControlRules rules = default(AccessControlRules)) + : base(id, name, type, tags) + { + TargetLocations = targetLocations; + ExcludeFromLatest = excludeFromLatest; + PublishedDate = publishedDate; + ProvisioningState = provisioningState; + ReplicationStatus = replicationStatus; + Mode = mode; + DefaultAccess = defaultAccess; + Rules = rules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the target regions where the Resource Profile version + /// is going to be replicated to. This property is updatable. + /// + [JsonProperty(PropertyName = "properties.targetLocations")] + public IList TargetLocations { get; set; } + + /// + /// Gets or sets if set to true, Virtual Machines deployed from the + /// latest version of the Resource Profile won't use this Profile + /// version. + /// + [JsonProperty(PropertyName = "properties.excludeFromLatest")] + public bool? ExcludeFromLatest { get; set; } + + /// + /// Gets the timestamp for when the Resource Profile Version is + /// published. + /// + [JsonProperty(PropertyName = "properties.publishedDate")] + public System.DateTime? PublishedDate { get; private set; } + + /// + /// Gets possible values include: 'Creating', 'Updating', 'Failed', + /// 'Succeeded', 'Deleting', 'Migrating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus { get; private set; } + + /// + /// Gets or sets this property allows you to specify whether the access + /// control rules are in Audit mode, in Enforce mode or Disabled. + /// Possible values are: 'Audit', 'Enforce' or 'Disabled'. Possible + /// values include: 'Audit', 'Enforce', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.mode")] + public string Mode { get; set; } + + /// + /// Gets or sets this property allows you to specify if the requests + /// will be allowed to access the host endpoints. Possible values are: + /// 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + /// + [JsonProperty(PropertyName = "properties.defaultAccess")] + public string DefaultAccess { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.rules")] + public AccessControlRules Rules { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Mode == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Mode"); + } + if (DefaultAccess == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DefaultAccess"); + } + if (TargetLocations != null) + { + foreach (var element in TargetLocations) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs new file mode 100644 index 000000000000..af66dd8e917a --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class GalleryInVMAccessControlProfileVersionsDeleteHeaders + { + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileVersionsDeleteHeaders class. + /// + public GalleryInVMAccessControlProfileVersionsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfileVersionsDeleteHeaders class. + /// + public GalleryInVMAccessControlProfileVersionsDeleteHeaders(string location = default(string), string azureAsyncOperation = default(string)) + { + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs new file mode 100644 index 000000000000..9dd6f0d77dcf --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class GalleryInVMAccessControlProfilesDeleteHeaders + { + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfilesDeleteHeaders class. + /// + public GalleryInVMAccessControlProfilesDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryInVMAccessControlProfilesDeleteHeaders class. + /// + public GalleryInVMAccessControlProfilesDeleteHeaders(string location = default(string), string azureAsyncOperation = default(string)) + { + Location = location; + AzureAsyncOperation = azureAsyncOperation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// + [JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs new file mode 100644 index 000000000000..7722528100d0 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties of a gallery ResourceProfile. + /// + public partial class GalleryResourceProfilePropertiesBase + { + /// + /// Initializes a new instance of the + /// GalleryResourceProfilePropertiesBase class. + /// + public GalleryResourceProfilePropertiesBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryResourceProfilePropertiesBase class. + /// + /// Possible values include: + /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + /// 'Migrating' + public GalleryResourceProfilePropertiesBase(string provisioningState = default(string)) + { + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets possible values include: 'Creating', 'Updating', 'Failed', + /// 'Succeeded', 'Deleting', 'Migrating' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs new file mode 100644 index 000000000000..3b846a68aa38 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of a gallery ResourceProfile version. + /// + public partial class GalleryResourceProfileVersionPropertiesBase + { + /// + /// Initializes a new instance of the + /// GalleryResourceProfileVersionPropertiesBase class. + /// + public GalleryResourceProfileVersionPropertiesBase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GalleryResourceProfileVersionPropertiesBase class. + /// + /// The target regions where the Resource + /// Profile version is going to be replicated to. This property is + /// updatable. + /// If set to true, Virtual Machines + /// deployed from the latest version of the Resource Profile won't use + /// this Profile version. + /// The timestamp for when the Resource + /// Profile Version is published. + /// Possible values include: + /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', + /// 'Migrating' + public GalleryResourceProfileVersionPropertiesBase(IList targetLocations = default(IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus)) + { + TargetLocations = targetLocations; + ExcludeFromLatest = excludeFromLatest; + PublishedDate = publishedDate; + ProvisioningState = provisioningState; + ReplicationStatus = replicationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the target regions where the Resource Profile version + /// is going to be replicated to. This property is updatable. + /// + [JsonProperty(PropertyName = "targetLocations")] + public IList TargetLocations { get; set; } + + /// + /// Gets or sets if set to true, Virtual Machines deployed from the + /// latest version of the Resource Profile won't use this Profile + /// version. + /// + [JsonProperty(PropertyName = "excludeFromLatest")] + public bool? ExcludeFromLatest { get; set; } + + /// + /// Gets the timestamp for when the Resource Profile Version is + /// published. + /// + [JsonProperty(PropertyName = "publishedDate")] + public System.DateTime? PublishedDate { get; private set; } + + /// + /// Gets possible values include: 'Creating', 'Updating', 'Failed', + /// 'Succeeded', 'Deleting', 'Migrating' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "replicationStatus")] + public ReplicationStatus ReplicationStatus { get; private set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs new file mode 100644 index 000000000000..9648744b55a8 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The details information of soft-deleted resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class GallerySoftDeletedResource : Resource + { + /// + /// Initializes a new instance of the GallerySoftDeletedResource class. + /// + public GallerySoftDeletedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GallerySoftDeletedResource class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// arm id of the soft-deleted + /// resource + /// artifact type of the + /// soft-deleted resource. Possible values include: 'Images' + /// The timestamp for when the resource + /// is soft-deleted. In dateTime offset format. + public GallerySoftDeletedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string resourceArmId = default(string), string softDeletedArtifactType = default(string), string softDeletedTime = default(string)) + : base(location, id, name, type, tags) + { + ResourceArmId = resourceArmId; + SoftDeletedArtifactType = softDeletedArtifactType; + SoftDeletedTime = softDeletedTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets arm id of the soft-deleted resource + /// + [JsonProperty(PropertyName = "properties.resourceArmId")] + public string ResourceArmId { get; set; } + + /// + /// Gets or sets artifact type of the soft-deleted resource. Possible + /// values include: 'Images' + /// + [JsonProperty(PropertyName = "properties.softDeletedArtifactType")] + public string SoftDeletedArtifactType { get; set; } + + /// + /// Gets or sets the timestamp for when the resource is soft-deleted. + /// In dateTime offset format. + /// + [JsonProperty(PropertyName = "properties.softDeletedTime")] + public string SoftDeletedTime { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs index 268f3d966eb9..2120e8b96baa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs @@ -44,7 +44,9 @@ public GalleryUpdate() /// Possible values include: /// 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', /// 'Migrating' - public GalleryUpdate(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus)) + /// The identity of the gallery, if + /// configured. + public GalleryUpdate(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus), GalleryIdentity identity = default(GalleryIdentity)) : base(id, name, type, tags) { Description = description; @@ -53,6 +55,7 @@ public GalleryUpdate() SharingProfile = sharingProfile; SoftDeletePolicy = softDeletePolicy; SharingStatus = sharingStatus; + Identity = identity; CustomInit(); } @@ -95,5 +98,11 @@ public GalleryUpdate() [JsonProperty(PropertyName = "properties.sharingStatus")] public SharingStatus SharingStatus { get; private set; } + /// + /// Gets or sets the identity of the gallery, if configured. + /// + [JsonProperty(PropertyName = "identity")] + public GalleryIdentity Identity { get; set; } + } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs new file mode 100644 index 000000000000..02399cfea63f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// This is the platform attribute of the image version. + /// + public partial class PlatformAttribute + { + /// + /// Initializes a new instance of the PlatformAttribute class. + /// + public PlatformAttribute() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlatformAttribute class. + /// + /// This property specifies the name of the + /// platformAttribute. It is read-only. + /// This property specifies the value of the + /// corresponding name property. It is read-only. + public PlatformAttribute(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets this property specifies the name of the platformAttribute. It + /// is read-only. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets this property specifies the value of the corresponding name + /// property. It is read-only. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs new file mode 100644 index 000000000000..f1bbd3a98d5b --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for SoftDeletedArtifactTypes. + /// + public static class SoftDeletedArtifactTypes + { + public const string Images = "Images"; + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs index ec564c0010b6..b202e1b4d38f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs @@ -19,5 +19,6 @@ public static class StorageAccountType public const string StandardLRS = "Standard_LRS"; public const string StandardZRS = "Standard_ZRS"; public const string PremiumLRS = "Premium_LRS"; + public const string PremiumV2LRS = "PremiumV2_LRS"; } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs index 21dd08696630..3b7862883e79 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Management.Compute.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -37,16 +39,19 @@ public TargetRegion() /// Specifies the storage account type /// to be used to store the image. This property is not updatable. /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS' + /// 'Premium_LRS', 'PremiumV2_LRS' /// Contains the flag setting to hide /// an image when users specify version='latest' - public TargetRegion(string name, int? regionalReplicaCount = default(int?), string storageAccountType = default(string), EncryptionImages encryption = default(EncryptionImages), bool? excludeFromLatest = default(bool?)) + /// List of storage sku with + /// replica count to create direct drive replicas. + public TargetRegion(string name, int? regionalReplicaCount = default(int?), string storageAccountType = default(string), EncryptionImages encryption = default(EncryptionImages), bool? excludeFromLatest = default(bool?), IList additionalReplicaSets = default(IList)) { Name = name; RegionalReplicaCount = regionalReplicaCount; StorageAccountType = storageAccountType; Encryption = encryption; ExcludeFromLatest = excludeFromLatest; + AdditionalReplicaSets = additionalReplicaSets; CustomInit(); } @@ -71,7 +76,7 @@ public TargetRegion() /// /// Gets or sets specifies the storage account type to be used to store /// the image. This property is not updatable. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS' + /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' /// [JsonProperty(PropertyName = "storageAccountType")] public string StorageAccountType { get; set; } @@ -88,6 +93,13 @@ public TargetRegion() [JsonProperty(PropertyName = "excludeFromLatest")] public bool? ExcludeFromLatest { get; set; } + /// + /// Gets or sets list of storage sku with replica count to create + /// direct drive replicas. + /// + [JsonProperty(PropertyName = "additionalReplicaSets")] + public IList AdditionalReplicaSets { get; set; } + /// /// Validate the object. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs index 7df0ba129ac8..799067dd57e7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs @@ -38,10 +38,15 @@ public UserArtifactSettings() /// downloaded config file on the VM. This is limited to 4096 /// characters. If not specified, the config file will be named the /// Gallery Application name appended with "_config". - public UserArtifactSettings(string packageFileName = default(string), string configFileName = default(string)) + /// Optional. The action to be + /// taken with regards to install/update/remove of the gallery + /// application in the event of a reboot. Possible values include: + /// 'None', 'Rerun' + public UserArtifactSettings(string packageFileName = default(string), string configFileName = default(string), string scriptBehaviorAfterReboot = default(string)) { PackageFileName = packageFileName; ConfigFileName = configFileName; + ScriptBehaviorAfterReboot = scriptBehaviorAfterReboot; CustomInit(); } @@ -68,5 +73,13 @@ public UserArtifactSettings() [JsonProperty(PropertyName = "configFileName")] public string ConfigFileName { get; set; } + /// + /// Gets or sets optional. The action to be taken with regards to + /// install/update/remove of the gallery application in the event of a + /// reboot. Possible values include: 'None', 'Rerun' + /// + [JsonProperty(PropertyName = "scriptBehaviorAfterReboot")] + public string ScriptBehaviorAfterReboot { get; set; } + } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs new file mode 100644 index 000000000000..3bb9dba98dba --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for ValidationStatus. + /// + public static class ValidationStatus + { + public const string Unknown = "Unknown"; + public const string Failed = "Failed"; + public const string Succeeded = "Succeeded"; + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs new file mode 100644 index 000000000000..c62da832eb17 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// This is the validations profile of a Gallery Image Version. + /// + public partial class ValidationsProfile + { + /// + /// Initializes a new instance of the ValidationsProfile class. + /// + public ValidationsProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidationsProfile class. + /// + /// The published time of the image + /// version + /// This specifies the pub, offer, sku + /// and version of the image version metadata + public ValidationsProfile(string validationEtag = default(string), IList executedValidations = default(IList), IList platformAttributes = default(IList)) + { + ValidationEtag = validationEtag; + ExecutedValidations = executedValidations; + PlatformAttributes = platformAttributes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the published time of the image version + /// + [JsonProperty(PropertyName = "validationEtag")] + public string ValidationEtag { get; set; } + + /// + /// + [JsonProperty(PropertyName = "executedValidations")] + public IList ExecutedValidations { get; set; } + + /// + /// Gets or sets this specifies the pub, offer, sku and version of the + /// image version metadata + /// + [JsonProperty(PropertyName = "platformAttributes")] + public IList PlatformAttributes { get; set; } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs b/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs index 3dc3eac8eadd..12b7dc0a5253 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs @@ -27,21 +27,23 @@ public static IEnumerable> ApiInfo_ComputeManageme new Tuple("Compute", "CloudServiceRoles", "2022-09-04"), new Tuple("Compute", "CloudServices", "2022-09-04"), new Tuple("Compute", "CloudServicesUpdateDomain", "2022-09-04"), - new Tuple("Compute", "CommunityGalleries", "2023-07-03"), - new Tuple("Compute", "CommunityGalleryImageVersions", "2023-07-03"), - new Tuple("Compute", "CommunityGalleryImages", "2023-07-03"), + new Tuple("Compute", "CommunityGalleries", "2024-03-03"), + new Tuple("Compute", "CommunityGalleryImageVersions", "2024-03-03"), + new Tuple("Compute", "CommunityGalleryImages", "2024-03-03"), new Tuple("Compute", "DedicatedHostGroups", "2024-07-01"), new Tuple("Compute", "DedicatedHosts", "2024-07-01"), new Tuple("Compute", "DiskAccesses", "2024-03-02"), new Tuple("Compute", "DiskEncryptionSets", "2024-03-02"), new Tuple("Compute", "DiskRestorePoint", "2024-03-02"), new Tuple("Compute", "Disks", "2024-03-02"), - new Tuple("Compute", "Galleries", "2023-07-03"), - new Tuple("Compute", "GalleryApplicationVersions", "2023-07-03"), - new Tuple("Compute", "GalleryApplications", "2023-07-03"), - new Tuple("Compute", "GalleryImageVersions", "2023-07-03"), - new Tuple("Compute", "GalleryImages", "2023-07-03"), - new Tuple("Compute", "GallerySharingProfile", "2023-07-03"), + new Tuple("Compute", "Galleries", "2024-03-03"), + new Tuple("Compute", "GalleryApplicationVersions", "2024-03-03"), + new Tuple("Compute", "GalleryApplications", "2024-03-03"), + new Tuple("Compute", "GalleryImageVersions", "2024-03-03"), + new Tuple("Compute", "GalleryImages", "2024-03-03"), + new Tuple("Compute", "GalleryInVMAccessControlProfileVersions", "2024-03-03"), + new Tuple("Compute", "GalleryInVMAccessControlProfiles", "2024-03-03"), + new Tuple("Compute", "GallerySharingProfile", "2024-03-03"), new Tuple("Compute", "Images", "2024-07-01"), new Tuple("Compute", "LogAnalytics", "2024-07-01"), new Tuple("Compute", "Operations", "2024-07-01"), @@ -49,10 +51,11 @@ public static IEnumerable> ApiInfo_ComputeManageme new Tuple("Compute", "ResourceSkus", "2021-07-01"), new Tuple("Compute", "RestorePointCollections", "2024-07-01"), new Tuple("Compute", "RestorePoints", "2024-07-01"), - new Tuple("Compute", "SharedGalleries", "2023-07-03"), - new Tuple("Compute", "SharedGalleryImageVersions", "2023-07-03"), - new Tuple("Compute", "SharedGalleryImages", "2023-07-03"), + new Tuple("Compute", "SharedGalleries", "2024-03-03"), + new Tuple("Compute", "SharedGalleryImageVersions", "2024-03-03"), + new Tuple("Compute", "SharedGalleryImages", "2024-03-03"), new Tuple("Compute", "Snapshots", "2024-03-02"), + new Tuple("Compute", "SoftDeletedResource", "2024-03-03"), new Tuple("Compute", "SshPublicKeys", "2024-07-01"), new Tuple("Compute", "Usage", "2024-07-01"), new Tuple("Compute", "VirtualMachineExtensionImages", "2024-07-01"), diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs index fc8e22ad7b81..34e82891b6ce 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs @@ -91,7 +91,7 @@ internal SharedGalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -288,7 +288,7 @@ internal SharedGalleriesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs index 725b5cd5057e..aea41737de08 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs @@ -106,7 +106,7 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs index 94e166645644..aa1e13b1d793 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs @@ -98,7 +98,7 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -305,7 +305,7 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2023-07-03"; + string apiVersion = "2024-03-03"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs new file mode 100644 index 000000000000..f0be59249090 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs @@ -0,0 +1,463 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SoftDeletedResourceOperations operations. + /// + internal partial class SoftDeletedResourceOperations : IServiceOperations, ISoftDeletedResourceOperations + { + /// + /// Initializes a new instance of the SoftDeletedResourceOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SoftDeletedResourceOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Gallery in which the soft-deleted resources resides. + /// + /// + /// The type of the artifact to be listed, such as gallery image version. + /// + /// + /// The artifact name to be listed. If artifact type is Images, then the + /// artifact name should be the gallery image name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByArtifactNameWithHttpMessagesAsync(string resourceGroupName, string galleryName, string artifactType, string artifactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (galleryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + } + if (galleryName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(galleryName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "galleryName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + if (artifactType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "artifactType"); + } + if (artifactType != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(artifactType, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "artifactType", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + if (artifactName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "artifactName"); + } + if (artifactName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(artifactName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "artifactName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + } + } + string apiVersion = "2024-03-03"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("artifactType", artifactType); + tracingParameters.Add("artifactName", artifactName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByArtifactName", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/softDeletedArtifactTypes/{artifactType}/artifacts/{artifactName}/versions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); + _url = _url.Replace("{artifactType}", System.Uri.EscapeDataString(artifactType)); + _url = _url.Replace("{artifactName}", System.Uri.EscapeDataString(artifactName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByArtifactNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByArtifactNameNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs new file mode 100644 index 000000000000..a361751c816f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SoftDeletedResourceOperations. + /// + public static partial class SoftDeletedResourceOperationsExtensions + { + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Gallery in which the soft-deleted resources resides. + /// + /// + /// The type of the artifact to be listed, such as gallery image version. + /// + /// + /// The artifact name to be listed. If artifact type is Images, then the + /// artifact name should be the gallery image name. + /// + public static IPage ListByArtifactName(this ISoftDeletedResourceOperations operations, string resourceGroupName, string galleryName, string artifactType, string artifactName) + { + return operations.ListByArtifactNameAsync(resourceGroupName, galleryName, artifactType, artifactName).GetAwaiter().GetResult(); + } + + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Gallery in which the soft-deleted resources resides. + /// + /// + /// The type of the artifact to be listed, such as gallery image version. + /// + /// + /// The artifact name to be listed. If artifact type is Images, then the + /// artifact name should be the gallery image name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByArtifactNameAsync(this ISoftDeletedResourceOperations operations, string resourceGroupName, string galleryName, string artifactType, string artifactName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByArtifactNameWithHttpMessagesAsync(resourceGroupName, galleryName, artifactType, artifactName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByArtifactNameNext(this ISoftDeletedResourceOperations operations, string nextPageLink) + { + return operations.ListByArtifactNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByArtifactNameNextAsync(this ISoftDeletedResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByArtifactNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/Compute/Compute.Management.Sdk/README.md b/src/Compute/Compute.Management.Sdk/README.md index b731170ec6f4..d31c2111285f 100644 --- a/src/Compute/Compute.Management.Sdk/README.md +++ b/src/Compute/Compute.Management.Sdk/README.md @@ -48,7 +48,7 @@ directive: ### ``` yaml -commit: 3d87a71fb30062a70d5adf9cd7653639f00c3b92 +commit: b09c9ec927456021dc549e111fa2cac3b4b00659 input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/common-types/v1/common.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/computeRPCommon.json @@ -72,10 +72,10 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/diskRestorePoint.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/snapshot.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/skus.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/galleryRPCommon.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/gallery.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/sharedGallery.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/communityGallery.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/galleryRPCommon.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/gallery.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/sharedGallery.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/communityGallery.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/cloudService.json output-folder: Generated diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index e928219e3860..a44def88b146 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -21,6 +21,7 @@ --> ## Upcoming Release * Upgraded Azure.Core to 1.44.1. +* Compute gallery related cmdlets will now use 2024-03-03 GalleryRP API calls. ## Version 9.0.0 * Made `-PublicIpSku` parameter Standard by default in `New-AzVM` diff --git a/tools/StaticAnalysis/Exceptions/Az.Compute/GeneratedSdkIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Compute/GeneratedSdkIssues.csv index 669ad0a197fb..90a88d3ed0dc 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Compute/GeneratedSdkIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Compute/GeneratedSdkIssues.csv @@ -1,2 +1,3 @@ "Module","Sdk","Severity","ProblemId","Description","Remediation" "Az.Compute","src/Compute/Compute.Management.Sdk","1","9080","Do not support updating SDK using autorest csharp v3.","Please update the Readme.md to generate code by autorest powershell v4." + "Az.Compute","src/Compute/Compute.Management.Sdk","1","9080","Do not support updating SDK using autorest csharp.","Please update the Readme.md to generate code by autorest powershell v4."