@@ -1080,15 +1080,76 @@ func (a *MetricsApi) ListTagConfigurationsWithPagination(ctx _context.Context, o
10801080 return items , cancel
10811081}
10821082
1083+ // ListTagsByMetricNameOptionalParameters holds optional parameters for ListTagsByMetricName.
1084+ type ListTagsByMetricNameOptionalParameters struct {
1085+ WindowSeconds * int64
1086+ FilterTags * string
1087+ FilterMatch * string
1088+ FilterIncludeTagValues * bool
1089+ FilterAllowPartial * bool
1090+ PageLimit * int32
1091+ }
1092+
1093+ // NewListTagsByMetricNameOptionalParameters creates an empty struct for parameters.
1094+ func NewListTagsByMetricNameOptionalParameters () * ListTagsByMetricNameOptionalParameters {
1095+ this := ListTagsByMetricNameOptionalParameters {}
1096+ return & this
1097+ }
1098+
1099+ // WithWindowSeconds sets the corresponding parameter name and returns the struct.
1100+ func (r * ListTagsByMetricNameOptionalParameters ) WithWindowSeconds (windowSeconds int64 ) * ListTagsByMetricNameOptionalParameters {
1101+ r .WindowSeconds = & windowSeconds
1102+ return r
1103+ }
1104+
1105+ // WithFilterTags sets the corresponding parameter name and returns the struct.
1106+ func (r * ListTagsByMetricNameOptionalParameters ) WithFilterTags (filterTags string ) * ListTagsByMetricNameOptionalParameters {
1107+ r .FilterTags = & filterTags
1108+ return r
1109+ }
1110+
1111+ // WithFilterMatch sets the corresponding parameter name and returns the struct.
1112+ func (r * ListTagsByMetricNameOptionalParameters ) WithFilterMatch (filterMatch string ) * ListTagsByMetricNameOptionalParameters {
1113+ r .FilterMatch = & filterMatch
1114+ return r
1115+ }
1116+
1117+ // WithFilterIncludeTagValues sets the corresponding parameter name and returns the struct.
1118+ func (r * ListTagsByMetricNameOptionalParameters ) WithFilterIncludeTagValues (filterIncludeTagValues bool ) * ListTagsByMetricNameOptionalParameters {
1119+ r .FilterIncludeTagValues = & filterIncludeTagValues
1120+ return r
1121+ }
1122+
1123+ // WithFilterAllowPartial sets the corresponding parameter name and returns the struct.
1124+ func (r * ListTagsByMetricNameOptionalParameters ) WithFilterAllowPartial (filterAllowPartial bool ) * ListTagsByMetricNameOptionalParameters {
1125+ r .FilterAllowPartial = & filterAllowPartial
1126+ return r
1127+ }
1128+
1129+ // WithPageLimit sets the corresponding parameter name and returns the struct.
1130+ func (r * ListTagsByMetricNameOptionalParameters ) WithPageLimit (pageLimit int32 ) * ListTagsByMetricNameOptionalParameters {
1131+ r .PageLimit = & pageLimit
1132+ return r
1133+ }
1134+
10831135// ListTagsByMetricName List tags by metric name.
1084- // View indexed tag key-value pairs for a given metric name over the previous hour.
1085- func (a * MetricsApi ) ListTagsByMetricName (ctx _context.Context , metricName string ) (MetricAllTagsResponse , * _nethttp.Response , error ) {
1136+ // View indexed and ingested tags for a given metric name.
1137+ // Results are filtered by the `window[seconds]` parameter, which defaults to 14400 (4 hours).
1138+ func (a * MetricsApi ) ListTagsByMetricName (ctx _context.Context , metricName string , o ... ListTagsByMetricNameOptionalParameters ) (MetricAllTagsResponse , * _nethttp.Response , error ) {
10861139 var (
10871140 localVarHTTPMethod = _nethttp .MethodGet
10881141 localVarPostBody interface {}
10891142 localVarReturnValue MetricAllTagsResponse
1143+ optionalParams ListTagsByMetricNameOptionalParameters
10901144 )
10911145
1146+ if len (o ) > 1 {
1147+ return localVarReturnValue , nil , datadog .ReportError ("only one argument of type ListTagsByMetricNameOptionalParameters is allowed" )
1148+ }
1149+ if len (o ) == 1 {
1150+ optionalParams = o [0 ]
1151+ }
1152+
10921153 localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.MetricsApi.ListTagsByMetricName" )
10931154 if err != nil {
10941155 return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
@@ -1100,6 +1161,24 @@ func (a *MetricsApi) ListTagsByMetricName(ctx _context.Context, metricName strin
11001161 localVarHeaderParams := make (map [string ]string )
11011162 localVarQueryParams := _neturl.Values {}
11021163 localVarFormParams := _neturl.Values {}
1164+ if optionalParams .WindowSeconds != nil {
1165+ localVarQueryParams .Add ("window[seconds]" , datadog .ParameterToString (* optionalParams .WindowSeconds , "" ))
1166+ }
1167+ if optionalParams .FilterTags != nil {
1168+ localVarQueryParams .Add ("filter[tags]" , datadog .ParameterToString (* optionalParams .FilterTags , "" ))
1169+ }
1170+ if optionalParams .FilterMatch != nil {
1171+ localVarQueryParams .Add ("filter[match]" , datadog .ParameterToString (* optionalParams .FilterMatch , "" ))
1172+ }
1173+ if optionalParams .FilterIncludeTagValues != nil {
1174+ localVarQueryParams .Add ("filter[include_tag_values]" , datadog .ParameterToString (* optionalParams .FilterIncludeTagValues , "" ))
1175+ }
1176+ if optionalParams .FilterAllowPartial != nil {
1177+ localVarQueryParams .Add ("filter[allow_partial]" , datadog .ParameterToString (* optionalParams .FilterAllowPartial , "" ))
1178+ }
1179+ if optionalParams .PageLimit != nil {
1180+ localVarQueryParams .Add ("page[limit]" , datadog .ParameterToString (* optionalParams .PageLimit , "" ))
1181+ }
11031182 localVarHeaderParams ["Accept" ] = "application/json"
11041183
11051184 if a .Client .Cfg .DelegatedTokenConfig != nil {
0 commit comments