diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs index 8e0bd30d8a73..f35d5e17a293 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs @@ -101,7 +101,7 @@ internal CommunityGalleriesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.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 9ef4d936a2ec..f67fff1fd092 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs @@ -109,7 +109,7 @@ internal CommunityGalleryImageVersionsOperations (ComputeManagementClient client throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal CommunityGalleryImageVersionsOperations (ComputeManagementClient client throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.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 ae601dd8c6d5..c7971bdee392 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 Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal CommunityGalleryImagesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.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 33ba9e75e47a..d84901ae3f6c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs @@ -188,6 +188,10 @@ public partial class ComputeManagementClient : Microsoft.Rest.ServiceClient public virtual IDiskRestorePointOperations DiskRestorePoint { get; private set; } /// + /// Gets the ITenantLevelGallerySharingOperations + /// + public virtual ITenantLevelGallerySharingOperations TenantLevelGallerySharing { get; private set; } + /// /// Gets the IGalleriesOperations /// public virtual IGalleriesOperations Galleries { get; private set; } @@ -216,6 +220,10 @@ public partial class ComputeManagementClient : Microsoft.Rest.ServiceClient public virtual ISharedGalleryImageVersionsOperations SharedGalleryImageVersions { get; private set; } /// + /// Gets the IGallerySharingOperations + /// + public virtual IGallerySharingOperations GallerySharing { get; private set; } + /// /// Gets the IGalleryApplicationsOperations /// public virtual IGalleryApplicationsOperations GalleryApplications { get; private set; } @@ -530,6 +538,7 @@ private void Initialize() this.Disks = new DisksOperations(this); this.Snapshots = new SnapshotsOperations(this); this.DiskRestorePoint = new DiskRestorePointOperations(this); + this.TenantLevelGallerySharing = new TenantLevelGallerySharingOperations(this); this.Galleries = new GalleriesOperations(this); this.CommunityGalleries = new CommunityGalleriesOperations(this); this.CommunityGalleryImages = new CommunityGalleryImagesOperations(this); @@ -537,6 +546,7 @@ private void Initialize() this.SharedGalleries = new SharedGalleriesOperations(this); this.SharedGalleryImages = new SharedGalleryImagesOperations(this); this.SharedGalleryImageVersions = new SharedGalleryImageVersionsOperations(this); + this.GallerySharing = new GallerySharingOperations(this); this.GalleryApplications = new GalleryApplicationsOperations(this); this.GalleryApplicationVersions = new GalleryApplicationVersionsOperations(this); this.GalleryImages = new GalleryImagesOperations(this); diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs index 151a1bc42ad4..896a4751bed5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs @@ -79,7 +79,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -520,7 +520,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -831,7 +831,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1069,7 +1069,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1361,7 +1361,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1601,7 +1601,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1858,7 +1858,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; DiskAccessUpdate diskAccess = new DiskAccessUpdate(); if(tags != null) { @@ -2114,7 +2114,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2338,7 +2338,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; PrivateEndpointConnection privateEndpointConnection = new PrivateEndpointConnection(); if(privateLinkServiceConnectionState != null) { @@ -2604,7 +2604,7 @@ internal DiskAccessesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs index 86ca79783111..a0173bb75368 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs @@ -79,7 +79,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -520,7 +520,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -832,7 +832,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1073,7 +1073,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1335,7 +1335,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1586,7 +1586,7 @@ internal DiskEncryptionSetsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs index e511e19812b8..fc89fa8ea748 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs @@ -114,7 +114,7 @@ internal DiskRestorePointOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmRestorePointName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -359,7 +359,7 @@ internal DiskRestorePointOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskRestorePointName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -678,7 +678,7 @@ internal DiskRestorePointOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskRestorePointName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -929,7 +929,7 @@ internal DiskRestorePointOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskRestorePointName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs index b3a2490d33b4..7801d048c1a9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs @@ -79,7 +79,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -519,7 +519,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -887,7 +887,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1147,7 +1147,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1397,7 +1397,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1618,7 +1618,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1850,7 +1850,7 @@ internal DisksOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs index 941c477118dc..1eb1f5afc58b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs @@ -79,7 +79,7 @@ internal GalleriesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal GalleriesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal GalleriesOperations (ComputeManagementClient client) } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -856,7 +856,7 @@ internal GalleriesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "galleryName", "^[^_\\W][\\w-._]{0,79}(? + /// GallerySharingOperations operations. + /// + internal partial class GallerySharingOperations : Microsoft.Rest.IServiceOperations, IGallerySharingOperations + { + /// + /// Initializes a new instance of the GallerySharingOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GallerySharingOperations (ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> AcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginAcceptWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRejectWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// 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 System.Threading.Tasks.Task> BeginAcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (sharedGallerySubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sharedGallerySubscriptionId"); + } + if (sharedGallerySubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(sharedGallerySubscriptionId, "^[^_\\W][\\w-._]{0,79}(? tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("location", location); + tracingParameters.Add("sharedGallerySubscriptionId", sharedGallerySubscriptionId); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAccept", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGallerySubscriptions/{sharedGallerySubscriptionId}/sharedGalleries/{sharedGalleryName}/accept").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{sharedGallerySubscriptionId}", System.Uri.EscapeDataString(sharedGallerySubscriptionId)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// 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 System.Threading.Tasks.Task> BeginRejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (sharedGallerySubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sharedGallerySubscriptionId"); + } + if (sharedGallerySubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(sharedGallerySubscriptionId, "^[^_\\W][\\w-._]{0,79}(? tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("location", location); + tracingParameters.Add("sharedGallerySubscriptionId", sharedGallerySubscriptionId); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReject", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGallerySubscriptions/{sharedGallerySubscriptionId}/sharedGalleries/{sharedGalleryName}/reject").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{sharedGallerySubscriptionId}", System.Uri.EscapeDataString(sharedGallerySubscriptionId)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingOperationsExtensions.cs new file mode 100644 index 000000000000..16bb28492b3f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingOperationsExtensions.cs @@ -0,0 +1,196 @@ +// 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.Azure; + using Models; + + /// + /// Extension methods for GallerySharingOperations + /// + public static partial class GallerySharingOperationsExtensions + { + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + public static GallerySharingAcceptHeaders Accept(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((IGallerySharingOperations)operations).AcceptAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AcceptAsync(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AcceptWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + public static GallerySharingRejectHeaders Reject(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((IGallerySharingOperations)operations).RejectAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RejectAsync(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RejectWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + public static GallerySharingAcceptHeaders BeginAccept(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((IGallerySharingOperations)operations).BeginAcceptAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAcceptAsync(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginAcceptWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + public static GallerySharingRejectHeaders BeginReject(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((IGallerySharingOperations)operations).BeginRejectAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRejectAsync(this IGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRejectWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs index 1287c8ec9bac..e7122b81a4b8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs @@ -147,7 +147,7 @@ internal GallerySharingProfileOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "galleryName", "^[^_\\W][\\w-._]{0,79}(? IDiskRestorePointOperations DiskRestorePoint { get; } + /// + /// Gets the ITenantLevelGallerySharingOperations + /// + ITenantLevelGallerySharingOperations TenantLevelGallerySharing { get; } + /// /// Gets the IGalleriesOperations /// @@ -262,6 +267,11 @@ public partial interface IComputeManagementClient : System.IDisposable /// ISharedGalleryImageVersionsOperations SharedGalleryImageVersions { get; } + /// + /// Gets the IGallerySharingOperations + /// + IGallerySharingOperations GallerySharing { get; } + /// /// Gets the IGalleryApplicationsOperations /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingOperations.cs new file mode 100644 index 000000000000..8416b5f8495c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingOperations.cs @@ -0,0 +1,121 @@ +// 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.Azure; + using Models; + + /// + /// GallerySharingOperations operations. + /// + public partial interface IGallerySharingOperations + { + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> AcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> RejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// Accept sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginAcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// Reject sharing of a subscription-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginRejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs index a3fefa726fdc..03746080d87f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs @@ -228,6 +228,78 @@ public partial interface ISnapshotsOperations /// System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy 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 + /// + System.Threading.Tasks.Task> UpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy lock 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 + /// + System.Threading.Tasks.Task> UpdateImmutabilityPolicyLockWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a snapshot. /// @@ -372,6 +444,78 @@ public partial interface ISnapshotsOperations /// System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy 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 + /// + System.Threading.Tasks.Task> BeginUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy lock 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 + /// + System.Threading.Tasks.Task> BeginUpdateImmutabilityPolicyLockWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists snapshots under a subscription. /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/ITenantLevelGallerySharingOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ITenantLevelGallerySharingOperations.cs new file mode 100644 index 000000000000..d77dbd430fa0 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/ITenantLevelGallerySharingOperations.cs @@ -0,0 +1,121 @@ +// 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.Azure; + using Models; + + /// + /// TenantLevelGallerySharingOperations operations. + /// + public partial interface ITenantLevelGallerySharingOperations + { + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> AcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> RejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginAcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginRejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMVersion.cs new file mode 100644 index 000000000000..68216a71cbd0 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMVersion.cs @@ -0,0 +1,26 @@ +// 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 ConfidentialVMVersion. + /// + + + public static class ConfidentialVMVersion + { + /// + /// V1 indicates the resource does not have an associated Virtual Machine + /// Metadata. + /// + public const string V1 = "V1"; + /// + /// V2 indicates the resource has an associated Virtual Machine Metadata. + /// + public const string V2 = "V2"; + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs index 376a7be73eb5..ec995a4b2d27 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs @@ -98,7 +98,12 @@ public DiskRestorePoint() /// PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the /// default. /// - public DiskRestorePoint(string id = default(string), string name = default(string), string type = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), Encryption encryption = default(Encryption), System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), string familyId = default(string), string sourceUniqueId = default(string), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?)) + + /// The state of snapshot which determines the access availability of the + /// snapshot. + /// Possible values include: 'Unknown', 'Pending', 'Available', + /// 'InstantAccess', 'AvailableWithInstantAccess' + public DiskRestorePoint(string id = default(string), string name = default(string), string type = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), Encryption encryption = default(Encryption), System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), string familyId = default(string), string sourceUniqueId = default(string), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?), string snapshotAccessState = default(string)) : base(id, name, type) { @@ -120,6 +125,7 @@ public DiskRestorePoint() this.SourceResourceLocation = sourceResourceLocation; this.SecurityProfile = securityProfile; this.LogicalSectorSize = logicalSectorSize; + this.SnapshotAccessState = snapshotAccessState; CustomInit(); } @@ -246,6 +252,13 @@ public DiskRestorePoint() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.logicalSectorSize")] public int? LogicalSectorSize {get; private set; } + + /// + /// Gets the state of snapshot which determines the access availability of the + /// snapshot. Possible values include: 'Unknown', 'Pending', 'Available', 'InstantAccess', 'AvailableWithInstantAccess' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotAccessState")] + public string SnapshotAccessState {get; private set; } /// /// Validate the object. /// @@ -271,6 +284,7 @@ public virtual void Validate() + } } } \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs index 683d38d1f686..1237a43996ee 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs @@ -86,7 +86,12 @@ public DiskRestorePointProperties() /// PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the /// default. /// - public DiskRestorePointProperties(System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), string familyId = default(string), string sourceUniqueId = default(string), Encryption encryption = default(Encryption), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?)) + + /// The state of snapshot which determines the access availability of the + /// snapshot. + /// Possible values include: 'Unknown', 'Pending', 'Available', + /// 'InstantAccess', 'AvailableWithInstantAccess' + public DiskRestorePointProperties(System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), string familyId = default(string), string sourceUniqueId = default(string), Encryption encryption = default(Encryption), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?), string snapshotAccessState = default(string)) { this.TimeCreated = timeCreated; @@ -107,6 +112,7 @@ public DiskRestorePointProperties() this.SourceResourceLocation = sourceResourceLocation; this.SecurityProfile = securityProfile; this.LogicalSectorSize = logicalSectorSize; + this.SnapshotAccessState = snapshotAccessState; CustomInit(); } @@ -233,6 +239,13 @@ public DiskRestorePointProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "logicalSectorSize")] public int? LogicalSectorSize {get; private set; } + + /// + /// Gets the state of snapshot which determines the access availability of the + /// snapshot. Possible values include: 'Unknown', 'Pending', 'Available', 'InstantAccess', 'AvailableWithInstantAccess' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotAccessState")] + public string SnapshotAccessState {get; private set; } /// /// Validate the object. /// @@ -258,6 +271,7 @@ public virtual void Validate() + } } } \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs index 8e77b1e71d49..fafe2db692eb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs @@ -34,11 +34,15 @@ public DiskSecurityProfile() /// ResourceId of the disk encryption set associated to Confidential VM /// supported disk encrypted with customer managed key /// - public DiskSecurityProfile(string securityType = default(string), string secureVMDiskEncryptionSetId = default(string)) + + /// Indicates the version of Confidential VM for the resource. + /// Possible values include: 'V1', 'V2' + public DiskSecurityProfile(string securityType = default(string), string secureVMDiskEncryptionSetId = default(string), string confidentialVMVersion = default(string)) { this.SecurityType = securityType; this.SecureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; + this.ConfidentialVMVersion = confidentialVMVersion; CustomInit(); } @@ -61,5 +65,11 @@ public DiskSecurityProfile() /// [Newtonsoft.Json.JsonProperty(PropertyName = "secureVMDiskEncryptionSetId")] public string SecureVMDiskEncryptionSetId {get; set; } + + /// + /// Gets indicates the version of Confidential VM for the resource. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "confidentialVMVersion")] + public string ConfidentialVMVersion {get; private set; } } } \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingAcceptHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingAcceptHeaders.cs new file mode 100644 index 000000000000..d5136e8b4d84 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingAcceptHeaders.cs @@ -0,0 +1,55 @@ +// 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 System.Linq; + + public partial class GallerySharingAcceptHeaders + { + /// + /// Initializes a new instance of the GallerySharingAcceptHeaders class. + /// + public GallerySharingAcceptHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GallerySharingAcceptHeaders class. + /// + + /// + /// + + /// + /// + public GallerySharingAcceptHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingRejectHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingRejectHeaders.cs new file mode 100644 index 000000000000..2d7d1459ae5a --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingRejectHeaders.cs @@ -0,0 +1,55 @@ +// 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 System.Linq; + + public partial class GallerySharingRejectHeaders + { + /// + /// Initializes a new instance of the GallerySharingRejectHeaders class. + /// + public GallerySharingRejectHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GallerySharingRejectHeaders class. + /// + + /// + /// + + /// + /// + public GallerySharingRejectHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicy.cs new file mode 100644 index 000000000000..a447f4ec4a50 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicy.cs @@ -0,0 +1,88 @@ +// 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 System.Linq; + + /// + /// The immutability policy currently applied to a snapshot. + /// + public partial class ImmutabilityPolicy + { + /// + /// Initializes a new instance of the ImmutabilityPolicy class. + /// + public ImmutabilityPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ImmutabilityPolicy class. + /// + + /// The immutability duration for the snapshot, in number of days. + /// + + /// The type of the immutability policy. + /// Possible values include: 'Unlocked', 'Locked' + + /// The time when the immutability policy was set on the snapshot. + /// + + /// The time when the immutability policy will expire on the snapshot. + /// + + /// Indicates whether the immutability policy has expired. + /// + public ImmutabilityPolicy(int? immutabilityDurationDays = default(int?), string type = default(string), System.DateTime? policyStartTime = default(System.DateTime?), System.DateTime? policyExpirationTime = default(System.DateTime?), bool? isPolicyExpired = default(bool?)) + + { + this.ImmutabilityDurationDays = immutabilityDurationDays; + this.Type = type; + this.PolicyStartTime = policyStartTime; + this.PolicyExpirationTime = policyExpirationTime; + this.IsPolicyExpired = isPolicyExpired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the immutability duration for the snapshot, in number of days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "immutabilityDurationDays")] + public int? ImmutabilityDurationDays {get; private set; } + + /// + /// Gets the type of the immutability policy. Possible values include: 'Unlocked', 'Locked' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + + /// + /// Gets the time when the immutability policy was set on the snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "policyStartTime")] + public System.DateTime? PolicyStartTime {get; private set; } + + /// + /// Gets the time when the immutability policy will expire on the snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "policyExpirationTime")] + public System.DateTime? PolicyExpirationTime {get; private set; } + + /// + /// Gets indicates whether the immutability policy has expired. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isPolicyExpired")] + public bool? IsPolicyExpired {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyData.cs new file mode 100644 index 000000000000..4d9785b32b01 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyData.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 System.Linq; + + /// + /// Data used for updating the immutability policy of a snapshot. + /// + public partial class ImmutabilityPolicyData + { + /// + /// Initializes a new instance of the ImmutabilityPolicyData class. + /// + public ImmutabilityPolicyData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ImmutabilityPolicyData class. + /// + + /// The immutability duration for the snapshot, in number of days. + /// + + /// The type of the immutability policy. 'Unlocked' allows the policy to be + /// modified by privileged users; 'Locked' prevents reduction of the + /// immutability duration but allows extension of the lock period. + /// Possible values include: 'Unlocked', 'Locked' + public ImmutabilityPolicyData(int immutabilityDurationDays, string type) + + { + this.ImmutabilityDurationDays = immutabilityDurationDays; + this.Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the immutability duration for the snapshot, in number of days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "immutabilityDurationDays")] + public int ImmutabilityDurationDays {get; set; } + + /// + /// Gets or sets the type of the immutability policy. 'Unlocked' allows the + /// policy to be modified by privileged users; 'Locked' prevents reduction of + /// the immutability duration but allows extension of the lock period. Possible values include: 'Unlocked', 'Locked' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Type == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); + } + if (this.ImmutabilityDurationDays < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ImmutabilityDurationDays", 1); + } + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyLockData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyLockData.cs new file mode 100644 index 000000000000..be3963210642 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyLockData.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 System.Linq; + + /// + /// Data used for locking the immutability policy of a snapshot. + /// + public partial class ImmutabilityPolicyLockData + { + /// + /// Initializes a new instance of the ImmutabilityPolicyLockData class. + /// + public ImmutabilityPolicyLockData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ImmutabilityPolicyLockData class. + /// + + /// The immutability duration for the snapshot, in number of days. + /// + + /// The type of the immutability policy. 'Unlocked' allows the policy to be + /// modified by privileged users; 'Locked' prevents reduction of the + /// immutability duration but allows extension of the lock period. + /// Possible values include: 'Unlocked', 'Locked' + public ImmutabilityPolicyLockData(int immutabilityDurationDays, string type) + + { + this.ImmutabilityDurationDays = immutabilityDurationDays; + this.Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the immutability duration for the snapshot, in number of days. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "immutabilityDurationDays")] + public int ImmutabilityDurationDays {get; set; } + + /// + /// Gets or sets the type of the immutability policy. 'Unlocked' allows the + /// policy to be modified by privileged users; 'Locked' prevents reduction of + /// the immutability duration but allows extension of the lock period. Possible values include: 'Unlocked', 'Locked' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Type == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); + } + if (this.ImmutabilityDurationDays < 0) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "ImmutabilityDurationDays", 0); + } + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyType.cs new file mode 100644 index 000000000000..771c0f9556b5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImmutabilityPolicyType.cs @@ -0,0 +1,27 @@ +// 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 ImmutabilityPolicyType. + /// + + + public static class ImmutabilityPolicyType + { + /// + /// Privileged users can modify the snapshot's immutability policy, if it is + /// unlocked type. + /// + public const string Unlocked = "Unlocked"; + /// + /// The snapshot immutability policy duration cannot be reduced but can be + /// extended. The policy cannot be removed until the lock period expires. + /// + public const string Locked = "Locked"; + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs index 2038f73da4aa..e61b45bce46b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs @@ -25,8 +25,8 @@ public RollingUpgradeRunningStatus() /// /// Code indicating the current status of the upgrade. - /// Possible values include: 'RollingForward', 'Cancelled', 'Completed', - /// 'Faulted' + /// Possible values include: 'RollingForward', 'RollingBack', 'Cancelled', + /// 'Completed', 'Faulted' /// Start time of the upgrade. /// @@ -53,7 +53,7 @@ public RollingUpgradeRunningStatus() /// - /// Gets code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' + /// Gets code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'RollingBack', 'Cancelled', 'Completed', 'Faulted' /// [Newtonsoft.Json.JsonProperty(PropertyName = "code")] public RollingUpgradeStatusCode? Code {get; private set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs index 6707a88dc56a..41faebc3b8a1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs @@ -16,6 +16,8 @@ public enum RollingUpgradeStatusCode { [System.Runtime.Serialization.EnumMember(Value = "RollingForward")] RollingForward, + [System.Runtime.Serialization.EnumMember(Value = "RollingBack")] + RollingBack, [System.Runtime.Serialization.EnumMember(Value = "Cancelled")] Cancelled, [System.Runtime.Serialization.EnumMember(Value = "Completed")] @@ -35,6 +37,8 @@ internal static string ToSerializedValue(this RollingUpgradeStatusCode value) { case RollingUpgradeStatusCode.RollingForward: return "RollingForward"; + case RollingUpgradeStatusCode.RollingBack: + return "RollingBack"; case RollingUpgradeStatusCode.Cancelled: return "Cancelled"; case RollingUpgradeStatusCode.Completed: @@ -50,6 +54,8 @@ internal static string ToSerializedValue(this RollingUpgradeStatusCode value) { case "RollingForward": return RollingUpgradeStatusCode.RollingForward; + case "RollingBack": + return RollingUpgradeStatusCode.RollingBack; case "Cancelled": return RollingUpgradeStatusCode.Cancelled; case "Completed": diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInviteStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInviteStatus.cs new file mode 100644 index 000000000000..28e900f80945 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInviteStatus.cs @@ -0,0 +1,20 @@ +// 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 ShareInviteStatus. + /// + + + public static class ShareInviteStatus + { + public const string Pending = "Pending"; + public const string Accepted = "Accepted"; + public const string Rejected = "Rejected"; + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryInvite.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryInvite.cs new file mode 100644 index 000000000000..1aa96a23a219 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryInvite.cs @@ -0,0 +1,59 @@ +// 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 System.Linq; + + /// + /// Specifies information about the Shared Gallery Subscription that hosts + /// shared galleries shared at subscription level. + /// + public partial class SharedGalleryInvite : PirSharedGalleryResource + { + /// + /// Initializes a new instance of the SharedGalleryInvite class. + /// + public SharedGalleryInvite() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryInvite class. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// The resource-specific properties for this resource. + /// + public SharedGalleryInvite(string name = default(string), string location = default(string), string uniqueId = default(string), SharedGalleryInviteProperties properties = default(SharedGalleryInviteProperties)) + + : base(name, location, uniqueId) + { + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource-specific properties for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SharedGalleryInviteProperties Properties {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryInviteProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryInviteProperties.cs new file mode 100644 index 000000000000..cc1979cf0c0a --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryInviteProperties.cs @@ -0,0 +1,92 @@ +// 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 System.Linq; + + /// + /// The shared gallery invite's properties + /// + public partial class SharedGalleryInviteProperties + { + /// + /// Initializes a new instance of the SharedGalleryInviteProperties class. + /// + public SharedGalleryInviteProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryInviteProperties class. + /// + + /// The type of sharing group. Possible values are: **Subscriptions,** + /// **AADTenants.** + /// Possible values include: 'Subscriptions', 'AADTenants' + + /// id of the subscription that hosts the shared gallery. + /// + + /// shared gallery name that was originally shared. + /// + + /// location of the shared gallery. + /// + + /// The status of the invite. Possible values are: **Pending,** **Accepted,** + /// **Rejected.** + /// Possible values include: 'Pending', 'Accepted', 'Rejected' + public SharedGalleryInviteProperties(string type = default(string), string sharedGallerySubscriptionId = default(string), string sharedGalleryName = default(string), string location = default(string), string status = default(string)) + + { + this.Type = type; + this.SharedGallerySubscriptionId = sharedGallerySubscriptionId; + this.SharedGalleryName = sharedGalleryName; + this.Location = location; + this.Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the type of sharing group. Possible values are: + /// **Subscriptions,** **AADTenants.** Possible values include: 'Subscriptions', 'AADTenants' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets id of the subscription that hosts the shared gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedGallerySubscriptionId")] + public string SharedGallerySubscriptionId {get; set; } + + /// + /// Gets or sets shared gallery name that was originally shared. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedGalleryName")] + public string SharedGalleryName {get; set; } + + /// + /// Gets or sets location of the shared gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets the status of the invite. Possible values are: **Pending,** + /// **Accepted,** **Rejected.** Possible values include: 'Pending', 'Accepted', 'Rejected' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallerySubscription.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallerySubscription.cs new file mode 100644 index 000000000000..fcba262f6e52 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallerySubscription.cs @@ -0,0 +1,59 @@ +// 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 System.Linq; + + /// + /// Specifies information about the Invite for a Shared Gallery shared at + /// subscription level. + /// + public partial class SharedGallerySubscription : PirSharedGalleryResource + { + /// + /// Initializes a new instance of the SharedGallerySubscription class. + /// + public SharedGallerySubscription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGallerySubscription class. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// The resource-specific properties for this resource. + /// + public SharedGallerySubscription(string name = default(string), string location = default(string), string uniqueId = default(string), SharedGallerySubscriptionProperties properties = default(SharedGallerySubscriptionProperties)) + + : base(name, location, uniqueId) + { + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource-specific properties for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SharedGallerySubscriptionProperties Properties {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallerySubscriptionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallerySubscriptionProperties.cs new file mode 100644 index 000000000000..9ab9b6e988a9 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallerySubscriptionProperties.cs @@ -0,0 +1,48 @@ +// 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 System.Linq; + + /// + /// The shared gallery hosting subscription's properties + /// + public partial class SharedGallerySubscriptionProperties + { + /// + /// Initializes a new instance of the SharedGallerySubscriptionProperties class. + /// + public SharedGallerySubscriptionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGallerySubscriptionProperties class. + /// + + /// id of the subscription that hosts the shared gallery. + /// + public SharedGallerySubscriptionProperties(string id = default(string)) + + { + this.Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets id of the subscription that hosts the shared gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs index 97d9f2993f6d..538fb129781f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs @@ -74,6 +74,10 @@ public Snapshot() /// managed keys or platform managed keys. /// + /// The immutability policy currently applied to this snapshot. Present only + /// when an immutability policy has been configured. + /// + /// The time when the snapshot was created. /// @@ -144,7 +148,7 @@ public Snapshot() /// snapshot. /// Possible values include: 'Unknown', 'Pending', 'Available', /// 'InstantAccess', 'AvailableWithInstantAccess' - public Snapshot(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string managedBy = default(string), SnapshotSku sku = default(SnapshotSku), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), CreationData creationData = default(CreationData), string diskState = default(string), Encryption encryption = default(Encryption), System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string)) + public Snapshot(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string managedBy = default(string), SnapshotSku sku = default(SnapshotSku), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), CreationData creationData = default(CreationData), string diskState = default(string), Encryption encryption = default(Encryption), ImmutabilityPolicy immutabilityPolicy = default(ImmutabilityPolicy), System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string)) : base(location, id, name, type, tags) { @@ -156,6 +160,7 @@ public Snapshot() this.CreationData = creationData; this.DiskState = diskState; this.Encryption = encryption; + this.ImmutabilityPolicy = immutabilityPolicy; this.TimeCreated = timeCreated; this.OsType = osType; this.HyperVGeneration = hyperVGeneration; @@ -240,6 +245,13 @@ public Snapshot() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] public Encryption Encryption {get; set; } + /// + /// Gets the immutability policy currently applied to this snapshot. Present + /// only when an immutability policy has been configured. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.immutabilityPolicy")] + public ImmutabilityPolicy ImmutabilityPolicy {get; private set; } + /// /// Gets the time when the snapshot was created. /// @@ -393,6 +405,7 @@ public override void Validate() + if (this.EncryptionSettingsCollection != null) { this.EncryptionSettingsCollection.Validate(); diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs index 99599cad7f0c..9b573a4c7109 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs @@ -114,7 +114,11 @@ public SnapshotProperties() /// snapshot. /// Possible values include: 'Unknown', 'Pending', 'Available', /// 'InstantAccess', 'AvailableWithInstantAccess' - public SnapshotProperties(CreationData creationData, System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string diskState = default(string), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string)) + + /// The immutability policy currently applied to this snapshot. Present only + /// when an immutability policy has been configured. + /// + public SnapshotProperties(CreationData creationData, System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string diskState = default(string), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string), ImmutabilityPolicy immutabilityPolicy = default(ImmutabilityPolicy)) { this.TimeCreated = timeCreated; @@ -141,6 +145,7 @@ public SnapshotProperties() this.CopyCompletionError = copyCompletionError; this.DataAccessAuthMode = dataAccessAuthMode; this.SnapshotAccessState = snapshotAccessState; + this.ImmutabilityPolicy = immutabilityPolicy; CustomInit(); } @@ -311,6 +316,13 @@ public SnapshotProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotAccessState")] public string SnapshotAccessState {get; private set; } + + /// + /// Gets the immutability policy currently applied to this snapshot. Present + /// only when an immutability policy has been configured. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "immutabilityPolicy")] + public ImmutabilityPolicy ImmutabilityPolicy {get; private set; } /// /// Validate the object. /// @@ -353,6 +365,7 @@ public virtual void Validate() } + } } } \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotsUpdateImmutabilityPolicyHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotsUpdateImmutabilityPolicyHeaders.cs new file mode 100644 index 000000000000..dfcaeb3a5ceb --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotsUpdateImmutabilityPolicyHeaders.cs @@ -0,0 +1,65 @@ +// 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 System.Linq; + + public partial class SnapshotsUpdateImmutabilityPolicyHeaders + { + /// + /// Initializes a new instance of the SnapshotsUpdateImmutabilityPolicyHeaders class. + /// + public SnapshotsUpdateImmutabilityPolicyHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotsUpdateImmutabilityPolicyHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public SnapshotsUpdateImmutabilityPolicyHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotsUpdateImmutabilityPolicyLockHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotsUpdateImmutabilityPolicyLockHeaders.cs new file mode 100644 index 000000000000..f449048c0acf --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotsUpdateImmutabilityPolicyLockHeaders.cs @@ -0,0 +1,65 @@ +// 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 System.Linq; + + public partial class SnapshotsUpdateImmutabilityPolicyLockHeaders + { + /// + /// Initializes a new instance of the SnapshotsUpdateImmutabilityPolicyLockHeaders class. + /// + public SnapshotsUpdateImmutabilityPolicyLockHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotsUpdateImmutabilityPolicyLockHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public SnapshotsUpdateImmutabilityPolicyLockHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelGallerySharingAcceptHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelGallerySharingAcceptHeaders.cs new file mode 100644 index 000000000000..9c099b6ef7ab --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelGallerySharingAcceptHeaders.cs @@ -0,0 +1,55 @@ +// 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 System.Linq; + + public partial class TenantLevelGallerySharingAcceptHeaders + { + /// + /// Initializes a new instance of the TenantLevelGallerySharingAcceptHeaders class. + /// + public TenantLevelGallerySharingAcceptHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantLevelGallerySharingAcceptHeaders class. + /// + + /// + /// + + /// + /// + public TenantLevelGallerySharingAcceptHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelGallerySharingRejectHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelGallerySharingRejectHeaders.cs new file mode 100644 index 000000000000..5a83e49bd8a7 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelGallerySharingRejectHeaders.cs @@ -0,0 +1,55 @@ +// 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 System.Linq; + + public partial class TenantLevelGallerySharingRejectHeaders + { + /// + /// Initializes a new instance of the TenantLevelGallerySharingRejectHeaders class. + /// + public TenantLevelGallerySharingRejectHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantLevelGallerySharingRejectHeaders class. + /// + + /// + /// + + /// + /// + public TenantLevelGallerySharingRejectHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelSharedGalleryInvite.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelSharedGalleryInvite.cs new file mode 100644 index 000000000000..1e262e0a7680 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelSharedGalleryInvite.cs @@ -0,0 +1,59 @@ +// 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 System.Linq; + + /// + /// Specifies information about the Invite for a Shared Gallery shared at + /// tenant level. + /// + public partial class TenantLevelSharedGalleryInvite : PirSharedGalleryResource + { + /// + /// Initializes a new instance of the TenantLevelSharedGalleryInvite class. + /// + public TenantLevelSharedGalleryInvite() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantLevelSharedGalleryInvite class. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// The resource-specific properties for this resource. + /// + public TenantLevelSharedGalleryInvite(string name = default(string), string location = default(string), string uniqueId = default(string), SharedGalleryInviteProperties properties = default(SharedGalleryInviteProperties)) + + : base(name, location, uniqueId) + { + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource-specific properties for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SharedGalleryInviteProperties Properties {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelSharedGallerySubscription.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelSharedGallerySubscription.cs new file mode 100644 index 000000000000..02addad713f5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TenantLevelSharedGallerySubscription.cs @@ -0,0 +1,59 @@ +// 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 System.Linq; + + /// + /// Specifies information about the Shared Gallery Subscription that that hosts + /// shared galleries shared at tenant level. + /// + public partial class TenantLevelSharedGallerySubscription : PirSharedGalleryResource + { + /// + /// Initializes a new instance of the TenantLevelSharedGallerySubscription class. + /// + public TenantLevelSharedGallerySubscription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantLevelSharedGallerySubscription class. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// The resource-specific properties for this resource. + /// + public TenantLevelSharedGallerySubscription(string name = default(string), string location = default(string), string uniqueId = default(string), SharedGallerySubscriptionProperties properties = default(SharedGallerySubscriptionProperties)) + + : base(name, location, uniqueId) + { + this.Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource-specific properties for this resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SharedGallerySubscriptionProperties Properties {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs index 3a999e97d1bb..57b2ec57239f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs @@ -25,8 +25,8 @@ public UpgradeOperationHistoryStatus() /// /// Code indicating the current status of the upgrade. - /// Possible values include: 'RollingForward', 'Cancelled', 'Completed', - /// 'Faulted' + /// Possible values include: 'RollingForward', 'RollingBack', 'Cancelled', + /// 'Completed', 'Faulted' /// Start time of the upgrade. /// @@ -49,7 +49,7 @@ public UpgradeOperationHistoryStatus() /// - /// Gets code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' + /// Gets code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'RollingBack', 'Cancelled', 'Completed', 'Faulted' /// [Newtonsoft.Json.JsonProperty(PropertyName = "code")] public UpgradeState? Code {get; private set; } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs index aabcc6a25690..36d6a2584090 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs @@ -16,6 +16,8 @@ public enum UpgradeState { [System.Runtime.Serialization.EnumMember(Value = "RollingForward")] RollingForward, + [System.Runtime.Serialization.EnumMember(Value = "RollingBack")] + RollingBack, [System.Runtime.Serialization.EnumMember(Value = "Cancelled")] Cancelled, [System.Runtime.Serialization.EnumMember(Value = "Completed")] @@ -35,6 +37,8 @@ internal static string ToSerializedValue(this UpgradeState value) { case UpgradeState.RollingForward: return "RollingForward"; + case UpgradeState.RollingBack: + return "RollingBack"; case UpgradeState.Cancelled: return "Cancelled"; case UpgradeState.Completed: @@ -50,6 +54,8 @@ internal static string ToSerializedValue(this UpgradeState value) { case "RollingForward": return UpgradeState.RollingForward; + case "RollingBack": + return UpgradeState.RollingBack; case "Cancelled": return UpgradeState.Cancelled; case "Completed": diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs index d3f31975fd90..d20c30bbdf05 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs @@ -98,7 +98,7 @@ internal SharedGalleriesOperations (ComputeManagementClient client) } } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -323,7 +323,7 @@ internal SharedGalleriesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryUniqueName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.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 c3ff443c13f1..ab8da994d029 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs @@ -115,7 +115,7 @@ internal SharedGalleryImageVersionsOperations (ComputeManagementClient client) } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -364,7 +364,7 @@ internal SharedGalleryImageVersionsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.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 1d02dbe14e5f..6ad7c2842076 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs @@ -106,7 +106,7 @@ internal SharedGalleryImagesOperations (ComputeManagementClient client) } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal SharedGalleryImagesOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs index f5aba33756d7..ecd09277191c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs @@ -79,7 +79,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -293,7 +293,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -519,7 +519,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -808,6 +808,66 @@ internal SnapshotsOperations (ComputeManagementClient client) return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, snapshotName, immutabilityPolicyData, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy lock operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateImmutabilityPolicyLockWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateImmutabilityPolicyLockWithHttpMessagesAsync(resourceGroupName, snapshotName, immutabilityPolicyData, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Creates or updates a snapshot. /// @@ -888,7 +948,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1148,7 +1208,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1398,7 +1458,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1620,7 +1680,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1852,7 +1912,7 @@ internal SnapshotsOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - string apiVersion = "2025-01-02"; + string apiVersion = "2026-03-02"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1992,6 +2052,530 @@ internal SnapshotsOperations (ComputeManagementClient client) + } + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy 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 System.Threading.Tasks.Task> BeginUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (immutabilityPolicyData == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "immutabilityPolicyData"); + } + if (immutabilityPolicyData != null) + { + immutabilityPolicyData.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (snapshotName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); + } + + string apiVersion = "2026-03-02"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("immutabilityPolicyData", immutabilityPolicyData); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateImmutabilityPolicy", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/updateImmutabilityPolicy").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(immutabilityPolicyData != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(immutabilityPolicyData, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// Immutability policy data supplied in the body of the update immutability + /// policy lock 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 System.Threading.Tasks.Task> BeginUpdateImmutabilityPolicyLockWithHttpMessagesAsync(string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (immutabilityPolicyData == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "immutabilityPolicyData"); + } + if (immutabilityPolicyData != null) + { + immutabilityPolicyData.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (snapshotName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); + } + + string apiVersion = "2026-03-02"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("immutabilityPolicyData", immutabilityPolicyData); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateImmutabilityPolicyLock", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/updateImmutabilityPolicyLock").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(immutabilityPolicyData != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(immutabilityPolicyData, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } /// /// Lists snapshots under a subscription. diff --git a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs index 4a6f7e7d6a30..c8016fc9bd9d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs @@ -325,6 +325,100 @@ public static void RevokeAccess(this ISnapshotsOperations operations, string res (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot UpdateImmutabilityPolicy(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData) + { + return ((ISnapshotsOperations)operations).UpdateImmutabilityPolicyAsync(resourceGroupName, snapshotName, immutabilityPolicyData).GetAwaiter().GetResult(); + } + + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateImmutabilityPolicyAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, snapshotName, immutabilityPolicyData, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot UpdateImmutabilityPolicyLock(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData) + { + return ((ISnapshotsOperations)operations).UpdateImmutabilityPolicyLockAsync(resourceGroupName, snapshotName, immutabilityPolicyData).GetAwaiter().GetResult(); + } + + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateImmutabilityPolicyLockAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateImmutabilityPolicyLockWithHttpMessagesAsync(resourceGroupName, snapshotName, immutabilityPolicyData, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates a snapshot. /// /// @@ -534,6 +628,100 @@ public static void BeginRevokeAccess(this ISnapshotsOperations operations, strin (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot BeginUpdateImmutabilityPolicy(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData) + { + return ((ISnapshotsOperations)operations).BeginUpdateImmutabilityPolicyAsync(resourceGroupName, snapshotName, immutabilityPolicyData).GetAwaiter().GetResult(); + } + + /// + /// Updates the immutability policy of a snapshot. Sets or extends an unlocked + /// immutability policy with the specified duration and type. If the snapshot + /// already has a locked policy, the request will be rejected. Use + /// updateImmutabilityPolicyLock to lock an immutability policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateImmutabilityPolicyAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyData immutabilityPolicyData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, snapshotName, immutabilityPolicyData, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot BeginUpdateImmutabilityPolicyLock(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData) + { + return ((ISnapshotsOperations)operations).BeginUpdateImmutabilityPolicyLockAsync(resourceGroupName, snapshotName, immutabilityPolicyData).GetAwaiter().GetResult(); + } + + /// + /// Locks the immutability policy of a snapshot. Once locked, the policy cannot + /// be reduced or removed until the lock period expires. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateImmutabilityPolicyLockAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, ImmutabilityPolicyLockData immutabilityPolicyData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateImmutabilityPolicyLockWithHttpMessagesAsync(resourceGroupName, snapshotName, immutabilityPolicyData, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists snapshots under a subscription. /// /// diff --git a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs index a0491ec60f03..926ff5e1ec68 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs @@ -141,7 +141,7 @@ internal SoftDeletedResourceOperations (ComputeManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "artifactName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-03-03"; + string apiVersion = "2025-12-03"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/Compute/Compute.Management.Sdk/Generated/TenantLevelGallerySharingOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/TenantLevelGallerySharingOperations.cs new file mode 100644 index 000000000000..0e3322c403de --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/TenantLevelGallerySharingOperations.cs @@ -0,0 +1,540 @@ +// 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 System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// TenantLevelGallerySharingOperations operations. + /// + internal partial class TenantLevelGallerySharingOperations : Microsoft.Rest.IServiceOperations, ITenantLevelGallerySharingOperations + { + /// + /// Initializes a new instance of the TenantLevelGallerySharingOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TenantLevelGallerySharingOperations (ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> AcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginAcceptWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRejectWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// 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 System.Threading.Tasks.Task> BeginAcceptWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (sharedGallerySubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sharedGallerySubscriptionId"); + } + if (sharedGallerySubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(sharedGallerySubscriptionId, "^[^_\\W][\\w-._]{0,79}(? tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("location", location); + tracingParameters.Add("sharedGallerySubscriptionId", sharedGallerySubscriptionId); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAccept", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Compute/locations/{location}/tenantLevelSharedGallerySubscriptions/{sharedGallerySubscriptionId}/sharedGalleries/{sharedGalleryName}/accept").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{sharedGallerySubscriptionId}", System.Uri.EscapeDataString(sharedGallerySubscriptionId)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// 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 System.Threading.Tasks.Task> BeginRejectWithHttpMessagesAsync(string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); + } + } + if (sharedGallerySubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sharedGallerySubscriptionId"); + } + if (sharedGallerySubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(sharedGallerySubscriptionId, "^[^_\\W][\\w-._]{0,79}(? tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("location", location); + tracingParameters.Add("sharedGallerySubscriptionId", sharedGallerySubscriptionId); + tracingParameters.Add("sharedGalleryName", sharedGalleryName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReject", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Compute/locations/{location}/tenantLevelSharedGallerySubscriptions/{sharedGallerySubscriptionId}/sharedGalleries/{sharedGalleryName}/reject").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{sharedGallerySubscriptionId}", System.Uri.EscapeDataString(sharedGallerySubscriptionId)); + _url = _url.Replace("{sharedGalleryName}", System.Uri.EscapeDataString(sharedGalleryName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/TenantLevelGallerySharingOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/TenantLevelGallerySharingOperationsExtensions.cs new file mode 100644 index 000000000000..873fc5ab2b24 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/TenantLevelGallerySharingOperationsExtensions.cs @@ -0,0 +1,196 @@ +// 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.Azure; + using Models; + + /// + /// Extension methods for TenantLevelGallerySharingOperations + /// + public static partial class TenantLevelGallerySharingOperationsExtensions + { + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + public static TenantLevelGallerySharingAcceptHeaders Accept(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((ITenantLevelGallerySharingOperations)operations).AcceptAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AcceptAsync(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AcceptWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + public static TenantLevelGallerySharingRejectHeaders Reject(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((ITenantLevelGallerySharingOperations)operations).RejectAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RejectAsync(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RejectWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + public static TenantLevelGallerySharingAcceptHeaders BeginAccept(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((ITenantLevelGallerySharingOperations)operations).BeginAcceptAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Accept sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAcceptAsync(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginAcceptWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + public static TenantLevelGallerySharingRejectHeaders BeginReject(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName) + { + return ((ITenantLevelGallerySharingOperations)operations).BeginRejectAsync(location, sharedGallerySubscriptionId, sharedGalleryName).GetAwaiter().GetResult(); + } + + /// + /// Reject sharing of a tenant-level shared gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the SharedGallerySubscription + /// + /// + /// The name of the TenantLevelSharedGallerySubscription + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRejectAsync(this ITenantLevelGallerySharingOperations operations, string location, string sharedGallerySubscriptionId, string sharedGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRejectWithHttpMessagesAsync(location, sharedGallerySubscriptionId, sharedGalleryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + } +} diff --git a/src/Compute/Compute.Management.Sdk/README.md b/src/Compute/Compute.Management.Sdk/README.md index a30e739491ea..c1610ed29c22 100644 --- a/src/Compute/Compute.Management.Sdk/README.md +++ b/src/Compute/Compute.Management.Sdk/README.md @@ -24,14 +24,14 @@ title: ComputeManagementClient payload-flattening-threshold: 1 # Azure REST API Specs commit -commit: dddc9b49f352a218d85ca501656ad2270c0c2b2a +commit: e2ced4a78ac206eb160fa8bd070c51f5d8de0373 input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/common-types/resource-management/v3/types.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/common-types/v1/common.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-01/ComputeRP.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2025-01-02/DiskRP.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2025-03-03/GalleryRP.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2025-12-03/GalleryRP.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2021-07-01/skus.json output-folder: Generated