1- import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi" ;
1+ import {
2+ BaseAPIRequestFactory ,
3+ RequiredError ,
4+ } from "../../datadog-api-client-common/baseapi" ;
25import {
36 Configuration ,
47 applySecurityAuthentication ,
@@ -18,10 +21,16 @@ import { ServiceList } from "../models/ServiceList";
1821
1922export class APMApiRequestFactory extends BaseAPIRequestFactory {
2023 public async getServiceList (
24+ filterEnv : string ,
2125 _options ?: Configuration
2226 ) : Promise < RequestContext > {
2327 const _config = _options || this . configuration ;
2428
29+ // verify required parameter 'filterEnv' is not null or undefined
30+ if ( filterEnv === null || filterEnv === undefined ) {
31+ throw new RequiredError ( "filterEnv" , "getServiceList" ) ;
32+ }
33+
2534 // Path Params
2635 const localVarPath = "/api/v2/apm/services" ;
2736
@@ -32,6 +41,15 @@ export class APMApiRequestFactory extends BaseAPIRequestFactory {
3241 requestContext . setHeaderParam ( "Accept" , "application/json" ) ;
3342 requestContext . setHttpConfig ( _config . httpConfig ) ;
3443
44+ // Query Params
45+ if ( filterEnv !== undefined ) {
46+ requestContext . setQueryParam (
47+ "filter[env]" ,
48+ ObjectSerializer . serialize ( filterEnv , "string" , "" ) ,
49+ ""
50+ ) ;
51+ }
52+
3553 // Apply auth methods
3654 applySecurityAuthentication ( _config , requestContext , [
3755 "apiKeyAuth" ,
@@ -101,6 +119,14 @@ export class APMApiResponseProcessor {
101119 }
102120}
103121
122+ export interface APMApiGetServiceListRequest {
123+ /**
124+ * Filter services by environment. Can be set to `*` to return all services across all environments.
125+ * @type string
126+ */
127+ filterEnv : string ;
128+ }
129+
104130export class APMApi {
105131 private requestFactory : APMApiRequestFactory ;
106132 private responseProcessor : APMApiResponseProcessor ;
@@ -120,8 +146,14 @@ export class APMApi {
120146 /**
121147 * @param param The request object
122148 */
123- public getServiceList ( options ?: Configuration ) : Promise < ServiceList > {
124- const requestContextPromise = this . requestFactory . getServiceList ( options ) ;
149+ public getServiceList (
150+ param : APMApiGetServiceListRequest ,
151+ options ?: Configuration
152+ ) : Promise < ServiceList > {
153+ const requestContextPromise = this . requestFactory . getServiceList (
154+ param . filterEnv ,
155+ options
156+ ) ;
125157 return requestContextPromise . then ( ( requestContext ) => {
126158 return this . configuration . httpApi
127159 . send ( requestContext )
0 commit comments