Class: Mudbase::ProjectsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProjectsApi

Returns a new instance of ProjectsApi.



19
20
21
# File 'lib/mudbase/api/projects_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/projects_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#configure_o_auth_provider(project_id, provider, configure_o_auth_provider_request, opts = {}) ⇒ ConfigureOAuthProvider200Response

Configure OAuth provider for a project Creates or updates the configuration for an OAuth provider for the specified project

Parameters:

  • project_id (String)
  • provider (String)
  • configure_o_auth_provider_request (ConfigureOAuthProviderRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/mudbase/api/projects_api.rb', line 29

def configure_o_auth_provider(project_id, provider, configure_o_auth_provider_request, opts = {})
  data, _status_code, _headers = configure_o_auth_provider_with_http_info(project_id, provider, configure_o_auth_provider_request, opts)
  data
end

#configure_o_auth_provider_with_http_info(project_id, provider, configure_o_auth_provider_request, opts = {}) ⇒ Array<(ConfigureOAuthProvider200Response, Integer, Hash)>

Configure OAuth provider for a project Creates or updates the configuration for an OAuth provider for the specified project

Parameters:

  • project_id (String)
  • provider (String)
  • configure_o_auth_provider_request (ConfigureOAuthProviderRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/mudbase/api/projects_api.rb', line 41

def configure_o_auth_provider_with_http_info(project_id, provider, configure_o_auth_provider_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.configure_o_auth_provider ...'
  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 ProjectsApi.configure_o_auth_provider"
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling ProjectsApi.configure_o_auth_provider"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "apple", "twitter", "discord", "linkedin", "dropbox", "slack", "reddit", "twitch", "figma", "zoom", "bitbucket", "salesforce", "shopify", "line", "spotify", "strava", "paypal", "asana", "trello", "okta", "gitea", "yandex", "yahoo", "vk", "meetup"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'configure_o_auth_provider_request' is set
  if @api_client.config.client_side_validation && configure_o_auth_provider_request.nil?
    fail ArgumentError, "Missing the required parameter 'configure_o_auth_provider_request' when calling ProjectsApi.configure_o_auth_provider"
  end
  # resource path
  local_var_path = '/api/auth/oauth/projects/{projectId}/providers/{provider}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'provider' + '}', CGI.escape(provider.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(configure_o_auth_provider_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.configure_o_auth_provider",
    :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: ProjectsApi#configure_o_auth_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_project(org_id, create_project_request, opts = {}) ⇒ CreateProject201Response

Create new project Create a new project in an organization. Requires: OrgBearerAuth (organization-level authentication only).

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Returns:



113
114
115
116
# File 'lib/mudbase/api/projects_api.rb', line 113

def create_project(org_id, create_project_request, opts = {})
  data, _status_code, _headers = create_project_with_http_info(org_id, create_project_request, opts)
  data
end

#create_project_with_http_info(org_id, create_project_request, opts = {}) ⇒ Array<(CreateProject201Response, Integer, Hash)>

Create new project Create a new project in an organization. Requires: OrgBearerAuth (organization-level authentication only).

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Returns:

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

    CreateProject201Response data, response status code and response headers



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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/mudbase/api/projects_api.rb', line 124

def create_project_with_http_info(org_id, create_project_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.create_project ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.create_project"
  end
  # verify the required parameter 'create_project_request' is set
  if @api_client.config.client_side_validation && create_project_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_project_request' when calling ProjectsApi.create_project"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects'.sub('{' + 'orgId' + '}', CGI.escape(org_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_project_request)

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

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

  new_options = opts.merge(
    :operation => :"ProjectsApi.create_project",
    :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: ProjectsApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_project(org_id, id, opts = {}) ⇒ MessageResponse

Delete project Delete a project permanently. This is a destructive operation. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:



187
188
189
190
# File 'lib/mudbase/api/projects_api.rb', line 187

def delete_project(org_id, id, opts = {})
  data, _status_code, _headers = delete_project_with_http_info(org_id, id, opts)
  data
end

#delete_project_with_http_info(org_id, id, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Delete project Delete a project permanently. This is a destructive operation. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/mudbase/api/projects_api.rb', line 198

def delete_project_with_http_info(org_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.delete_project ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.delete_project"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.delete_project"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects/{id}'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.delete_project",
    :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: ProjectsApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_o_auth_provider_config(project_id, provider, opts = {}) ⇒ GetOAuthProviderConfig200Response

Get OAuth provider configuration Returns the configuration for a specific OAuth provider for the project (without sensitive data)

Parameters:

  • project_id (String)
  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



256
257
258
259
# File 'lib/mudbase/api/projects_api.rb', line 256

def get_o_auth_provider_config(project_id, provider, opts = {})
  data, _status_code, _headers = get_o_auth_provider_config_with_http_info(project_id, provider, opts)
  data
end

#get_o_auth_provider_config_with_http_info(project_id, provider, opts = {}) ⇒ Array<(GetOAuthProviderConfig200Response, Integer, Hash)>

Get OAuth provider configuration Returns the configuration for a specific OAuth provider for the project (without sensitive data)

Parameters:

  • project_id (String)
  • provider (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/mudbase/api/projects_api.rb', line 267

def get_o_auth_provider_config_with_http_info(project_id, provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.get_o_auth_provider_config ...'
  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 ProjectsApi.get_o_auth_provider_config"
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling ProjectsApi.get_o_auth_provider_config"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "apple", "twitter", "discord", "linkedin", "dropbox", "slack", "reddit", "twitch", "figma", "zoom", "bitbucket", "salesforce", "shopify", "line", "spotify", "strava", "paypal", "asana", "trello", "okta", "gitea", "yandex", "yahoo", "vk", "meetup"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/auth/oauth/projects/{projectId}/providers/{provider}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'provider' + '}', CGI.escape(provider.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] || 'GetOAuthProviderConfig200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.get_o_auth_provider_config",
    :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: ProjectsApi#get_o_auth_provider_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project(org_id, id, opts = {}) ⇒ Project

Get single project Get project details by ID. Accepts: OrgBearerAuth (for admin users), ProjectBearerAuth (JWT for authenticated users), or ApiKeyAuth (X-API-Key for programmatic access). Both ProjectBearerAuth and ApiKeyAuth are fully implemented.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:



330
331
332
333
# File 'lib/mudbase/api/projects_api.rb', line 330

def get_project(org_id, id, opts = {})
  data, _status_code, _headers = get_project_with_http_info(org_id, id, opts)
  data
end

#get_project_captcha_config(org_id, id, opts = {}) ⇒ GetProjectCaptchaConfig200Response

Get project CAPTCHA configuration Get CAPTCHA configuration for a project. This is a public endpoint that returns the site key and settings needed for frontend integration. Secret key is never returned.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:



399
400
401
402
# File 'lib/mudbase/api/projects_api.rb', line 399

def get_project_captcha_config(org_id, id, opts = {})
  data, _status_code, _headers = get_project_captcha_config_with_http_info(org_id, id, opts)
  data
end

#get_project_captcha_config_with_http_info(org_id, id, opts = {}) ⇒ Array<(GetProjectCaptchaConfig200Response, Integer, Hash)>

Get project CAPTCHA configuration Get CAPTCHA configuration for a project. This is a public endpoint that returns the site key and settings needed for frontend integration. Secret key is never returned.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:



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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/mudbase/api/projects_api.rb', line 410

def get_project_captcha_config_with_http_info(org_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project_captcha_config ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.get_project_captcha_config"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.get_project_captcha_config"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects/{id}/auth/captcha'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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] || 'GetProjectCaptchaConfig200Response'

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

  new_options = opts.merge(
    :operation => :"ProjectsApi.get_project_captcha_config",
    :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: ProjectsApi#get_project_captcha_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project_dashboard_overview(project_id, opts = {}) ⇒ ProjectDashboardOverviewResponse

Project dashboard overview Single response for the project overview UI: project info, request counts and day-over-day % change, active users (distinct JWT users with project activity; realtime socket count when available), Uptime (30d headline) is organization-wide when enough HTTP samples exist, else DB heartbeat probes. Average latency (today / 7d) is per project and counts only routes documented in openapi-docs.yaml for customer/project API (excludes auth, /api/users, /api/orgs, role-elevation, and multi-role admin routes). Request volume and active users remain per-project. 14-day API call volume and recent audit activity are per-project. See docs/dashboard-overview-api.md.

Parameters:

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

    the optional parameters

Returns:



467
468
469
470
# File 'lib/mudbase/api/projects_api.rb', line 467

def get_project_dashboard_overview(project_id, opts = {})
  data, _status_code, _headers = get_project_dashboard_overview_with_http_info(project_id, opts)
  data
end

#get_project_dashboard_overview_with_http_info(project_id, opts = {}) ⇒ Array<(ProjectDashboardOverviewResponse, Integer, Hash)>

Project dashboard overview Single response for the project overview UI: project info, request counts and day-over-day % change, active users (distinct JWT users with project activity; realtime socket count when available), Uptime (30d headline) is organization-wide when enough HTTP samples exist, else DB heartbeat probes. Average latency (today / 7d) is per project and counts only routes documented in `openapi-docs.yaml` for customer/project API (excludes auth, `/api/users`, `/api/orgs`, role-elevation, and multi-role admin routes). Request volume and active users remain per-project. 14-day API call volume and recent audit activity are per-project. See docs/dashboard-overview-api.md.

Parameters:

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

    the optional parameters

Returns:



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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/mudbase/api/projects_api.rb', line 477

def get_project_dashboard_overview_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project_dashboard_overview ...'
  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 ProjectsApi.get_project_dashboard_overview"
  end
  # resource path
  local_var_path = '/api/projects/{projectId}/dashboard/overview'.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']

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

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

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

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

  new_options = opts.merge(
    :operation => :"ProjectsApi.get_project_dashboard_overview",
    :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: ProjectsApi#get_project_dashboard_overview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project_o_auth_providers(project_id, opts = {}) ⇒ GetProjectOAuthProviders200Response

Get configured OAuth providers for a project Returns a list of OAuth providers that are configured and enabled for the specified project

Parameters:

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

    the optional parameters

Returns:



530
531
532
533
# File 'lib/mudbase/api/projects_api.rb', line 530

def get_project_o_auth_providers(project_id, opts = {})
  data, _status_code, _headers = get_project_o_auth_providers_with_http_info(project_id, opts)
  data
end

#get_project_o_auth_providers_with_http_info(project_id, opts = {}) ⇒ Array<(GetProjectOAuthProviders200Response, Integer, Hash)>

Get configured OAuth providers for a project Returns a list of OAuth providers that are configured and enabled for the specified project

Parameters:

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

    the optional parameters

Returns:



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
583
584
585
586
# File 'lib/mudbase/api/projects_api.rb', line 540

def get_project_o_auth_providers_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project_o_auth_providers ...'
  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 ProjectsApi.get_project_o_auth_providers"
  end
  # resource path
  local_var_path = '/api/auth/oauth/projects/{projectId}/providers'.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.get_project_o_auth_providers",
    :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: ProjectsApi#get_project_o_auth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project_usage(org_id, id, opts = {}) ⇒ ProjectUsageResponse

Get project usage statistics

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:



593
594
595
596
# File 'lib/mudbase/api/projects_api.rb', line 593

def get_project_usage(org_id, id, opts = {})
  data, _status_code, _headers = get_project_usage_with_http_info(org_id, id, opts)
  data
end

#get_project_usage_with_http_info(org_id, id, opts = {}) ⇒ Array<(ProjectUsageResponse, Integer, Hash)>

Get project usage statistics

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:

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

    ProjectUsageResponse data, response status code and response headers



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
651
652
653
# File 'lib/mudbase/api/projects_api.rb', line 603

def get_project_usage_with_http_info(org_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project_usage ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.get_project_usage"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.get_project_usage"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects/{id}/usage'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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] || 'ProjectUsageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.get_project_usage",
    :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: ProjectsApi#get_project_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_project_with_http_info(org_id, id, opts = {}) ⇒ Array<(Project, Integer, Hash)>

Get single project Get project details by ID. Accepts: OrgBearerAuth (for admin users), ProjectBearerAuth (JWT for authenticated users), or ApiKeyAuth (X-API-Key for programmatic access). Both ProjectBearerAuth and ApiKeyAuth are fully implemented.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:

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

    Project data, response status code and response headers



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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/mudbase/api/projects_api.rb', line 341

def get_project_with_http_info(org_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.get_project"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.get_project"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects/{id}'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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] || 'Project'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.get_project",
    :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: ProjectsApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_projects(org_id, opts = {}) ⇒ ListProjects200Response

List all projects List all projects in an organization. Requires: OrgBearerAuth (organization-level authentication only).

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Returns:



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

def list_projects(org_id, opts = {})
  data, _status_code, _headers = list_projects_with_http_info(org_id, opts)
  data
end

#list_projects_with_http_info(org_id, opts = {}) ⇒ Array<(ListProjects200Response, Integer, Hash)>

List all projects List all projects in an organization. Requires: OrgBearerAuth (organization-level authentication only).

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Returns:

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

    ListProjects200Response data, response status code and response headers



670
671
672
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
# File 'lib/mudbase/api/projects_api.rb', line 670

def list_projects_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.list_projects ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.list_projects"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects'.sub('{' + 'orgId' + '}', CGI.escape(org_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] || 'ListProjects200Response'

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

  new_options = opts.merge(
    :operation => :"ProjectsApi.list_projects",
    :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: ProjectsApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_o_auth_provider_config(project_id, provider, update_o_auth_provider_config_request, opts = {}) ⇒ ConfigureOAuthProvider200Response

Update OAuth provider configuration Updates the configuration for an OAuth provider for the specified project

Parameters:

  • project_id (String)
  • provider (String)
  • update_o_auth_provider_config_request (UpdateOAuthProviderConfigRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



725
726
727
728
# File 'lib/mudbase/api/projects_api.rb', line 725

def update_o_auth_provider_config(project_id, provider, update_o_auth_provider_config_request, opts = {})
  data, _status_code, _headers = update_o_auth_provider_config_with_http_info(project_id, provider, update_o_auth_provider_config_request, opts)
  data
end

#update_o_auth_provider_config_with_http_info(project_id, provider, update_o_auth_provider_config_request, opts = {}) ⇒ Array<(ConfigureOAuthProvider200Response, Integer, Hash)>

Update OAuth provider configuration Updates the configuration for an OAuth provider for the specified project

Parameters:

  • project_id (String)
  • provider (String)
  • update_o_auth_provider_config_request (UpdateOAuthProviderConfigRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
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
# File 'lib/mudbase/api/projects_api.rb', line 737

def update_o_auth_provider_config_with_http_info(project_id, provider, update_o_auth_provider_config_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.update_o_auth_provider_config ...'
  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 ProjectsApi.update_o_auth_provider_config"
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling ProjectsApi.update_o_auth_provider_config"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "apple", "twitter", "discord", "linkedin", "dropbox", "slack", "reddit", "twitch", "figma", "zoom", "bitbucket", "salesforce", "shopify", "line", "spotify", "strava", "paypal", "asana", "trello", "okta", "gitea", "yandex", "yahoo", "vk", "meetup"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'update_o_auth_provider_config_request' is set
  if @api_client.config.client_side_validation && update_o_auth_provider_config_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_o_auth_provider_config_request' when calling ProjectsApi.update_o_auth_provider_config"
  end
  # resource path
  local_var_path = '/api/auth/oauth/projects/{projectId}/providers/{provider}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'provider' + '}', CGI.escape(provider.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_o_auth_provider_config_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.update_o_auth_provider_config",
    :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: ProjectsApi#update_o_auth_provider_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_project(org_id, id, update_project_request, opts = {}) ⇒ CreateProject201Response

Update project Update project configuration (name, description, settings). Settings toggles: requireEmailVerification (default true) — when on, new email signups do not get a token until they verify; login is blocked until verified. requirePhoneVerification (default false) — when on, phone/OTP users must verify before token. defaultUserAccountStatusactive (default) or pending; when pending, new users must be approved by org owner/admin before they can perform data/storage operations. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:



810
811
812
813
# File 'lib/mudbase/api/projects_api.rb', line 810

def update_project(org_id, id, update_project_request, opts = {})
  data, _status_code, _headers = update_project_with_http_info(org_id, id, update_project_request, opts)
  data
end

#update_project_with_http_info(org_id, id, update_project_request, opts = {}) ⇒ Array<(CreateProject201Response, Integer, Hash)>

Update project Update project configuration (name, description, settings). Settings toggles: requireEmailVerification (default true) — when on, new email signups do not get a token until they verify; login is blocked until verified. requirePhoneVerification (default false) — when on, phone/OTP users must verify before token. defaultUserAccountStatusactive (default) or pending; when pending, new users must be approved by org owner/admin before they can perform data/storage operations. Requires JWT Bearer token authentication. Both OrgBearerAuth and ProjectBearerAuth are supported (they use the same JWT token format). These are organization-level operations.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

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

    the optional parameters

Returns:

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

    CreateProject201Response data, response status code and response headers



822
823
824
825
826
827
828
829
830
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
# File 'lib/mudbase/api/projects_api.rb', line 822

def update_project_with_http_info(org_id, id, update_project_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.update_project ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.update_project"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.update_project"
  end
  # verify the required parameter 'update_project_request' is set
  if @api_client.config.client_side_validation && update_project_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_project_request' when calling ProjectsApi.update_project"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects/{id}'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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_project_request)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.update_project",
    :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: ProjectsApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_project_logo(id, logo, opts = {}) ⇒ UploadProjectLogo200Response

Upload project logo (by project ID) Upload a logo image for a project. File is stored in the platform storage under logo/project/projectId/. The public URL is saved to the project's logoUrl field and used in project-related emails and UI. Project is resolved from the authenticated user's org. Use multipart/form-data with field name logo. Allowed types: PNG, JPEG, GIF, WebP. Max size 2MB.

Parameters:

  • id (String)

    Project ID

  • logo (File)

    Logo image (PNG, JPEG, GIF, or WebP; max 2MB)

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

    the optional parameters

Returns:



889
890
891
892
# File 'lib/mudbase/api/projects_api.rb', line 889

def (id, , opts = {})
  data, _status_code, _headers = upload_project_logo_with_http_info(id, , opts)
  data
end

#upload_project_logo_by_org(org_id, id, logo, opts = {}) ⇒ UploadProjectLogo200Response

Upload project logo (by org and project ID) Upload a logo image for a project. File is stored in the platform storage under logo/project/projectId/. The public URL is saved to the project's logoUrl field. Use multipart/form-data with field name logo. Allowed types: PNG, JPEG, GIF, WebP. Max size 2MB. Requires project update permission and membership in the organization.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

  • logo (File)

    Logo image (PNG, JPEG, GIF, or WebP; max 2MB)

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

    the optional parameters

Returns:



965
966
967
968
# File 'lib/mudbase/api/projects_api.rb', line 965

def upload_project_logo_by_org(org_id, id, , opts = {})
  data, _status_code, _headers = upload_project_logo_by_org_with_http_info(org_id, id, , opts)
  data
end

#upload_project_logo_by_org_with_http_info(org_id, id, logo, opts = {}) ⇒ Array<(UploadProjectLogo200Response, Integer, Hash)>

Upload project logo (by org and project ID) Upload a logo image for a project. File is stored in the platform storage under logo/project/projectId/. The public URL is saved to the project's logoUrl field. Use multipart/form-data with field name logo. Allowed types: PNG, JPEG, GIF, WebP. Max size 2MB. Requires project update permission and membership in the organization.

Parameters:

  • org_id (String)

    Organization ID

  • id (String)

    Project ID

  • logo (File)

    Logo image (PNG, JPEG, GIF, or WebP; max 2MB)

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

    the optional parameters

Returns:



977
978
979
980
981
982
983
984
985
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
# File 'lib/mudbase/api/projects_api.rb', line 977

def upload_project_logo_by_org_with_http_info(org_id, id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.upload_project_logo_by_org ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling ProjectsApi.upload_project_logo_by_org"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.upload_project_logo_by_org"
  end
  # verify the required parameter 'logo' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'logo' when calling ProjectsApi.upload_project_logo_by_org"
  end
  # resource path
  local_var_path = '/api/projects/{orgId}/projects/{id}/logo'.sub('{' + 'orgId' + '}', CGI.escape(org_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"ProjectsApi.upload_project_logo_by_org",
    :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: ProjectsApi#upload_project_logo_by_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_project_logo_with_http_info(id, logo, opts = {}) ⇒ Array<(UploadProjectLogo200Response, Integer, Hash)>

Upload project logo (by project ID) Upload a logo image for a project. File is stored in the platform storage under logo/project/projectId/. The public URL is saved to the project's logoUrl field and used in project-related emails and UI. Project is resolved from the authenticated user's org. Use multipart/form-data with field name logo. Allowed types: PNG, JPEG, GIF, WebP. Max size 2MB.

Parameters:

  • id (String)

    Project ID

  • logo (File)

    Logo image (PNG, JPEG, GIF, or WebP; max 2MB)

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

    the optional parameters

Returns:



900
901
902
903
904
905
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
# File 'lib/mudbase/api/projects_api.rb', line 900

def upload_project_logo_with_http_info(id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.upload_project_logo ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.upload_project_logo"
  end
  # verify the required parameter 'logo' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'logo' when calling ProjectsApi.upload_project_logo"
  end
  # resource path
  local_var_path = '/api/projects/{id}/logo'.sub('{' + 'id' + '}', CGI.escape(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(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

  new_options = opts.merge(
    :operation => :"ProjectsApi.upload_project_logo",
    :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: ProjectsApi#upload_project_logo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end