@@ -14,6 +14,7 @@ import localVarRequest from 'request';
1414import http from 'http' ;
1515
1616/* tslint:disable:no-unused-locals */
17+ import { DeleteFileBucketModel } from '../model/deleteFileBucketModel' ;
1718import { FileBucket } from '../model/fileBucket' ;
1819import { RegisterFileBucketModel } from '../model/registerFileBucketModel' ;
1920
@@ -105,6 +106,198 @@ export class FileBucketApi {
105106 this . interceptors . push ( interceptor ) ;
106107 }
107108
109+ /**
110+ *
111+ * @summary Delete a File Bucket.
112+ * @param deleteFileBucketModel
113+ */
114+ public async fileBucketControllerDeleteFileBucket (
115+ deleteFileBucketModel : DeleteFileBucketModel ,
116+ options : { headers : { [ name : string ] : string } } = { headers : { } }
117+ ) : Promise < { response : http . IncomingMessage ; body : FileBucket } > {
118+ const localVarPath = this . basePath + '/file/bucket' ;
119+ let localVarQueryParameters : any = { } ;
120+ let localVarHeaderParams : any = ( < any > Object ) . assign (
121+ { } ,
122+ this . _defaultHeaders
123+ ) ;
124+ const produces = [ 'application/json' ] ;
125+ // give precedence to 'application/json'
126+ if ( produces . indexOf ( 'application/json' ) >= 0 ) {
127+ localVarHeaderParams . Accept = 'application/json' ;
128+ } else {
129+ localVarHeaderParams . Accept = produces . join ( ',' ) ;
130+ }
131+ let localVarFormParams : any = { } ;
132+
133+ // verify required parameter 'deleteFileBucketModel' is not null or undefined
134+ if ( deleteFileBucketModel === null || deleteFileBucketModel === undefined ) {
135+ throw new Error (
136+ 'Required parameter deleteFileBucketModel was null or undefined when calling fileBucketControllerDeleteFileBucket.'
137+ ) ;
138+ }
139+
140+ ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ;
141+
142+ let localVarUseFormData = false ;
143+
144+ let localVarRequestOptions : localVarRequest . Options = {
145+ method : 'DELETE' ,
146+ qs : localVarQueryParameters ,
147+ headers : localVarHeaderParams ,
148+ uri : localVarPath ,
149+ useQuerystring : this . _useQuerystring ,
150+ json : true ,
151+ body : ObjectSerializer . serialize (
152+ deleteFileBucketModel ,
153+ 'DeleteFileBucketModel'
154+ ) ,
155+ } ;
156+
157+ let authenticationPromise = Promise . resolve ( ) ;
158+ if ( this . authentications . API_Key . accessToken ) {
159+ authenticationPromise = authenticationPromise . then ( ( ) =>
160+ this . authentications . API_Key . applyToRequest ( localVarRequestOptions )
161+ ) ;
162+ }
163+ authenticationPromise = authenticationPromise . then ( ( ) =>
164+ this . authentications . default . applyToRequest ( localVarRequestOptions )
165+ ) ;
166+
167+ let interceptorPromise = authenticationPromise ;
168+ for ( const interceptor of this . interceptors ) {
169+ interceptorPromise = interceptorPromise . then ( ( ) =>
170+ interceptor ( localVarRequestOptions )
171+ ) ;
172+ }
173+
174+ return interceptorPromise . then ( ( ) => {
175+ if ( Object . keys ( localVarFormParams ) . length ) {
176+ if ( localVarUseFormData ) {
177+ ( < any > localVarRequestOptions ) . formData = localVarFormParams ;
178+ } else {
179+ localVarRequestOptions . form = localVarFormParams ;
180+ }
181+ }
182+ return new Promise < { response : http . IncomingMessage ; body : FileBucket } > (
183+ ( resolve , reject ) => {
184+ localVarRequest ( localVarRequestOptions , ( error , response , body ) => {
185+ if ( error ) {
186+ reject ( error ) ;
187+ } else {
188+ if (
189+ response . statusCode &&
190+ response . statusCode >= 200 &&
191+ response . statusCode <= 299
192+ ) {
193+ body = ObjectSerializer . deserialize ( body , 'FileBucket' ) ;
194+ resolve ( { response : response , body : body } ) ;
195+ } else {
196+ reject ( new HttpError ( response , body , response . statusCode ) ) ;
197+ }
198+ }
199+ } ) ;
200+ }
201+ ) ;
202+ } ) ;
203+ }
204+ /**
205+ *
206+ * @summary Get File Buckets by Config Id and Config Env.
207+ * @param configId
208+ */
209+ public async fileBucketControllerGetBucketsByConfigIdAndEnv (
210+ configId : string ,
211+ options : { headers : { [ name : string ] : string } } = { headers : { } }
212+ ) : Promise < { response : http . IncomingMessage ; body : Array < FileBucket > } > {
213+ const localVarPath =
214+ this . basePath +
215+ '/file/bucket/{configId}' . replace (
216+ '{' + 'configId' + '}' ,
217+ encodeURIComponent ( String ( configId ) )
218+ ) ;
219+ let localVarQueryParameters : any = { } ;
220+ let localVarHeaderParams : any = ( < any > Object ) . assign (
221+ { } ,
222+ this . _defaultHeaders
223+ ) ;
224+ const produces = [ 'application/json' ] ;
225+ // give precedence to 'application/json'
226+ if ( produces . indexOf ( 'application/json' ) >= 0 ) {
227+ localVarHeaderParams . Accept = 'application/json' ;
228+ } else {
229+ localVarHeaderParams . Accept = produces . join ( ',' ) ;
230+ }
231+ let localVarFormParams : any = { } ;
232+
233+ // verify required parameter 'configId' is not null or undefined
234+ if ( configId === null || configId === undefined ) {
235+ throw new Error (
236+ 'Required parameter configId was null or undefined when calling fileBucketControllerGetBucketsByConfigIdAndEnv.'
237+ ) ;
238+ }
239+
240+ ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ;
241+
242+ let localVarUseFormData = false ;
243+
244+ let localVarRequestOptions : localVarRequest . Options = {
245+ method : 'GET' ,
246+ qs : localVarQueryParameters ,
247+ headers : localVarHeaderParams ,
248+ uri : localVarPath ,
249+ useQuerystring : this . _useQuerystring ,
250+ json : true ,
251+ } ;
252+
253+ let authenticationPromise = Promise . resolve ( ) ;
254+ if ( this . authentications . API_Key . accessToken ) {
255+ authenticationPromise = authenticationPromise . then ( ( ) =>
256+ this . authentications . API_Key . applyToRequest ( localVarRequestOptions )
257+ ) ;
258+ }
259+ authenticationPromise = authenticationPromise . then ( ( ) =>
260+ this . authentications . default . applyToRequest ( localVarRequestOptions )
261+ ) ;
262+
263+ let interceptorPromise = authenticationPromise ;
264+ for ( const interceptor of this . interceptors ) {
265+ interceptorPromise = interceptorPromise . then ( ( ) =>
266+ interceptor ( localVarRequestOptions )
267+ ) ;
268+ }
269+
270+ return interceptorPromise . then ( ( ) => {
271+ if ( Object . keys ( localVarFormParams ) . length ) {
272+ if ( localVarUseFormData ) {
273+ ( < any > localVarRequestOptions ) . formData = localVarFormParams ;
274+ } else {
275+ localVarRequestOptions . form = localVarFormParams ;
276+ }
277+ }
278+ return new Promise < {
279+ response : http . IncomingMessage ;
280+ body : Array < FileBucket > ;
281+ } > ( ( resolve , reject ) => {
282+ localVarRequest ( localVarRequestOptions , ( error , response , body ) => {
283+ if ( error ) {
284+ reject ( error ) ;
285+ } else {
286+ if (
287+ response . statusCode &&
288+ response . statusCode >= 200 &&
289+ response . statusCode <= 299
290+ ) {
291+ body = ObjectSerializer . deserialize ( body , 'Array<FileBucket>' ) ;
292+ resolve ( { response : response , body : body } ) ;
293+ } else {
294+ reject ( new HttpError ( response , body , response . statusCode ) ) ;
295+ }
296+ }
297+ } ) ;
298+ } ) ;
299+ } ) ;
300+ }
108301 /**
109302 *
110303 * @summary Registers a File Bucket.
0 commit comments