diff --git a/profiles/preview/preview/reservations/mgmt/reservations/models.go b/profiles/preview/preview/reservations/mgmt/reservations/models.go index af54cdd1ddbe..c5c939bc4dfb 100644 --- a/profiles/preview/preview/reservations/mgmt/reservations/models.go +++ b/profiles/preview/preview/reservations/mgmt/reservations/models.go @@ -169,10 +169,13 @@ type OrderPurchaseFuture = original.OrderPurchaseFuture type OrderResponse = original.OrderResponse type Patch = original.Patch type PatchProperties = original.PatchProperties +type PatchPropertiesRenewProperties = original.PatchPropertiesRenewProperties type Properties = original.Properties type PurchaseRequest = original.PurchaseRequest type PurchaseRequestProperties = original.PurchaseRequestProperties type PurchaseRequestPropertiesReservedResourceProperties = original.PurchaseRequestPropertiesReservedResourceProperties +type RenewPropertiesResponse = original.RenewPropertiesResponse +type RenewPropertiesResponseLockedPriceTotal = original.RenewPropertiesResponseLockedPriceTotal type ReservationMergeFuture = original.ReservationMergeFuture type ReservationUpdateFuture = original.ReservationUpdateFuture type Response = original.Response diff --git a/services/preview/reservations/mgmt/2019-04-01/reservations/models.go b/services/preview/reservations/mgmt/2019-04-01/reservations/models.go index 13d14926791d..bcc59dbeff20 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/models.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/models.go @@ -1093,7 +1093,14 @@ type PatchProperties struct { // InstanceFlexibility - Possible values include: 'On', 'Off' InstanceFlexibility InstanceFlexibility `json:"instanceFlexibility,omitempty"` // Name - Name of the Reservation - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` + Renew *bool `json:"renew,omitempty"` + RenewProperties *PatchPropertiesRenewProperties `json:"renewProperties,omitempty"` +} + +// PatchPropertiesRenewProperties ... +type PatchPropertiesRenewProperties struct { + PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"` } // Properties ... @@ -1121,6 +1128,13 @@ type Properties struct { ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty"` SplitProperties *SplitPropertiesType `json:"splitProperties,omitempty"` MergeProperties *MergePropertiesType `json:"mergeProperties,omitempty"` + BillingScopeID *string `json:"billingScopeId,omitempty"` + Renew *bool `json:"renew,omitempty"` + // RenewSource - Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + RenewSource *string `json:"renewSource,omitempty"` + // RenewDestination - Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. + RenewDestination *string `json:"renewDestination,omitempty"` + RenewProperties *RenewPropertiesResponse `json:"renewProperties,omitempty"` } // PurchaseRequest ... @@ -1201,6 +1215,7 @@ type PurchaseRequestProperties struct { // AppliedScopeType - Possible values include: 'Single', 'Shared' AppliedScopeType AppliedScopeType `json:"appliedScopeType,omitempty"` AppliedScopes *[]string `json:"appliedScopes,omitempty"` + Renew *bool `json:"renew,omitempty"` // ReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable. ReservedResourceProperties *PurchaseRequestPropertiesReservedResourceProperties `json:"reservedResourceProperties,omitempty"` } @@ -1212,6 +1227,20 @@ type PurchaseRequestPropertiesReservedResourceProperties struct { InstanceFlexibility InstanceFlexibility `json:"instanceFlexibility,omitempty"` } +// RenewPropertiesResponse ... +type RenewPropertiesResponse struct { + PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"` + // LockedPriceTotal - 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. + LockedPriceTotal *RenewPropertiesResponseLockedPriceTotal `json:"lockedPriceTotal,omitempty"` +} + +// RenewPropertiesResponseLockedPriceTotal 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. +type RenewPropertiesResponseLockedPriceTotal struct { + CurrencyCode *string `json:"currencyCode,omitempty"` + Amount *string `json:"amount,omitempty"` +} + // ReservationMergeFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ReservationMergeFuture struct { diff --git a/services/preview/reservations/mgmt/2019-04-01/reservations/reservation.go b/services/preview/reservations/mgmt/2019-04-01/reservations/reservation.go index 7ea4c3a4afef..6a8f6135ad5d 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/reservation.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/reservation.go @@ -44,7 +44,8 @@ func NewClientWithBaseURI(baseURI string) Client { // Parameters: // reservationID - id of the Reservation Item // reservationOrderID - order Id of the reservation -func (client Client) Get(ctx context.Context, reservationID string, reservationOrderID string) (result Response, err error) { +// expand - supported value of this query is renewProperties +func (client Client) Get(ctx context.Context, reservationID string, reservationOrderID string, expand string) (result Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -55,7 +56,7 @@ func (client Client) Get(ctx context.Context, reservationID string, reservationO tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, reservationID, reservationOrderID) + req, err := client.GetPreparer(ctx, reservationID, reservationOrderID, expand) if err != nil { err = autorest.NewErrorWithError(err, "reservations.Client", "Get", nil, "Failure preparing request") return @@ -77,7 +78,7 @@ func (client Client) Get(ctx context.Context, reservationID string, reservationO } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, reservationID string, reservationOrderID string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, reservationID string, reservationOrderID string, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "reservationId": autorest.Encode("path", reservationID), "reservationOrderId": autorest.Encode("path", reservationOrderID), @@ -87,6 +88,9 @@ func (client Client) GetPreparer(ctx context.Context, reservationID string, rese queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(expand) > 0 { + queryParameters["expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go b/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go index fb7faec0646d..8da92d58e3b0 100644 --- a/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go +++ b/services/preview/reservations/mgmt/2019-04-01/reservations/reservationsapi/interfaces.go @@ -42,7 +42,7 @@ var _ OrderClientAPI = (*reservations.OrderClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - Get(ctx context.Context, reservationID string, reservationOrderID string) (result reservations.Response, err error) + Get(ctx context.Context, reservationID string, reservationOrderID string, expand string) (result reservations.Response, err error) List(ctx context.Context, reservationOrderID string) (result reservations.ListPage, err error) ListRevisions(ctx context.Context, reservationID string, reservationOrderID string) (result reservations.ListPage, err error) Merge(ctx context.Context, reservationOrderID string, body reservations.MergeRequest) (result reservations.ReservationMergeFuture, err error)