@@ -753,6 +753,32 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory {
753
753
return requestContext ;
754
754
}
755
755
756
+ public async getSyntheticsDefaultLocations (
757
+ _options ?: Configuration
758
+ ) : Promise < RequestContext > {
759
+ const _config = _options || this . configuration ;
760
+
761
+ // Path Params
762
+ const localVarPath = "/api/v1/synthetics/settings/default_locations" ;
763
+
764
+ // Make Request Context
765
+ const requestContext = getServer (
766
+ _config ,
767
+ "v1.SyntheticsApi.getSyntheticsDefaultLocations"
768
+ ) . makeRequestContext ( localVarPath , HttpMethod . GET ) ;
769
+ requestContext . setHeaderParam ( "Accept" , "application/json" ) ;
770
+ requestContext . setHttpConfig ( _config . httpConfig ) ;
771
+
772
+ // Apply auth methods
773
+ applySecurityAuthentication ( _config , requestContext , [
774
+ "AuthZ" ,
775
+ "apiKeyAuth" ,
776
+ "appKeyAuth" ,
777
+ ] ) ;
778
+
779
+ return requestContext ;
780
+ }
781
+
756
782
public async getTest (
757
783
publicId : string ,
758
784
_options ?: Configuration
@@ -2225,6 +2251,64 @@ export class SyntheticsApiResponseProcessor {
2225
2251
) ;
2226
2252
}
2227
2253
2254
+ /**
2255
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
2256
+ * to the expected objects
2257
+ *
2258
+ * @params response Response returned by the server for a request to getSyntheticsDefaultLocations
2259
+ * @throws ApiException if the response code was not in [200, 299]
2260
+ */
2261
+ public async getSyntheticsDefaultLocations (
2262
+ response : ResponseContext
2263
+ ) : Promise < Array < string > > {
2264
+ const contentType = ObjectSerializer . normalizeMediaType (
2265
+ response . headers [ "content-type" ]
2266
+ ) ;
2267
+ if ( response . httpStatusCode == 200 ) {
2268
+ const body : Array < string > = ObjectSerializer . deserialize (
2269
+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
2270
+ "Array<string>"
2271
+ ) as Array < string > ;
2272
+ return body ;
2273
+ }
2274
+ if ( response . httpStatusCode == 429 ) {
2275
+ const bodyText = ObjectSerializer . parse (
2276
+ await response . body . text ( ) ,
2277
+ contentType
2278
+ ) ;
2279
+ let body : APIErrorResponse ;
2280
+ try {
2281
+ body = ObjectSerializer . deserialize (
2282
+ bodyText ,
2283
+ "APIErrorResponse"
2284
+ ) as APIErrorResponse ;
2285
+ } catch ( error ) {
2286
+ logger . info ( `Got error deserializing error: ${ error } ` ) ;
2287
+ throw new ApiException < APIErrorResponse > (
2288
+ response . httpStatusCode ,
2289
+ bodyText
2290
+ ) ;
2291
+ }
2292
+ throw new ApiException < APIErrorResponse > ( response . httpStatusCode , body ) ;
2293
+ }
2294
+
2295
+ // Work around for missing responses in specification, e.g. for petstore.yaml
2296
+ if ( response . httpStatusCode >= 200 && response . httpStatusCode <= 299 ) {
2297
+ const body : Array < string > = ObjectSerializer . deserialize (
2298
+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
2299
+ "Array<string>" ,
2300
+ ""
2301
+ ) as Array < string > ;
2302
+ return body ;
2303
+ }
2304
+
2305
+ const body = ( await response . body . text ( ) ) || "" ;
2306
+ throw new ApiException < string > (
2307
+ response . httpStatusCode ,
2308
+ 'Unknown API Status Code!\nBody: "' + body + '"'
2309
+ ) ;
2310
+ }
2311
+
2228
2312
/**
2229
2313
* Unwraps the actual response sent by the server from the response context and deserializes the response content
2230
2314
* to the expected objects
@@ -3499,6 +3583,26 @@ export class SyntheticsApi {
3499
3583
} ) ;
3500
3584
}
3501
3585
3586
+ /**
3587
+ * Get the default locations settings.
3588
+ * @param param The request object
3589
+ */
3590
+ public getSyntheticsDefaultLocations (
3591
+ options ?: Configuration
3592
+ ) : Promise < Array < string > > {
3593
+ const requestContextPromise =
3594
+ this . requestFactory . getSyntheticsDefaultLocations ( options ) ;
3595
+ return requestContextPromise . then ( ( requestContext ) => {
3596
+ return this . configuration . httpApi
3597
+ . send ( requestContext )
3598
+ . then ( ( responseContext ) => {
3599
+ return this . responseProcessor . getSyntheticsDefaultLocations (
3600
+ responseContext
3601
+ ) ;
3602
+ } ) ;
3603
+ } ) ;
3604
+ }
3605
+
3502
3606
/**
3503
3607
* Get the detailed configuration associated with a Synthetic test.
3504
3608
* @param param The request object
0 commit comments