@@ -1892,6 +1892,45 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory
18921892 return requestContext ;
18931893 }
18941894
1895+ public async getCustomForecast (
1896+ budgetId : string ,
1897+ _options ?: Configuration
1898+ ) : Promise < RequestContext > {
1899+ const _config = _options || this . configuration ;
1900+
1901+ logger . warn ( "Using unstable operation 'getCustomForecast'" ) ;
1902+ if ( ! _config . unstableOperations [ "v2.getCustomForecast" ] ) {
1903+ throw new Error ( "Unstable operation 'getCustomForecast' is disabled" ) ;
1904+ }
1905+
1906+ // verify required parameter 'budgetId' is not null or undefined
1907+ if ( budgetId === null || budgetId === undefined ) {
1908+ throw new RequiredError ( "budgetId" , "getCustomForecast" ) ;
1909+ }
1910+
1911+ // Path Params
1912+ const localVarPath =
1913+ "/api/v2/cost/budget/{budget_id}/custom-forecast" . replace (
1914+ "{budget_id}" ,
1915+ encodeURIComponent ( String ( budgetId ) )
1916+ ) ;
1917+
1918+ // Make Request Context
1919+ const requestContext = _config
1920+ . getServer ( "v2.CloudCostManagementApi.getCustomForecast" )
1921+ . makeRequestContext ( localVarPath , HttpMethod . GET ) ;
1922+ requestContext . setHeaderParam ( "Accept" , "application/json" ) ;
1923+ requestContext . setHttpConfig ( _config . httpConfig ) ;
1924+
1925+ // Apply auth methods
1926+ applySecurityAuthentication ( _config , requestContext , [
1927+ "apiKeyAuth" ,
1928+ "appKeyAuth" ,
1929+ ] ) ;
1930+
1931+ return requestContext ;
1932+ }
1933+
18951934 public async getTagPipelinesRuleset (
18961935 rulesetId : string ,
18971936 _options ?: Configuration
@@ -5576,6 +5615,68 @@ export class CloudCostManagementApiResponseProcessor {
55765615 ) ;
55775616 }
55785617
5618+ /**
5619+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
5620+ * to the expected objects
5621+ *
5622+ * @params response Response returned by the server for a request to getCustomForecast
5623+ * @throws ApiException if the response code was not in [200, 299]
5624+ */
5625+ public async getCustomForecast (
5626+ response : ResponseContext
5627+ ) : Promise < CustomForecastResponse > {
5628+ const contentType = ObjectSerializer . normalizeMediaType (
5629+ response . headers [ "content-type" ]
5630+ ) ;
5631+ if ( response . httpStatusCode === 200 ) {
5632+ const body : CustomForecastResponse = ObjectSerializer . deserialize (
5633+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
5634+ "CustomForecastResponse"
5635+ ) as CustomForecastResponse ;
5636+ return body ;
5637+ }
5638+ if (
5639+ response . httpStatusCode === 400 ||
5640+ response . httpStatusCode === 404 ||
5641+ response . httpStatusCode === 429
5642+ ) {
5643+ const bodyText = ObjectSerializer . parse (
5644+ await response . body . text ( ) ,
5645+ contentType
5646+ ) ;
5647+ let body : APIErrorResponse ;
5648+ try {
5649+ body = ObjectSerializer . deserialize (
5650+ bodyText ,
5651+ "APIErrorResponse"
5652+ ) as APIErrorResponse ;
5653+ } catch ( error ) {
5654+ logger . debug ( `Got error deserializing error: ${ error } ` ) ;
5655+ throw new ApiException < APIErrorResponse > (
5656+ response . httpStatusCode ,
5657+ bodyText
5658+ ) ;
5659+ }
5660+ throw new ApiException < APIErrorResponse > ( response . httpStatusCode , body ) ;
5661+ }
5662+
5663+ // Work around for missing responses in specification, e.g. for petstore.yaml
5664+ if ( response . httpStatusCode >= 200 && response . httpStatusCode <= 299 ) {
5665+ const body : CustomForecastResponse = ObjectSerializer . deserialize (
5666+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
5667+ "CustomForecastResponse" ,
5668+ ""
5669+ ) as CustomForecastResponse ;
5670+ return body ;
5671+ }
5672+
5673+ const body = ( await response . body . text ( ) ) || "" ;
5674+ throw new ApiException < string > (
5675+ response . httpStatusCode ,
5676+ 'Unknown API Status Code!\nBody: "' + body + '"'
5677+ ) ;
5678+ }
5679+
55795680 /**
55805681 * Unwraps the actual response sent by the server from the response context and deserializes the response content
55815682 * to the expected objects
@@ -8125,6 +8226,14 @@ export interface CloudCostManagementApiGetCustomCostsFileRequest {
81258226 fileId : string ;
81268227}
81278228
8229+ export interface CloudCostManagementApiGetCustomForecastRequest {
8230+ /**
8231+ * Budget id.
8232+ * @type string
8233+ */
8234+ budgetId : string ;
8235+ }
8236+
81288237export interface CloudCostManagementApiGetTagPipelinesRulesetRequest {
81298238 /**
81308239 * The unique identifier of the ruleset
@@ -9311,6 +9420,27 @@ export class CloudCostManagementApi {
93119420 } ) ;
93129421 }
93139422
9423+ /**
9424+ * Get the custom forecast for a budget.
9425+ * @param param The request object
9426+ */
9427+ public getCustomForecast (
9428+ param : CloudCostManagementApiGetCustomForecastRequest ,
9429+ options ?: Configuration
9430+ ) : Promise < CustomForecastResponse > {
9431+ const requestContextPromise = this . requestFactory . getCustomForecast (
9432+ param . budgetId ,
9433+ options
9434+ ) ;
9435+ return requestContextPromise . then ( ( requestContext ) => {
9436+ return this . configuration . httpApi
9437+ . send ( requestContext )
9438+ . then ( ( responseContext ) => {
9439+ return this . responseProcessor . getCustomForecast ( responseContext ) ;
9440+ } ) ;
9441+ } ) ;
9442+ }
9443+
93149444 /**
93159445 * Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID
93169446 * @param param The request object
0 commit comments