@@ -702,6 +702,102 @@ func (a *CloudCostManagementApi) DeleteCostGCPUsageCostConfig(ctx _context.Conte
702702 return localVarHTTPResponse , nil
703703}
704704
705+ // DeleteCostTagDescriptionByKeyOptionalParameters holds optional parameters for DeleteCostTagDescriptionByKey.
706+ type DeleteCostTagDescriptionByKeyOptionalParameters struct {
707+ Cloud * string
708+ }
709+
710+ // NewDeleteCostTagDescriptionByKeyOptionalParameters creates an empty struct for parameters.
711+ func NewDeleteCostTagDescriptionByKeyOptionalParameters () * DeleteCostTagDescriptionByKeyOptionalParameters {
712+ this := DeleteCostTagDescriptionByKeyOptionalParameters {}
713+ return & this
714+ }
715+
716+ // WithCloud sets the corresponding parameter name and returns the struct.
717+ func (r * DeleteCostTagDescriptionByKeyOptionalParameters ) WithCloud (cloud string ) * DeleteCostTagDescriptionByKeyOptionalParameters {
718+ r .Cloud = & cloud
719+ return r
720+ }
721+
722+ // DeleteCostTagDescriptionByKey Delete a Cloud Cost Management tag description.
723+ // Delete a Cloud Cost Management tag key description. When `cloud` is omitted, deletes every description for the tag key, falling back to Datadog's global default when available. When `cloud` is provided, deletes only the description scoped to that cloud provider.
724+ func (a * CloudCostManagementApi ) DeleteCostTagDescriptionByKey (ctx _context.Context , tagKey string , o ... DeleteCostTagDescriptionByKeyOptionalParameters ) (* _nethttp.Response , error ) {
725+ var (
726+ localVarHTTPMethod = _nethttp .MethodDelete
727+ localVarPostBody interface {}
728+ optionalParams DeleteCostTagDescriptionByKeyOptionalParameters
729+ )
730+
731+ if len (o ) > 1 {
732+ return nil , datadog .ReportError ("only one argument of type DeleteCostTagDescriptionByKeyOptionalParameters is allowed" )
733+ }
734+ if len (o ) == 1 {
735+ optionalParams = o [0 ]
736+ }
737+
738+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.CloudCostManagementApi.DeleteCostTagDescriptionByKey" )
739+ if err != nil {
740+ return nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
741+ }
742+
743+ localVarPath := localBasePath + "/api/v2/cost/tag_descriptions/{tag_key}"
744+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{tag_key}" , _neturl .PathEscape (datadog .ParameterToString (tagKey , "" )))
745+
746+ localVarHeaderParams := make (map [string ]string )
747+ localVarQueryParams := _neturl.Values {}
748+ localVarFormParams := _neturl.Values {}
749+ if optionalParams .Cloud != nil {
750+ localVarQueryParams .Add ("cloud" , datadog .ParameterToString (* optionalParams .Cloud , "" ))
751+ }
752+ localVarHeaderParams ["Accept" ] = "*/*"
753+
754+ if a .Client .Cfg .DelegatedTokenConfig != nil {
755+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
756+ if err != nil {
757+ return nil , err
758+ }
759+ } else {
760+ datadog .SetAuthKeys (
761+ ctx ,
762+ & localVarHeaderParams ,
763+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
764+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
765+ )
766+ }
767+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
768+ if err != nil {
769+ return nil , err
770+ }
771+
772+ localVarHTTPResponse , err := a .Client .CallAPI (req )
773+ if err != nil || localVarHTTPResponse == nil {
774+ return localVarHTTPResponse , err
775+ }
776+
777+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
778+ if err != nil {
779+ return localVarHTTPResponse , err
780+ }
781+
782+ if localVarHTTPResponse .StatusCode >= 300 {
783+ newErr := datadog.GenericOpenAPIError {
784+ ErrorBody : localVarBody ,
785+ ErrorMessage : localVarHTTPResponse .Status ,
786+ }
787+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 429 {
788+ var v APIErrorResponse
789+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
790+ if err != nil {
791+ return localVarHTTPResponse , newErr
792+ }
793+ newErr .ErrorModel = v
794+ }
795+ return localVarHTTPResponse , newErr
796+ }
797+
798+ return localVarHTTPResponse , nil
799+ }
800+
705801// DeleteCustomAllocationRule Delete custom allocation rule.
706802// Delete a custom allocation rule - Delete an existing custom allocation rule by its ID
707803func (a * CloudCostManagementApi ) DeleteCustomAllocationRule (ctx _context.Context , ruleId int64 ) (* _nethttp.Response , error ) {
@@ -906,6 +1002,84 @@ func (a *CloudCostManagementApi) DeleteTagPipelinesRuleset(ctx _context.Context,
9061002 return localVarHTTPResponse , nil
9071003}
9081004
1005+ // GenerateCostTagDescriptionByKey Generate a Cloud Cost Management tag description.
1006+ // Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The generated description is returned in the response and is not persisted by this endpoint; follow up with `UpsertCostTagDescriptionByKey` to save it.
1007+ func (a * CloudCostManagementApi ) GenerateCostTagDescriptionByKey (ctx _context.Context , tagKey string ) (GenerateCostTagDescriptionResponse , * _nethttp.Response , error ) {
1008+ var (
1009+ localVarHTTPMethod = _nethttp .MethodGet
1010+ localVarPostBody interface {}
1011+ localVarReturnValue GenerateCostTagDescriptionResponse
1012+ )
1013+
1014+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.CloudCostManagementApi.GenerateCostTagDescriptionByKey" )
1015+ if err != nil {
1016+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
1017+ }
1018+
1019+ localVarPath := localBasePath + "/api/v2/cost/tag_descriptions/{tag_key}/generate"
1020+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{tag_key}" , _neturl .PathEscape (datadog .ParameterToString (tagKey , "" )))
1021+
1022+ localVarHeaderParams := make (map [string ]string )
1023+ localVarQueryParams := _neturl.Values {}
1024+ localVarFormParams := _neturl.Values {}
1025+ localVarHeaderParams ["Accept" ] = "application/json"
1026+
1027+ if a .Client .Cfg .DelegatedTokenConfig != nil {
1028+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
1029+ if err != nil {
1030+ return localVarReturnValue , nil , err
1031+ }
1032+ } else {
1033+ datadog .SetAuthKeys (
1034+ ctx ,
1035+ & localVarHeaderParams ,
1036+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
1037+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
1038+ )
1039+ }
1040+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
1041+ if err != nil {
1042+ return localVarReturnValue , nil , err
1043+ }
1044+
1045+ localVarHTTPResponse , err := a .Client .CallAPI (req )
1046+ if err != nil || localVarHTTPResponse == nil {
1047+ return localVarReturnValue , localVarHTTPResponse , err
1048+ }
1049+
1050+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
1051+ if err != nil {
1052+ return localVarReturnValue , localVarHTTPResponse , err
1053+ }
1054+
1055+ if localVarHTTPResponse .StatusCode >= 300 {
1056+ newErr := datadog.GenericOpenAPIError {
1057+ ErrorBody : localVarBody ,
1058+ ErrorMessage : localVarHTTPResponse .Status ,
1059+ }
1060+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 429 {
1061+ var v APIErrorResponse
1062+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1063+ if err != nil {
1064+ return localVarReturnValue , localVarHTTPResponse , newErr
1065+ }
1066+ newErr .ErrorModel = v
1067+ }
1068+ return localVarReturnValue , localVarHTTPResponse , newErr
1069+ }
1070+
1071+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1072+ if err != nil {
1073+ newErr := datadog.GenericOpenAPIError {
1074+ ErrorBody : localVarBody ,
1075+ ErrorMessage : err .Error (),
1076+ }
1077+ return localVarReturnValue , localVarHTTPResponse , newErr
1078+ }
1079+
1080+ return localVarReturnValue , localVarHTTPResponse , nil
1081+ }
1082+
9091083// GetBudget Get budget.
9101084// Get a budget
9111085func (a * CloudCostManagementApi ) GetBudget (ctx _context.Context , budgetId string ) (BudgetWithEntries , * _nethttp.Response , error ) {
@@ -2351,6 +2525,112 @@ func (a *CloudCostManagementApi) GetCostGCPUsageCostConfig(ctx _context.Context,
23512525 return localVarReturnValue , localVarHTTPResponse , nil
23522526}
23532527
2528+ // GetCostTagDescriptionByKeyOptionalParameters holds optional parameters for GetCostTagDescriptionByKey.
2529+ type GetCostTagDescriptionByKeyOptionalParameters struct {
2530+ FilterCloud * string
2531+ }
2532+
2533+ // NewGetCostTagDescriptionByKeyOptionalParameters creates an empty struct for parameters.
2534+ func NewGetCostTagDescriptionByKeyOptionalParameters () * GetCostTagDescriptionByKeyOptionalParameters {
2535+ this := GetCostTagDescriptionByKeyOptionalParameters {}
2536+ return & this
2537+ }
2538+
2539+ // WithFilterCloud sets the corresponding parameter name and returns the struct.
2540+ func (r * GetCostTagDescriptionByKeyOptionalParameters ) WithFilterCloud (filterCloud string ) * GetCostTagDescriptionByKeyOptionalParameters {
2541+ r .FilterCloud = & filterCloud
2542+ return r
2543+ }
2544+
2545+ // GetCostTagDescriptionByKey Get a Cloud Cost Management tag description.
2546+ // Get the Cloud Cost Management description for a single tag key. Use `filter[cloud]` to scope the lookup to a specific cloud provider; when omitted, the response resolves the description in fallback order (cloud-specific organization override, then cloudless organization default, then Datadog's global default).
2547+ func (a * CloudCostManagementApi ) GetCostTagDescriptionByKey (ctx _context.Context , tagKey string , o ... GetCostTagDescriptionByKeyOptionalParameters ) (CostTagDescriptionResponse , * _nethttp.Response , error ) {
2548+ var (
2549+ localVarHTTPMethod = _nethttp .MethodGet
2550+ localVarPostBody interface {}
2551+ localVarReturnValue CostTagDescriptionResponse
2552+ optionalParams GetCostTagDescriptionByKeyOptionalParameters
2553+ )
2554+
2555+ if len (o ) > 1 {
2556+ return localVarReturnValue , nil , datadog .ReportError ("only one argument of type GetCostTagDescriptionByKeyOptionalParameters is allowed" )
2557+ }
2558+ if len (o ) == 1 {
2559+ optionalParams = o [0 ]
2560+ }
2561+
2562+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.CloudCostManagementApi.GetCostTagDescriptionByKey" )
2563+ if err != nil {
2564+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
2565+ }
2566+
2567+ localVarPath := localBasePath + "/api/v2/cost/tag_descriptions/{tag_key}"
2568+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{tag_key}" , _neturl .PathEscape (datadog .ParameterToString (tagKey , "" )))
2569+
2570+ localVarHeaderParams := make (map [string ]string )
2571+ localVarQueryParams := _neturl.Values {}
2572+ localVarFormParams := _neturl.Values {}
2573+ if optionalParams .FilterCloud != nil {
2574+ localVarQueryParams .Add ("filter[cloud]" , datadog .ParameterToString (* optionalParams .FilterCloud , "" ))
2575+ }
2576+ localVarHeaderParams ["Accept" ] = "application/json"
2577+
2578+ if a .Client .Cfg .DelegatedTokenConfig != nil {
2579+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
2580+ if err != nil {
2581+ return localVarReturnValue , nil , err
2582+ }
2583+ } else {
2584+ datadog .SetAuthKeys (
2585+ ctx ,
2586+ & localVarHeaderParams ,
2587+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
2588+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
2589+ )
2590+ }
2591+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
2592+ if err != nil {
2593+ return localVarReturnValue , nil , err
2594+ }
2595+
2596+ localVarHTTPResponse , err := a .Client .CallAPI (req )
2597+ if err != nil || localVarHTTPResponse == nil {
2598+ return localVarReturnValue , localVarHTTPResponse , err
2599+ }
2600+
2601+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
2602+ if err != nil {
2603+ return localVarReturnValue , localVarHTTPResponse , err
2604+ }
2605+
2606+ if localVarHTTPResponse .StatusCode >= 300 {
2607+ newErr := datadog.GenericOpenAPIError {
2608+ ErrorBody : localVarBody ,
2609+ ErrorMessage : localVarHTTPResponse .Status ,
2610+ }
2611+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 429 {
2612+ var v APIErrorResponse
2613+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
2614+ if err != nil {
2615+ return localVarReturnValue , localVarHTTPResponse , newErr
2616+ }
2617+ newErr .ErrorModel = v
2618+ }
2619+ return localVarReturnValue , localVarHTTPResponse , newErr
2620+ }
2621+
2622+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
2623+ if err != nil {
2624+ newErr := datadog.GenericOpenAPIError {
2625+ ErrorBody : localVarBody ,
2626+ ErrorMessage : err .Error (),
2627+ }
2628+ return localVarReturnValue , localVarHTTPResponse , newErr
2629+ }
2630+
2631+ return localVarReturnValue , localVarHTTPResponse , nil
2632+ }
2633+
23542634// GetCostTagKeyOptionalParameters holds optional parameters for GetCostTagKey.
23552635type GetCostTagKeyOptionalParameters struct {
23562636 FilterMetric * string
@@ -5712,6 +5992,77 @@ func (a *CloudCostManagementApi) UpsertBudget(ctx _context.Context, body BudgetW
57125992 return localVarReturnValue , localVarHTTPResponse , nil
57135993}
57145994
5995+ // UpsertCostTagDescriptionByKey Upsert a Cloud Cost Management tag description.
5996+ // Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit `cloud` to set a cross-cloud default for the tag key.
5997+ func (a * CloudCostManagementApi ) UpsertCostTagDescriptionByKey (ctx _context.Context , tagKey string , body CostTagDescriptionUpsertRequest ) (* _nethttp.Response , error ) {
5998+ var (
5999+ localVarHTTPMethod = _nethttp .MethodPut
6000+ localVarPostBody interface {}
6001+ )
6002+
6003+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.CloudCostManagementApi.UpsertCostTagDescriptionByKey" )
6004+ if err != nil {
6005+ return nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
6006+ }
6007+
6008+ localVarPath := localBasePath + "/api/v2/cost/tag_descriptions/{tag_key}"
6009+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{tag_key}" , _neturl .PathEscape (datadog .ParameterToString (tagKey , "" )))
6010+
6011+ localVarHeaderParams := make (map [string ]string )
6012+ localVarQueryParams := _neturl.Values {}
6013+ localVarFormParams := _neturl.Values {}
6014+ localVarHeaderParams ["Content-Type" ] = "application/json"
6015+ localVarHeaderParams ["Accept" ] = "*/*"
6016+
6017+ // body params
6018+ localVarPostBody = & body
6019+ if a .Client .Cfg .DelegatedTokenConfig != nil {
6020+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
6021+ if err != nil {
6022+ return nil , err
6023+ }
6024+ } else {
6025+ datadog .SetAuthKeys (
6026+ ctx ,
6027+ & localVarHeaderParams ,
6028+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
6029+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
6030+ )
6031+ }
6032+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
6033+ if err != nil {
6034+ return nil , err
6035+ }
6036+
6037+ localVarHTTPResponse , err := a .Client .CallAPI (req )
6038+ if err != nil || localVarHTTPResponse == nil {
6039+ return localVarHTTPResponse , err
6040+ }
6041+
6042+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
6043+ if err != nil {
6044+ return localVarHTTPResponse , err
6045+ }
6046+
6047+ if localVarHTTPResponse .StatusCode >= 300 {
6048+ newErr := datadog.GenericOpenAPIError {
6049+ ErrorBody : localVarBody ,
6050+ ErrorMessage : localVarHTTPResponse .Status ,
6051+ }
6052+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 429 {
6053+ var v APIErrorResponse
6054+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
6055+ if err != nil {
6056+ return localVarHTTPResponse , newErr
6057+ }
6058+ newErr .ErrorModel = v
6059+ }
6060+ return localVarHTTPResponse , newErr
6061+ }
6062+
6063+ return localVarHTTPResponse , nil
6064+ }
6065+
57156066// ValidateBudget Validate budget.
57166067// Validate a budget configuration without creating or modifying it
57176068func (a * CloudCostManagementApi ) ValidateBudget (ctx _context.Context , body BudgetValidationRequest ) (BudgetValidationResponse , * _nethttp.Response , error ) {
0 commit comments