@@ -2273,6 +2273,59 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory
22732273 return requestContext ;
22742274 }
22752275
2276+ public async getCustomForecast (
2277+ budgetId : string ,
2278+ _options ?: Configuration ,
2279+ ) : Promise < RequestContext > {
2280+ const _config = _options || this . configuration ;
2281+
2282+ if (
2283+ ! _config . unstableOperations [ "CloudCostManagementApi.v2.getCustomForecast" ]
2284+ ) {
2285+ throw new Error (
2286+ "Unstable operation 'getCustomForecast' is disabled. Enable it by setting `configuration.unstableOperations['CloudCostManagementApi.v2.getCustomForecast'] = true`" ,
2287+ ) ;
2288+ }
2289+
2290+ // verify required parameter 'budgetId' is not null or undefined
2291+ if ( budgetId === null || budgetId === undefined ) {
2292+ throw new RequiredError ( "budgetId" , "getCustomForecast" ) ;
2293+ }
2294+
2295+ // Path Params
2296+ const localVarPath =
2297+ "/api/v2/cost/budget/{budget_id}/custom-forecast" . replace (
2298+ "{budget_id}" ,
2299+ encodeURIComponent ( String ( budgetId ) ) ,
2300+ ) ;
2301+
2302+ // Make Request Context
2303+ const { server, overrides } = _config . getServerAndOverrides (
2304+ "CloudCostManagementApi.v2.getCustomForecast" ,
2305+ CloudCostManagementApi . operationServers ,
2306+ ) ;
2307+ const requestContext = server . makeRequestContext (
2308+ localVarPath ,
2309+ HttpMethod . GET ,
2310+ overrides ,
2311+ ) ;
2312+ requestContext . setHeaderParam ( "Accept" , "application/json" ) ;
2313+ requestContext . setHttpConfig ( _config . httpConfig ) ;
2314+
2315+ // Set User-Agent
2316+ if ( this . userAgent ) {
2317+ requestContext . setHeaderParam ( "User-Agent" , this . userAgent ) ;
2318+ }
2319+
2320+ // Apply auth methods
2321+ applySecurityAuthentication ( _config , requestContext , [
2322+ "apiKeyAuth" ,
2323+ "appKeyAuth" ,
2324+ ] ) ;
2325+
2326+ return requestContext ;
2327+ }
2328+
22762329 public async getTagPipelinesRuleset (
22772330 rulesetId : string ,
22782331 _options ?: Configuration ,
@@ -6224,6 +6277,66 @@ export class CloudCostManagementApiResponseProcessor {
62246277 ) ;
62256278 }
62266279
6280+ /**
6281+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
6282+ * to the expected objects
6283+ *
6284+ * @params response Response returned by the server for a request to getCustomForecast
6285+ * @throws ApiException if the response code was not in [200, 299]
6286+ */
6287+ public async getCustomForecast (
6288+ response : ResponseContext ,
6289+ ) : Promise < CustomForecastResponse > {
6290+ const contentType = normalizeMediaType ( response . headers [ "content-type" ] ) ;
6291+ if ( response . httpStatusCode === 200 ) {
6292+ const body : CustomForecastResponse = deserialize (
6293+ parse ( await response . body . text ( ) , contentType ) ,
6294+ TypingInfo ,
6295+ "CustomForecastResponse" ,
6296+ ) as CustomForecastResponse ;
6297+ return body ;
6298+ }
6299+ if (
6300+ response . httpStatusCode === 400 ||
6301+ response . httpStatusCode === 404 ||
6302+ response . httpStatusCode === 429
6303+ ) {
6304+ const bodyText = parse ( await response . body . text ( ) , contentType ) ;
6305+ let body : APIErrorResponse ;
6306+ try {
6307+ body = deserialize (
6308+ bodyText ,
6309+ TypingInfo ,
6310+ "APIErrorResponse" ,
6311+ ) as APIErrorResponse ;
6312+ } catch ( error ) {
6313+ logger . debug ( `Got error deserializing error: ${ error } ` ) ;
6314+ throw new ApiException < APIErrorResponse > (
6315+ response . httpStatusCode ,
6316+ bodyText ,
6317+ ) ;
6318+ }
6319+ throw new ApiException < APIErrorResponse > ( response . httpStatusCode , body ) ;
6320+ }
6321+
6322+ // Work around for missing responses in specification, e.g. for petstore.yaml
6323+ if ( response . httpStatusCode >= 200 && response . httpStatusCode <= 299 ) {
6324+ const body : CustomForecastResponse = deserialize (
6325+ parse ( await response . body . text ( ) , contentType ) ,
6326+ TypingInfo ,
6327+ "CustomForecastResponse" ,
6328+ "" ,
6329+ ) as CustomForecastResponse ;
6330+ return body ;
6331+ }
6332+
6333+ const body = ( await response . body . text ( ) ) || "" ;
6334+ throw new ApiException < string > (
6335+ response . httpStatusCode ,
6336+ 'Unknown API Status Code!\nBody: "' + body + '"' ,
6337+ ) ;
6338+ }
6339+
62276340 /**
62286341 * Unwraps the actual response sent by the server from the response context and deserializes the response content
62296342 * to the expected objects
@@ -8695,6 +8808,14 @@ export interface CloudCostManagementApiGetCustomCostsFileRequest {
86958808 fileId : string ;
86968809}
86978810
8811+ export interface CloudCostManagementApiGetCustomForecastRequest {
8812+ /**
8813+ * Budget id.
8814+ * @type string
8815+ */
8816+ budgetId : string ;
8817+ }
8818+
86988819export interface CloudCostManagementApiGetTagPipelinesRulesetRequest {
86998820 /**
87008821 * The unique identifier of the ruleset
@@ -9884,6 +10005,27 @@ export class CloudCostManagementApi {
988410005 } ) ;
988510006 }
988610007
10008+ /**
10009+ * Get the custom forecast for a budget.
10010+ * @param param The request object
10011+ */
10012+ public getCustomForecast (
10013+ param : CloudCostManagementApiGetCustomForecastRequest ,
10014+ options ?: Configuration ,
10015+ ) : Promise < CustomForecastResponse > {
10016+ const requestContextPromise = this . requestFactory . getCustomForecast (
10017+ param . budgetId ,
10018+ options ,
10019+ ) ;
10020+ return requestContextPromise . then ( ( requestContext ) => {
10021+ return this . configuration . httpApi
10022+ . send ( requestContext )
10023+ . then ( ( responseContext ) => {
10024+ return this . responseProcessor . getCustomForecast ( responseContext ) ;
10025+ } ) ;
10026+ } ) ;
10027+ }
10028+
988710029 /**
988810030 * Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID
988910031 * @param param The request object
0 commit comments