Class: Mudbase::StorageApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mudbase/api/storage_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StorageApi

Returns a new instance of StorageApi.



19
20
21
# File 'lib/mudbase/api/storage_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mudbase/api/storage_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#storage_confirm_upload(storage_confirm_upload_request, opts = {}) ⇒ ConfirmUploadResponse

Confirm direct upload (scan + finalize metadata) After a client uploads directly to S3 using the presigned POST, call this endpoint to have the server scan the object, create the File record, and optionally quarantine if infected.

Parameters:

  • storage_confirm_upload_request (StorageConfirmUploadRequest)

    S3 key from presigned response, projectId, and optional originalName, contentType, size, bucket, isPublic.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/mudbase/api/storage_api.rb', line 27

def storage_confirm_upload(storage_confirm_upload_request, opts = {})
  data, _status_code, _headers = storage_confirm_upload_with_http_info(storage_confirm_upload_request, opts)
  data
end

#storage_confirm_upload_with_http_info(storage_confirm_upload_request, opts = {}) ⇒ Array<(ConfirmUploadResponse, Integer, Hash)>

Confirm direct upload (scan + finalize metadata) After a client uploads directly to S3 using the presigned POST, call this endpoint to have the server scan the object, create the File record, and optionally quarantine if infected.

Parameters:

  • storage_confirm_upload_request (StorageConfirmUploadRequest)

    S3 key from presigned response, projectId, and optional originalName, contentType, size, bucket, isPublic.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ConfirmUploadResponse, Integer, Hash)>)

    ConfirmUploadResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mudbase/api/storage_api.rb', line 37

def storage_confirm_upload_with_http_info(storage_confirm_upload_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_confirm_upload ...'
  end
  # verify the required parameter 'storage_confirm_upload_request' is set
  if @api_client.config.client_side_validation && storage_confirm_upload_request.nil?
    fail ArgumentError, "Missing the required parameter 'storage_confirm_upload_request' when calling StorageApi.storage_confirm_upload"
  end
  # resource path
  local_var_path = '/api/files/upload/confirm'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(storage_confirm_upload_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ConfirmUploadResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_confirm_upload",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_confirm_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_create_bucket(project_id, create_bucket_request, opts = {}) ⇒ BucketResponse

Create a new bucket Create a new storage bucket in a project. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • create_bucket_request (CreateBucketRequest)

    Bucket name, isPublic flag, and optional settings.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



96
97
98
99
# File 'lib/mudbase/api/storage_api.rb', line 96

def storage_create_bucket(project_id, create_bucket_request, opts = {})
  data, _status_code, _headers = storage_create_bucket_with_http_info(project_id, create_bucket_request, opts)
  data
end

#storage_create_bucket_with_http_info(project_id, create_bucket_request, opts = {}) ⇒ Array<(BucketResponse, Integer, Hash)>

Create a new bucket Create a new storage bucket in a project. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • create_bucket_request (CreateBucketRequest)

    Bucket name, isPublic flag, and optional settings.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BucketResponse, Integer, Hash)>)

    BucketResponse data, response status code and response headers



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/mudbase/api/storage_api.rb', line 107

def storage_create_bucket_with_http_info(project_id, create_bucket_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_create_bucket ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_create_bucket"
  end
  # verify the required parameter 'create_bucket_request' is set
  if @api_client.config.client_side_validation && create_bucket_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_bucket_request' when calling StorageApi.storage_create_bucket"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_bucket_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BucketResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_create_bucket",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_create_bucket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_delete_bucket(project_id, bucket_id, opts = {}) ⇒ MessageResponse

Delete bucket Delete a storage bucket permanently. This is a destructive operation that will also delete all files in the bucket. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



170
171
172
173
# File 'lib/mudbase/api/storage_api.rb', line 170

def storage_delete_bucket(project_id, bucket_id, opts = {})
  data, _status_code, _headers = storage_delete_bucket_with_http_info(project_id, bucket_id, opts)
  data
end

#storage_delete_bucket_with_http_info(project_id, bucket_id, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Delete bucket Delete a storage bucket permanently. This is a destructive operation that will also delete all files in the bucket. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/mudbase/api/storage_api.rb', line 181

def storage_delete_bucket_with_http_info(project_id, bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_delete_bucket ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_delete_bucket"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_delete_bucket"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_delete_bucket",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_delete_bucket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_delete_file(project_id, bucket_id, file_id, opts = {}) ⇒ MessageResponse

Delete file Delete a file from a bucket permanently. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



240
241
242
243
# File 'lib/mudbase/api/storage_api.rb', line 240

def storage_delete_file(project_id, bucket_id, file_id, opts = {})
  data, _status_code, _headers = storage_delete_file_with_http_info(project_id, bucket_id, file_id, opts)
  data
end

#storage_delete_file_with_http_info(project_id, bucket_id, file_id, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Delete file Delete a file from a bucket permanently. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MessageResponse, Integer, Hash)>)

    MessageResponse data, response status code and response headers



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/mudbase/api/storage_api.rb', line 252

def storage_delete_file_with_http_info(project_id, bucket_id, file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_delete_file ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_delete_file"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_delete_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling StorageApi.storage_delete_file"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}/files/{fileId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s)).sub('{' + 'fileId' + '}', CGI.escape(file_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MessageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_delete_file",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_download_bucket_file(file_id, opts = {}) ⇒ File

Download file from bucket Download a file from a bucket. For public files, no authentication is required. For private files, a download token (obtained via signed URL endpoint) is required in the query parameter. Accepts: Token-based authentication via query parameter (for private files), or no authentication (for public files).

Parameters:

  • file_id (String)

    File ID to download.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :token (String)

    Download token for private files (from signed URL endpoint).

Returns:

  • (File)


314
315
316
317
# File 'lib/mudbase/api/storage_api.rb', line 314

def storage_download_bucket_file(file_id, opts = {})
  data, _status_code, _headers = storage_download_bucket_file_with_http_info(file_id, opts)
  data
end

#storage_download_bucket_file_with_http_info(file_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Download file from bucket Download a file from a bucket. For public files, no authentication is required. For private files, a download token (obtained via signed URL endpoint) is required in the query parameter. Accepts: Token-based authentication via query parameter (for private files), or no authentication (for public files).

Parameters:

  • file_id (String)

    File ID to download.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :token (String)

    Download token for private files (from signed URL endpoint).

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/mudbase/api/storage_api.rb', line 325

def storage_download_bucket_file_with_http_info(file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_download_bucket_file ...'
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling StorageApi.storage_download_bucket_file"
  end
  # resource path
  local_var_path = '/api/bucket/files/{fileId}/download'.sub('{' + 'fileId' + '}', CGI.escape(file_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"StorageApi.storage_download_bucket_file",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_download_bucket_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_download_file(file_id, opts = {}) ⇒ SignedUrlResponse

Generate a presigned URL for downloading a file Returns a time-limited provider-signed URL (S3) for direct download. Server enforces RBAC before issuing the URL.

Parameters:

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :token (String)

    Optional one-time download token (if provided by upload flow).

Returns:



380
381
382
383
# File 'lib/mudbase/api/storage_api.rb', line 380

def storage_download_file(file_id, opts = {})
  data, _status_code, _headers = storage_download_file_with_http_info(file_id, opts)
  data
end

#storage_download_file_with_http_info(file_id, opts = {}) ⇒ Array<(SignedUrlResponse, Integer, Hash)>

Generate a presigned URL for downloading a file Returns a time-limited provider-signed URL (S3) for direct download. Server enforces RBAC before issuing the URL.

Parameters:

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :token (String)

    Optional one-time download token (if provided by upload flow).

Returns:

  • (Array<(SignedUrlResponse, Integer, Hash)>)

    SignedUrlResponse data, response status code and response headers



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/mudbase/api/storage_api.rb', line 391

def storage_download_file_with_http_info(file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_download_file ...'
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling StorageApi.storage_download_file"
  end
  # resource path
  local_var_path = '/api/files/{fileId}/download'.sub('{' + 'fileId' + '}', CGI.escape(file_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SignedUrlResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_download_file",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_download_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_get_bucket(project_id, bucket_id, opts = {}) ⇒ BucketResponse

Get bucket details Retrieve metadata and configuration for a single storage bucket, including name, project, public/private status, and settings. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



446
447
448
449
# File 'lib/mudbase/api/storage_api.rb', line 446

def storage_get_bucket(project_id, bucket_id, opts = {})
  data, _status_code, _headers = storage_get_bucket_with_http_info(project_id, bucket_id, opts)
  data
end

#storage_get_bucket_with_http_info(project_id, bucket_id, opts = {}) ⇒ Array<(BucketResponse, Integer, Hash)>

Get bucket details Retrieve metadata and configuration for a single storage bucket, including name, project, public/private status, and settings. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BucketResponse, Integer, Hash)>)

    BucketResponse data, response status code and response headers



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/mudbase/api/storage_api.rb', line 457

def storage_get_bucket_with_http_info(project_id, bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_get_bucket ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_get_bucket"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_get_bucket"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BucketResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_get_bucket",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_get_bucket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_get_file(project_id, bucket_id, file_id, opts = {}) ⇒ FileResponse

Get file metadata Get metadata for a specific file in a bucket. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



516
517
518
519
# File 'lib/mudbase/api/storage_api.rb', line 516

def storage_get_file(project_id, bucket_id, file_id, opts = {})
  data, _status_code, _headers = storage_get_file_with_http_info(project_id, bucket_id, file_id, opts)
  data
end

#storage_get_file_with_http_info(project_id, bucket_id, file_id, opts = {}) ⇒ Array<(FileResponse, Integer, Hash)>

Get file metadata Get metadata for a specific file in a bucket. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FileResponse, Integer, Hash)>)

    FileResponse data, response status code and response headers



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/mudbase/api/storage_api.rb', line 528

def storage_get_file_with_http_info(project_id, bucket_id, file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_get_file ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_get_file"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_get_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling StorageApi.storage_get_file"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}/files/{fileId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s)).sub('{' + 'fileId' + '}', CGI.escape(file_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FileResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_get_file",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_get_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_get_presigned_upload(storage_get_presigned_upload_request, opts = {}) ⇒ PresignedPostResponse

Generate presigned POST data for direct browser upload Issue a presigned POST (fields + url) for clients to upload directly to S3. The server stores the issued key with expiry and RBAC is enforced.

Parameters:

  • storage_get_presigned_upload_request (StorageGetPresignedUploadRequest)

    projectId, originalName, optional bucket, contentType, isPublic.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



589
590
591
592
# File 'lib/mudbase/api/storage_api.rb', line 589

def storage_get_presigned_upload(storage_get_presigned_upload_request, opts = {})
  data, _status_code, _headers = storage_get_presigned_upload_with_http_info(storage_get_presigned_upload_request, opts)
  data
end

#storage_get_presigned_upload_with_http_info(storage_get_presigned_upload_request, opts = {}) ⇒ Array<(PresignedPostResponse, Integer, Hash)>

Generate presigned POST data for direct browser upload Issue a presigned POST (fields + url) for clients to upload directly to S3. The server stores the issued key with expiry and RBAC is enforced.

Parameters:

  • storage_get_presigned_upload_request (StorageGetPresignedUploadRequest)

    projectId, originalName, optional bucket, contentType, isPublic.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PresignedPostResponse, Integer, Hash)>)

    PresignedPostResponse data, response status code and response headers



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
# File 'lib/mudbase/api/storage_api.rb', line 599

def storage_get_presigned_upload_with_http_info(storage_get_presigned_upload_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_get_presigned_upload ...'
  end
  # verify the required parameter 'storage_get_presigned_upload_request' is set
  if @api_client.config.client_side_validation && storage_get_presigned_upload_request.nil?
    fail ArgumentError, "Missing the required parameter 'storage_get_presigned_upload_request' when calling StorageApi.storage_get_presigned_upload"
  end
  # resource path
  local_var_path = '/api/files/upload/presigned'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(storage_get_presigned_upload_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PresignedPostResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_get_presigned_upload",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_get_presigned_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_get_signed_url(project_id, bucket_id, file_id, opts = {}) ⇒ SignedUrlResponse

Generate signed URL for file Generate a time-limited signed URL for downloading a private file. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



660
661
662
663
# File 'lib/mudbase/api/storage_api.rb', line 660

def storage_get_signed_url(project_id, bucket_id, file_id, opts = {})
  data, _status_code, _headers = storage_get_signed_url_with_http_info(project_id, bucket_id, file_id, opts)
  data
end

#storage_get_signed_url_with_http_info(project_id, bucket_id, file_id, opts = {}) ⇒ Array<(SignedUrlResponse, Integer, Hash)>

Generate signed URL for file Generate a time-limited signed URL for downloading a private file. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • file_id (String)

    File ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(SignedUrlResponse, Integer, Hash)>)

    SignedUrlResponse data, response status code and response headers



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# File 'lib/mudbase/api/storage_api.rb', line 673

def storage_get_signed_url_with_http_info(project_id, bucket_id, file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_get_signed_url ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_get_signed_url"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_get_signed_url"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling StorageApi.storage_get_signed_url"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}/files/{fileId}/signed-url'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s)).sub('{' + 'fileId' + '}', CGI.escape(file_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'storage_get_signed_url_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'SignedUrlResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_get_signed_url",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_get_signed_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_list_buckets(project_id, opts = {}) ⇒ BucketListResponse

List buckets in a project List all storage buckets in a project with pagination and search. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of buckets per page. (default to 20)

  • :search (String)

    Search by bucket name.

Returns:



742
743
744
745
# File 'lib/mudbase/api/storage_api.rb', line 742

def storage_list_buckets(project_id, opts = {})
  data, _status_code, _headers = storage_list_buckets_with_http_info(project_id, opts)
  data
end

#storage_list_buckets_with_http_info(project_id, opts = {}) ⇒ Array<(BucketListResponse, Integer, Hash)>

List buckets in a project List all storage buckets in a project with pagination and search. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of buckets per page. (default to 20)

  • :search (String)

    Search by bucket name.

Returns:

  • (Array<(BucketListResponse, Integer, Hash)>)

    BucketListResponse data, response status code and response headers



755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
# File 'lib/mudbase/api/storage_api.rb', line 755

def storage_list_buckets_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_list_buckets ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_list_buckets"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BucketListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_list_buckets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_list_buckets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_list_files(project_id, bucket_id, opts = {}) ⇒ FileListResponse

List files in bucket List files in a bucket with pagination, search, and optional type filter. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of files per page. (default to 20)

  • :search (String)

    Search by filename.

  • :type (String)

    Filter by MIME type or file type.

Returns:



816
817
818
819
# File 'lib/mudbase/api/storage_api.rb', line 816

def storage_list_files(project_id, bucket_id, opts = {})
  data, _status_code, _headers = storage_list_files_with_http_info(project_id, bucket_id, opts)
  data
end

#storage_list_files_with_http_info(project_id, bucket_id, opts = {}) ⇒ Array<(FileListResponse, Integer, Hash)>

List files in bucket List files in a bucket with pagination, search, and optional type filter. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :limit (Integer)

    Number of files per page. (default to 20)

  • :search (String)

    Search by filename.

  • :type (String)

    Filter by MIME type or file type.

Returns:

  • (Array<(FileListResponse, Integer, Hash)>)

    FileListResponse data, response status code and response headers



831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
# File 'lib/mudbase/api/storage_api.rb', line 831

def storage_list_files_with_http_info(project_id, bucket_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_list_files ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_list_files"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_list_files"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}/files'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FileListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_list_files",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_list_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_update_bucket(project_id, bucket_id, update_bucket_request, opts = {}) ⇒ BucketResponse

Update bucket Update bucket configuration (name, public/private status, settings). Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • update_bucket_request (UpdateBucketRequest)

    Fields to update (name, isPublic, settings).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



894
895
896
897
# File 'lib/mudbase/api/storage_api.rb', line 894

def storage_update_bucket(project_id, bucket_id, update_bucket_request, opts = {})
  data, _status_code, _headers = storage_update_bucket_with_http_info(project_id, bucket_id, update_bucket_request, opts)
  data
end

#storage_update_bucket_with_http_info(project_id, bucket_id, update_bucket_request, opts = {}) ⇒ Array<(BucketResponse, Integer, Hash)>

Update bucket Update bucket configuration (name, public/private status, settings). Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • update_bucket_request (UpdateBucketRequest)

    Fields to update (name, isPublic, settings).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BucketResponse, Integer, Hash)>)

    BucketResponse data, response status code and response headers



906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
# File 'lib/mudbase/api/storage_api.rb', line 906

def storage_update_bucket_with_http_info(project_id, bucket_id, update_bucket_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_update_bucket ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_update_bucket"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_update_bucket"
  end
  # verify the required parameter 'update_bucket_request' is set
  if @api_client.config.client_side_validation && update_bucket_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_bucket_request' when calling StorageApi.storage_update_bucket"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_bucket_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BucketResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_update_bucket",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_update_bucket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#storage_upload_files(project_id, bucket_id, upload_files_to_bucket_request, opts = {}) ⇒ FileUploadResponse

Upload files to bucket Upload one or more files to a storage bucket using multipart/form-data. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • upload_files_to_bucket_request (UploadFilesToBucketRequest)

    Use multipart/form-data for file upload (files required; optional folder, tags). application/json uses the same schema for metadata-only or tooling that prefers JSON.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



974
975
976
977
# File 'lib/mudbase/api/storage_api.rb', line 974

def storage_upload_files(project_id, bucket_id, upload_files_to_bucket_request, opts = {})
  data, _status_code, _headers = storage_upload_files_with_http_info(project_id, bucket_id, upload_files_to_bucket_request, opts)
  data
end

#storage_upload_files_with_http_info(project_id, bucket_id, upload_files_to_bucket_request, opts = {}) ⇒ Array<(FileUploadResponse, Integer, Hash)>

Upload files to bucket Upload one or more files to a storage bucket using multipart/form-data. Accepts BearerToken (JWT) or ApiKeyAuth (X-API-Key).

Parameters:

  • project_id (String)

    Project ID.

  • bucket_id (String)

    Bucket ID.

  • upload_files_to_bucket_request (UploadFilesToBucketRequest)

    Use multipart/form-data for file upload (files required; optional folder, tags). application/json uses the same schema for metadata-only or tooling that prefers JSON.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FileUploadResponse, Integer, Hash)>)

    FileUploadResponse data, response status code and response headers



986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/mudbase/api/storage_api.rb', line 986

def storage_upload_files_with_http_info(project_id, bucket_id, upload_files_to_bucket_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorageApi.storage_upload_files ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling StorageApi.storage_upload_files"
  end
  # verify the required parameter 'bucket_id' is set
  if @api_client.config.client_side_validation && bucket_id.nil?
    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling StorageApi.storage_upload_files"
  end
  # verify the required parameter 'upload_files_to_bucket_request' is set
  if @api_client.config.client_side_validation && upload_files_to_bucket_request.nil?
    fail ArgumentError, "Missing the required parameter 'upload_files_to_bucket_request' when calling StorageApi.storage_upload_files"
  end
  # resource path
  local_var_path = '/api/bucket/projects/{projectId}/buckets/{bucketId}/files'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'bucketId' + '}', CGI.escape(bucket_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_files_to_bucket_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FileUploadResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerToken']

  new_options = opts.merge(
    :operation => :"StorageApi.storage_upload_files",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#storage_upload_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end