@@ -65,6 +65,39 @@ export class LogsIndexesApiRequestFactory extends BaseAPIRequestFactory {
6565 return requestContext ;
6666 }
6767
68+ public async deleteLogsIndex (
69+ name : string ,
70+ _options ?: Configuration
71+ ) : Promise < RequestContext > {
72+ const _config = _options || this . configuration ;
73+
74+ // verify required parameter 'name' is not null or undefined
75+ if ( name === null || name === undefined ) {
76+ throw new RequiredError ( "name" , "deleteLogsIndex" ) ;
77+ }
78+
79+ // Path Params
80+ const localVarPath = "/api/v1/logs/config/indexes/{name}" . replace (
81+ "{name}" ,
82+ encodeURIComponent ( String ( name ) )
83+ ) ;
84+
85+ // Make Request Context
86+ const requestContext = _config
87+ . getServer ( "v1.LogsIndexesApi.deleteLogsIndex" )
88+ . makeRequestContext ( localVarPath , HttpMethod . DELETE ) ;
89+ requestContext . setHeaderParam ( "Accept" , "application/json" ) ;
90+ requestContext . setHttpConfig ( _config . httpConfig ) ;
91+
92+ // Apply auth methods
93+ applySecurityAuthentication ( _config , requestContext , [
94+ "apiKeyAuth" ,
95+ "appKeyAuth" ,
96+ ] ) ;
97+
98+ return requestContext ;
99+ }
100+
68101 public async getLogsIndex (
69102 name : string ,
70103 _options ?: Configuration
@@ -319,6 +352,85 @@ export class LogsIndexesApiResponseProcessor {
319352 ) ;
320353 }
321354
355+ /**
356+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
357+ * to the expected objects
358+ *
359+ * @params response Response returned by the server for a request to deleteLogsIndex
360+ * @throws ApiException if the response code was not in [200, 299]
361+ */
362+ public async deleteLogsIndex ( response : ResponseContext ) : Promise < LogsIndex > {
363+ const contentType = ObjectSerializer . normalizeMediaType (
364+ response . headers [ "content-type" ]
365+ ) ;
366+ if ( response . httpStatusCode === 200 ) {
367+ const body : LogsIndex = ObjectSerializer . deserialize (
368+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
369+ "LogsIndex"
370+ ) as LogsIndex ;
371+ return body ;
372+ }
373+ if ( response . httpStatusCode === 403 || response . httpStatusCode === 429 ) {
374+ const bodyText = ObjectSerializer . parse (
375+ await response . body . text ( ) ,
376+ contentType
377+ ) ;
378+ let body : APIErrorResponse ;
379+ try {
380+ body = ObjectSerializer . deserialize (
381+ bodyText ,
382+ "APIErrorResponse"
383+ ) as APIErrorResponse ;
384+ } catch ( error ) {
385+ logger . debug ( `Got error deserializing error: ${ error } ` ) ;
386+ throw new ApiException < APIErrorResponse > (
387+ response . httpStatusCode ,
388+ bodyText
389+ ) ;
390+ }
391+ throw new ApiException < APIErrorResponse > ( response . httpStatusCode , body ) ;
392+ }
393+ if ( response . httpStatusCode === 404 ) {
394+ const bodyText = ObjectSerializer . parse (
395+ await response . body . text ( ) ,
396+ contentType
397+ ) ;
398+ let body : LogsAPIErrorResponse ;
399+ try {
400+ body = ObjectSerializer . deserialize (
401+ bodyText ,
402+ "LogsAPIErrorResponse"
403+ ) as LogsAPIErrorResponse ;
404+ } catch ( error ) {
405+ logger . debug ( `Got error deserializing error: ${ error } ` ) ;
406+ throw new ApiException < LogsAPIErrorResponse > (
407+ response . httpStatusCode ,
408+ bodyText
409+ ) ;
410+ }
411+ throw new ApiException < LogsAPIErrorResponse > (
412+ response . httpStatusCode ,
413+ body
414+ ) ;
415+ }
416+
417+ // Work around for missing responses in specification, e.g. for petstore.yaml
418+ if ( response . httpStatusCode >= 200 && response . httpStatusCode <= 299 ) {
419+ const body : LogsIndex = ObjectSerializer . deserialize (
420+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
421+ "LogsIndex" ,
422+ ""
423+ ) as LogsIndex ;
424+ return body ;
425+ }
426+
427+ const body = ( await response . body . text ( ) ) || "" ;
428+ throw new ApiException < string > (
429+ response . httpStatusCode ,
430+ 'Unknown API Status Code!\nBody: "' + body + '"'
431+ ) ;
432+ }
433+
322434 /**
323435 * Unwraps the actual response sent by the server from the response context and deserializes the response content
324436 * to the expected objects
@@ -683,6 +795,14 @@ export interface LogsIndexesApiCreateLogsIndexRequest {
683795 body : LogsIndex ;
684796}
685797
798+ export interface LogsIndexesApiDeleteLogsIndexRequest {
799+ /**
800+ * Name of the log index.
801+ * @type string
802+ */
803+ name : string ;
804+ }
805+
686806export interface LogsIndexesApiGetLogsIndexRequest {
687807 /**
688808 * Name of the log index.
@@ -750,6 +870,28 @@ export class LogsIndexesApi {
750870 } ) ;
751871 }
752872
873+ /**
874+ * Delete an existing index from your organization. Index deletions are permanent and cannot be reverted.
875+ * You cannot recreate an index with the same name as deleted ones.
876+ * @param param The request object
877+ */
878+ public deleteLogsIndex (
879+ param : LogsIndexesApiDeleteLogsIndexRequest ,
880+ options ?: Configuration
881+ ) : Promise < LogsIndex > {
882+ const requestContextPromise = this . requestFactory . deleteLogsIndex (
883+ param . name ,
884+ options
885+ ) ;
886+ return requestContextPromise . then ( ( requestContext ) => {
887+ return this . configuration . httpApi
888+ . send ( requestContext )
889+ . then ( ( responseContext ) => {
890+ return this . responseProcessor . deleteLogsIndex ( responseContext ) ;
891+ } ) ;
892+ } ) ;
893+ }
894+
753895 /**
754896 * Get one log index from your organization. This endpoint takes no JSON arguments.
755897 * @param param The request object
0 commit comments