/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { ReservationRecommendationDetails } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { Term, LookBackPeriod, ReservationRecommendationDetailsGetOptionalParams, ReservationRecommendationDetailsGetResponse } from "../models"; /** Class containing ReservationRecommendationDetails operations. */ export class ReservationRecommendationDetailsImpl implements ReservationRecommendationDetails { private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class ReservationRecommendationDetails class. * @param client Reference to the service client */ constructor(client: ConsumptionManagementClient) { this.client = client; } /** * Details of a reservation recommendation for what-if analysis of reserved instances. * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. * @param product Filter the products for which reservation recommendation results are generated. * Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks) * @param options The options parameters. */ get( scope: string, region: string, term: Term, lookBackPeriod: LookBackPeriod, product: string, options?: ReservationRecommendationDetailsGetOptionalParams ): Promise { return this.client.sendOperationRequest( { scope, region, term, lookBackPeriod, product, options }, getOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ReservationRecommendationDetailsModel }, 204: {}, default: { bodyMapper: Mappers.HighCasedErrorResponse } }, queryParameters: [ Parameters.apiVersion, Parameters.region, Parameters.term, Parameters.lookBackPeriod, Parameters.product ], urlParameters: [Parameters.$host, Parameters.scope], headerParameters: [Parameters.accept], serializer };