From aab0fcd7555708d5a8d04baa24ecc162e6aa1f87 Mon Sep 17 00:00:00 2001
From: adxsdknet <39844661+adxsdknet@users.noreply.github.com>
Date: Tue, 23 Apr 2019 16:32:13 -0700
Subject: [PATCH] .NET SDK Resource Provider:'Reservations' (#5919)
REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5745'
REST Spec PR Author 'gautam714'
REST Spec PR Last commit
---
.../Generated/IReservationOperations.cs | 5 +-
.../Generated/Models/Patch.cs | 14 +---
.../Generated/Models/PurchaseRequest.cs | 8 +--
.../Models/RenewPropertiesResponse.cs | 68 ------------------
.../Models/RenewPropertiesResponseLinks.cs | 69 -------------------
...RenewPropertiesResponseLockedPriceTotal.cs | 59 ----------------
.../Generated/Models/ReservationProperties.cs | 14 +---
.../Generated/ReservationOperations.cs | 10 +--
.../ReservationOperationsExtensions.cs | 14 ++--
9 files changed, 9 insertions(+), 252 deletions(-)
delete mode 100644 src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponse.cs
delete mode 100644 src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLinks.cs
delete mode 100644 src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLockedPriceTotal.cs
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/IReservationOperations.cs b/src/SDKs/Reservations/Management.Reservations/Generated/IReservationOperations.cs
index abc19f97c2282..07966d444332f 100644
--- a/src/SDKs/Reservations/Management.Reservations/Generated/IReservationOperations.cs
+++ b/src/SDKs/Reservations/Management.Reservations/Generated/IReservationOperations.cs
@@ -118,9 +118,6 @@ public partial interface IReservationOperations
///
/// Order Id of the reservation
///
- ///
- /// Supported value of this query is renewProperties
- ///
///
/// The headers that will be added to request.
///
@@ -136,7 +133,7 @@ public partial interface IReservationOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string reservationId, string reservationOrderId, string append = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string reservationId, string reservationOrderId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Updates a `Reservation`.
///
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/Models/Patch.cs b/src/SDKs/Reservations/Management.Reservations/Generated/Models/Patch.cs
index 8f7e3166a5431..03e58a9113ac5 100644
--- a/src/SDKs/Reservations/Management.Reservations/Generated/Models/Patch.cs
+++ b/src/SDKs/Reservations/Management.Reservations/Generated/Models/Patch.cs
@@ -36,12 +36,10 @@ public Patch()
/// Possible values include: 'On',
/// 'Off'
/// Name of the Reservation
- public Patch(string appliedScopeType = default(string), IList appliedScopes = default(IList), bool? renew = default(bool?), PurchaseRequest renewProperties = default(PurchaseRequest), string instanceFlexibility = default(string), string name = default(string))
+ public Patch(string appliedScopeType = default(string), IList appliedScopes = default(IList), string instanceFlexibility = default(string), string name = default(string))
{
AppliedScopeType = appliedScopeType;
AppliedScopes = appliedScopes;
- Renew = renew;
- RenewProperties = renewProperties;
InstanceFlexibility = instanceFlexibility;
Name = name;
CustomInit();
@@ -63,16 +61,6 @@ public Patch()
[JsonProperty(PropertyName = "properties.appliedScopes")]
public IList AppliedScopes { get; set; }
- ///
- ///
- [JsonProperty(PropertyName = "properties.renew")]
- public bool? Renew { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "properties.renewProperties")]
- public PurchaseRequest RenewProperties { get; set; }
-
///
/// Gets or sets possible values include: 'On', 'Off'
///
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/Models/PurchaseRequest.cs b/src/SDKs/Reservations/Management.Reservations/Generated/Models/PurchaseRequest.cs
index 09ab9459c6b7a..ea8f3d3e65a61 100644
--- a/src/SDKs/Reservations/Management.Reservations/Generated/Models/PurchaseRequest.cs
+++ b/src/SDKs/Reservations/Management.Reservations/Generated/Models/PurchaseRequest.cs
@@ -42,7 +42,7 @@ public PurchaseRequest()
/// Properties specific to
/// each reserved resource type. Not required if not
/// applicable.
- public PurchaseRequest(SkuName sku = default(SkuName), string location = default(string), string reservedResourceType = default(string), string billingScopeId = default(string), string term = default(string), int? quantity = default(int?), string displayName = default(string), string appliedScopeType = default(string), IList appliedScopes = default(IList), bool? renew = default(bool?), PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties = default(PurchaseRequestPropertiesReservedResourceProperties))
+ public PurchaseRequest(SkuName sku = default(SkuName), string location = default(string), string reservedResourceType = default(string), string billingScopeId = default(string), string term = default(string), int? quantity = default(int?), string displayName = default(string), string appliedScopeType = default(string), IList appliedScopes = default(IList), PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties = default(PurchaseRequestPropertiesReservedResourceProperties))
{
Sku = sku;
Location = location;
@@ -53,7 +53,6 @@ public PurchaseRequest()
DisplayName = displayName;
AppliedScopeType = appliedScopeType;
AppliedScopes = appliedScopes;
- Renew = renew;
ReservedResourceProperties = reservedResourceProperties;
CustomInit();
}
@@ -114,11 +113,6 @@ public PurchaseRequest()
[JsonProperty(PropertyName = "properties.appliedScopes")]
public IList AppliedScopes { get; set; }
- ///
- ///
- [JsonProperty(PropertyName = "properties.renew")]
- public bool? Renew { get; set; }
-
///
/// Gets or sets properties specific to each reserved resource type.
/// Not required if not applicable.
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponse.cs b/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponse.cs
deleted file mode 100644
index 5d5e2d775436c..0000000000000
--- a/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponse.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// 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.Reservations.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class RenewPropertiesResponse
- {
- ///
- /// Initializes a new instance of the RenewPropertiesResponse class.
- ///
- public RenewPropertiesResponse()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the RenewPropertiesResponse class.
- ///
- /// Locked currency & amount for new
- /// reservation purchase at the time of renewal. Price is locked 30
- /// days before expiry date time if renew is true.
- /// Contains prev and next reservation Ids' because
- /// of renewal.
- public RenewPropertiesResponse(PurchaseRequest purchaseProperties = default(PurchaseRequest), RenewPropertiesResponseLockedPriceTotal lockedPriceTotal = default(RenewPropertiesResponseLockedPriceTotal), RenewPropertiesResponseLinks links = default(RenewPropertiesResponseLinks))
- {
- PurchaseProperties = purchaseProperties;
- LockedPriceTotal = lockedPriceTotal;
- Links = links;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- ///
- [JsonProperty(PropertyName = "purchaseProperties")]
- public PurchaseRequest PurchaseProperties { get; set; }
-
- ///
- /// Gets or sets locked currency & amount for new reservation
- /// purchase at the time of renewal. Price is locked 30 days before
- /// expiry date time if renew is true.
- ///
- [JsonProperty(PropertyName = "lockedPriceTotal")]
- public RenewPropertiesResponseLockedPriceTotal LockedPriceTotal { get; set; }
-
- ///
- /// Gets or sets contains prev and next reservation Ids' because of
- /// renewal.
- ///
- [JsonProperty(PropertyName = "links")]
- public RenewPropertiesResponseLinks Links { get; set; }
-
- }
-}
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLinks.cs b/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLinks.cs
deleted file mode 100644
index 36f714ce40875..0000000000000
--- a/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLinks.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// 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.Reservations.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Contains prev and next reservation Ids' because of renewal.
- ///
- public partial class RenewPropertiesResponseLinks
- {
- ///
- /// Initializes a new instance of the RenewPropertiesResponseLinks
- /// class.
- ///
- public RenewPropertiesResponseLinks()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the RenewPropertiesResponseLinks
- /// class.
- ///
- /// Reservation Id of the reservation from
- /// which this reservation is renewed. Format of the resource Id is
- /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
- /// Reservation Id of the reservation
- /// which is purchased because of renew. Format of the resource Id is
- /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
- public RenewPropertiesResponseLinks(string renewSource = default(string), string renewDestination = default(string))
- {
- RenewSource = renewSource;
- RenewDestination = renewDestination;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets reservation Id of the reservation from which this
- /// reservation is renewed. Format of the resource Id is
- /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
- ///
- [JsonProperty(PropertyName = "renewSource")]
- public string RenewSource { get; set; }
-
- ///
- /// Gets or sets reservation Id of the reservation which is purchased
- /// because of renew. Format of the resource Id is
- /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
- ///
- [JsonProperty(PropertyName = "renewDestination")]
- public string RenewDestination { get; set; }
-
- }
-}
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLockedPriceTotal.cs b/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLockedPriceTotal.cs
deleted file mode 100644
index 8bbee53a0fd54..0000000000000
--- a/src/SDKs/Reservations/Management.Reservations/Generated/Models/RenewPropertiesResponseLockedPriceTotal.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// 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.Reservations.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Locked currency & amount for new reservation purchase at the time
- /// of renewal. Price is locked 30 days before expiry date time if renew is
- /// true.
- ///
- public partial class RenewPropertiesResponseLockedPriceTotal
- {
- ///
- /// Initializes a new instance of the
- /// RenewPropertiesResponseLockedPriceTotal class.
- ///
- public RenewPropertiesResponseLockedPriceTotal()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the
- /// RenewPropertiesResponseLockedPriceTotal class.
- ///
- public RenewPropertiesResponseLockedPriceTotal(string currencyCode = default(string), string amount = default(string))
- {
- CurrencyCode = currencyCode;
- Amount = amount;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- ///
- [JsonProperty(PropertyName = "currencyCode")]
- public string CurrencyCode { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "amount")]
- public string Amount { get; set; }
-
- }
-}
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/Models/ReservationProperties.cs b/src/SDKs/Reservations/Management.Reservations/Generated/Models/ReservationProperties.cs
index 8e5a012352d80..f1e82e4bc6ef7 100644
--- a/src/SDKs/Reservations/Management.Reservations/Generated/Models/ReservationProperties.cs
+++ b/src/SDKs/Reservations/Management.Reservations/Generated/Models/ReservationProperties.cs
@@ -48,7 +48,7 @@ public ReservationProperties()
/// expire.
/// Description of the SKU in
/// english.
- public ReservationProperties(string reservedResourceType = default(string), string instanceFlexibility = default(string), string displayName = default(string), IList appliedScopes = default(IList), string appliedScopeType = default(string), int? quantity = default(int?), string provisioningState = default(string), System.DateTime? effectiveDateTime = default(System.DateTime?), System.DateTime? lastUpdatedDateTime = default(System.DateTime?), System.DateTime? expiryDate = default(System.DateTime?), string skuDescription = default(string), ExtendedStatusInfo extendedStatusInfo = default(ExtendedStatusInfo), ReservationSplitProperties splitProperties = default(ReservationSplitProperties), ReservationMergeProperties mergeProperties = default(ReservationMergeProperties), bool? renew = default(bool?), RenewPropertiesResponse renewProperties = default(RenewPropertiesResponse))
+ public ReservationProperties(string reservedResourceType = default(string), string instanceFlexibility = default(string), string displayName = default(string), IList appliedScopes = default(IList), string appliedScopeType = default(string), int? quantity = default(int?), string provisioningState = default(string), System.DateTime? effectiveDateTime = default(System.DateTime?), System.DateTime? lastUpdatedDateTime = default(System.DateTime?), System.DateTime? expiryDate = default(System.DateTime?), string skuDescription = default(string), ExtendedStatusInfo extendedStatusInfo = default(ExtendedStatusInfo), ReservationSplitProperties splitProperties = default(ReservationSplitProperties), ReservationMergeProperties mergeProperties = default(ReservationMergeProperties))
{
ReservedResourceType = reservedResourceType;
InstanceFlexibility = instanceFlexibility;
@@ -64,8 +64,6 @@ public ReservationProperties()
ExtendedStatusInfo = extendedStatusInfo;
SplitProperties = splitProperties;
MergeProperties = mergeProperties;
- Renew = renew;
- RenewProperties = renewProperties;
CustomInit();
}
@@ -157,15 +155,5 @@ public ReservationProperties()
[JsonProperty(PropertyName = "mergeProperties")]
public ReservationMergeProperties MergeProperties { get; set; }
- ///
- ///
- [JsonProperty(PropertyName = "renew")]
- public bool? Renew { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "renewProperties")]
- public RenewPropertiesResponse RenewProperties { get; set; }
-
}
}
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperations.cs b/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperations.cs
index 81e2acb66db8c..88489d2a9964a 100644
--- a/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperations.cs
+++ b/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperations.cs
@@ -294,9 +294,6 @@ internal ReservationOperations(AzureReservationAPIClient client)
///
/// Order Id of the reservation
///
- ///
- /// Supported value of this query is renewProperties
- ///
///
/// Headers that will be added to request.
///
@@ -318,7 +315,7 @@ internal ReservationOperations(AzureReservationAPIClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string reservationId, string reservationOrderId, string append = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string reservationId, string reservationOrderId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (reservationId == null)
{
@@ -341,7 +338,6 @@ internal ReservationOperations(AzureReservationAPIClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("reservationId", reservationId);
tracingParameters.Add("reservationOrderId", reservationOrderId);
- tracingParameters.Add("append", append);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -355,10 +351,6 @@ internal ReservationOperations(AzureReservationAPIClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
- if (append != null)
- {
- _queryParameters.Add(string.Format("append={0}", System.Uri.EscapeDataString(append)));
- }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
diff --git a/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperationsExtensions.cs b/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperationsExtensions.cs
index e9371d484316e..f26c1c8a2b819 100644
--- a/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperationsExtensions.cs
+++ b/src/SDKs/Reservations/Management.Reservations/Generated/ReservationOperationsExtensions.cs
@@ -174,12 +174,9 @@ public static IPage List(this IReservationOperations operat
///
/// Order Id of the reservation
///
- ///
- /// Supported value of this query is renewProperties
- ///
- public static ReservationResponse Get(this IReservationOperations operations, string reservationId, string reservationOrderId, string append = default(string))
+ public static ReservationResponse Get(this IReservationOperations operations, string reservationId, string reservationOrderId)
{
- return operations.GetAsync(reservationId, reservationOrderId, append).GetAwaiter().GetResult();
+ return operations.GetAsync(reservationId, reservationOrderId).GetAwaiter().GetResult();
}
///
@@ -197,15 +194,12 @@ public static IPage List(this IReservationOperations operat
///
/// Order Id of the reservation
///
- ///
- /// Supported value of this query is renewProperties
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IReservationOperations operations, string reservationId, string reservationOrderId, string append = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IReservationOperations operations, string reservationId, string reservationOrderId, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(reservationId, reservationOrderId, append, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(reservationId, reservationOrderId, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}