Class: RokkaClientCodegen::AdminApi

Inherits:
Object
  • Object
show all
Defined in:
lib/rokka_client_codegen/api/admin_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AdminApi

Returns a new instance of AdminApi.



19
20
21
# File 'lib/rokka_client_codegen/api/admin_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/rokka_client_codegen/api/admin_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_membership(role, organization, email, opts = {}) ⇒ Membership

Add a rokka user into an organization.

Parameters:

  • role

    Role specification

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

    the optional parameters

Returns:



30
31
32
33
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 30

def create_membership(role, organization, email, opts = {})
  data, _status_code, _headers = create_membership_with_http_info(role, organization, email, opts)
  return data
end

#create_membership_with_http_info(role, organization, email, opts = {}) ⇒ Array<(Membership, Fixnum, Hash)>

Add a rokka user into an organization.

Parameters:

  • role

    Role specification

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

    the optional parameters

Returns:

  • (Array<(Membership, Fixnum, Hash)>)

    Membership data, response status code and response headers



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/rokka_client_codegen/api/admin_api.rb', line 42

def create_membership_with_http_info(role, organization, email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.create_membership ..."
  end
  # verify the required parameter 'role' is set
  if @api_client.config.client_side_validation && role.nil?
    fail ArgumentError, "Missing the required parameter 'role' when calling AdminApi.create_membership"
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.create_membership"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling AdminApi.create_membership, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling AdminApi.create_membership"
  end
  # resource path
  local_var_path = "/organizations/{organization}/memberships/{email}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'email' + '}', email.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(role)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Membership')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#create_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_organization(organization, organization_definition, opts = {}) ⇒ Organization

Register a new Organization.

Parameters:

  • organization

    Name of the organization to create (must be a web safe string)

  • organization_definition

    Organization information

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

    the optional parameters

Returns:



96
97
98
99
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 96

def create_organization(organization, organization_definition, opts = {})
  data, _status_code, _headers = create_organization_with_http_info(organization, organization_definition, opts)
  return data
end

#create_organization_options(organization, organization_options, opts = {}) ⇒ Organization

Update options for an organization. This is currently used for the remote_* options. See rokka.io/documentation/references/stacks.html#loading-images-from-a-remote-url for details.

Parameters:

  • organization

    Organization name

  • organization_options

    Organization options

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

    the optional parameters

Returns:



157
158
159
160
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 157

def create_organization_options(organization, organization_options, opts = {})
  data, _status_code, _headers = create_organization_options_with_http_info(organization, organization_options, opts)
  return data
end

#create_organization_options_with_http_info(organization, organization_options, opts = {}) ⇒ Array<(Organization, Fixnum, Hash)>

Update options for an organization. This is currently used for the remote_* options. See rokka.io/documentation/references/stacks.html#loading-images-from-a-remote-url for details.

Parameters:

  • organization

    Organization name

  • organization_options

    Organization options

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

    the optional parameters

Returns:

  • (Array<(Organization, Fixnum, Hash)>)

    Organization data, response status code and response headers



168
169
170
171
172
173
174
175
176
177
178
179
180
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
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 168

def create_organization_options_with_http_info(organization, organization_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.create_organization_options ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.create_organization_options"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling AdminApi.create_organization_options, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'organization_options' is set
  if @api_client.config.client_side_validation && organization_options.nil?
    fail ArgumentError, "Missing the required parameter 'organization_options' when calling AdminApi.create_organization_options"
  end
  # resource path
  local_var_path = "/organizations/{organization}/options".sub('{' + 'organization' + '}', organization.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(organization_options)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Organization')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#create_organization_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_organization_with_http_info(organization, organization_definition, opts = {}) ⇒ Array<(Organization, Fixnum, Hash)>

Register a new Organization.

Parameters:

  • organization

    Name of the organization to create (must be a web safe string)

  • organization_definition

    Organization information

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

    the optional parameters

Returns:

  • (Array<(Organization, Fixnum, Hash)>)

    Organization 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
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 107

def create_organization_with_http_info(organization, organization_definition, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.create_organization ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.create_organization"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling AdminApi.create_organization, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'organization_definition' is set
  if @api_client.config.client_side_validation && organization_definition.nil?
    fail ArgumentError, "Missing the required parameter 'organization_definition' when calling AdminApi.create_organization"
  end
  # resource path
  local_var_path = "/organizations/{organization}".sub('{' + 'organization' + '}', organization.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(organization_definition)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Organization')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_user(user_definition, opts = {}) ⇒ User

Register new user.

Parameters:

  • user_definition

    User information

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

    the optional parameters

Returns:



217
218
219
220
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 217

def create_user(user_definition, opts = {})
  data, _status_code, _headers = create_user_with_http_info(user_definition, opts)
  return data
end

#create_user_with_http_info(user_definition, opts = {}) ⇒ Array<(User, Fixnum, Hash)>

Register new user.

Parameters:

  • user_definition

    User information

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

    the optional parameters

Returns:

  • (Array<(User, Fixnum, Hash)>)

    User data, response status code and response headers



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 227

def create_user_with_http_info(user_definition, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.create_user ..."
  end
  # verify the required parameter 'user_definition' is set
  if @api_client.config.client_side_validation && user_definition.nil?
    fail ArgumentError, "Missing the required parameter 'user_definition' when calling AdminApi.create_user"
  end
  # resource path
  local_var_path = "/users"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(user_definition)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'User')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_membership(organization, email, opts = {}) ⇒ nil

Remove a user from an organization.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


269
270
271
272
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 269

def delete_membership(organization, email, opts = {})
  delete_membership_with_http_info(organization, email, opts)
  return nil
end

#delete_membership_with_http_info(organization, email, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Remove a user from an organization.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 280

def delete_membership_with_http_info(organization, email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.delete_membership ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.delete_membership"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling AdminApi.delete_membership, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling AdminApi.delete_membership"
  end
  # resource path
  local_var_path = "/organizations/{organization}/memberships/{email}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'email' + '}', email.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#delete_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_membership(organization, email, opts = {}) ⇒ Membership

Get information about organization membership of a rokka user.

Parameters:

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

    the optional parameters

Returns:



329
330
331
332
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 329

def get_membership(organization, email, opts = {})
  data, _status_code, _headers = get_membership_with_http_info(organization, email, opts)
  return data
end

#get_membership_with_http_info(organization, email, opts = {}) ⇒ Array<(Membership, Fixnum, Hash)>

Get information about organization membership of a rokka user.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Membership, Fixnum, Hash)>)

    Membership data, response status code and response headers



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
373
374
375
376
377
378
379
380
381
382
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 340

def get_membership_with_http_info(organization, email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.get_membership ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.get_membership"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling AdminApi.get_membership, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling AdminApi.get_membership"
  end
  # resource path
  local_var_path = "/organizations/{organization}/memberships/{email}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'email' + '}', email.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Membership')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#get_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_organization(organization, opts = {}) ⇒ Organization

Get information about an organization.

Parameters:

  • organization

    Organization name

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

    the optional parameters

Returns:



389
390
391
392
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 389

def get_organization(organization, opts = {})
  data, _status_code, _headers = get_organization_with_http_info(organization, opts)
  return data
end

#get_organization_with_http_info(organization, opts = {}) ⇒ Array<(Organization, Fixnum, Hash)>

Get information about an organization.

Parameters:

  • organization

    Organization name

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

    the optional parameters

Returns:

  • (Array<(Organization, Fixnum, Hash)>)

    Organization data, response status code and response headers



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
# File 'lib/rokka_client_codegen/api/admin_api.rb', line 399

def get_organization_with_http_info(organization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AdminApi.get_organization ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.get_organization"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling AdminApi.get_organization, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # resource path
  local_var_path = "/organizations/{organization}".sub('{' + 'organization' + '}', organization.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Organization')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdminApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end