Class: OpenapiClient::OPALDataApi

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_client/api/opal_data_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OPALDataApi

Returns a new instance of OPALDataApi.



19
20
21
# File 'lib/openapi_client/api/opal_data_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/openapi_client/api/opal_data_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_all_data(org_id, proj_id, env_id, opts = {}) ⇒ FullData

Get All Data

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the "slug").

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

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

    the optional parameters

Options Hash (opts):

  • :__internal_update_cache (Boolean) — default: default to false

Returns:



29
30
31
32
# File 'lib/openapi_client/api/opal_data_api.rb', line 29

def get_all_data(org_id, proj_id, env_id, opts = {})
  data, _status_code, _headers = get_all_data_with_http_info(org_id, proj_id, env_id, opts)
  data
end

#get_all_data_with_http_info(org_id, proj_id, env_id, opts = {}) ⇒ Array<(FullData, Integer, Hash)>

Get All Data

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

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

    the optional parameters

Options Hash (opts):

  • :__internal_update_cache (Boolean) — default: default to false

Returns:

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

    FullData data, response status code and response headers



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
# File 'lib/openapi_client/api/opal_data_api.rb', line 41

def get_all_data_with_http_info(org_id, proj_id, env_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OPALDataApi.get_all_data ...'
  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 OPALDataApi.get_all_data"
  end
  # verify the required parameter 'proj_id' is set
  if @api_client.config.client_side_validation && proj_id.nil?
    fail ArgumentError, "Missing the required parameter 'proj_id' when calling OPALDataApi.get_all_data"
  end
  # verify the required parameter 'env_id' is set
  if @api_client.config.client_side_validation && env_id.nil?
    fail ArgumentError, "Missing the required parameter 'env_id' when calling OPALDataApi.get_all_data"
  end
  # resource path
  local_var_path = '/v2/internal/opal_data/{org_id}/{proj_id}/{env_id}'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s)).sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))

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

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

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

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

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

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

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

#get_data_for_role(org_id, proj_id, env_id, role_id, opts = {}) ⇒ RoleData

Get Data For Role

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

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

    the optional parameters

Returns:



105
106
107
108
# File 'lib/openapi_client/api/opal_data_api.rb', line 105

def get_data_for_role(org_id, proj_id, env_id, role_id, opts = {})
  data, _status_code, _headers = get_data_for_role_with_http_info(org_id, proj_id, env_id, role_id, opts)
  data
end

#get_data_for_role_with_http_info(org_id, proj_id, env_id, role_id, opts = {}) ⇒ Array<(RoleData, Integer, Hash)>

Get Data For Role

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

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

    the optional parameters

Returns:

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

    RoleData data, response status code and response headers



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
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/openapi_client/api/opal_data_api.rb', line 117

def get_data_for_role_with_http_info(org_id, proj_id, env_id, role_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OPALDataApi.get_data_for_role ...'
  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 OPALDataApi.get_data_for_role"
  end
  # verify the required parameter 'proj_id' is set
  if @api_client.config.client_side_validation && proj_id.nil?
    fail ArgumentError, "Missing the required parameter 'proj_id' when calling OPALDataApi.get_data_for_role"
  end
  # verify the required parameter 'env_id' is set
  if @api_client.config.client_side_validation && env_id.nil?
    fail ArgumentError, "Missing the required parameter 'env_id' when calling OPALDataApi.get_data_for_role"
  end
  # verify the required parameter 'role_id' is set
  if @api_client.config.client_side_validation && role_id.nil?
    fail ArgumentError, "Missing the required parameter 'role_id' when calling OPALDataApi.get_data_for_role"
  end
  # resource path
  local_var_path = '/v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/roles/{role_id}'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s)).sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_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'])

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

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

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

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

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

#get_data_for_set_rule(org_id, proj_id, env_id, user_set_id, resource_set_id, opts = {}) ⇒ Hash<String, Array<String>>

Get Data For Set Rule return permission assignment data between user sets and resource sets (i.e: condition set rules data)

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

  • user_set_id (String)
  • resource_set_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Hash<String, Array<String>>)


186
187
188
189
# File 'lib/openapi_client/api/opal_data_api.rb', line 186

def get_data_for_set_rule(org_id, proj_id, env_id, user_set_id, resource_set_id, opts = {})
  data, _status_code, _headers = get_data_for_set_rule_with_http_info(org_id, proj_id, env_id, user_set_id, resource_set_id, opts)
  data
end

#get_data_for_set_rule_with_http_info(org_id, proj_id, env_id, user_set_id, resource_set_id, opts = {}) ⇒ Array<(Hash<String, Array<String>>, Integer, Hash)>

Get Data For Set Rule return permission assignment data between user sets and resource sets (i.e: condition set rules data)

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

  • user_set_id (String)
  • resource_set_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Hash<String, Array<String>> data, response status code and response headers



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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/openapi_client/api/opal_data_api.rb', line 200

def get_data_for_set_rule_with_http_info(org_id, proj_id, env_id, user_set_id, resource_set_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OPALDataApi.get_data_for_set_rule ...'
  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 OPALDataApi.get_data_for_set_rule"
  end
  # verify the required parameter 'proj_id' is set
  if @api_client.config.client_side_validation && proj_id.nil?
    fail ArgumentError, "Missing the required parameter 'proj_id' when calling OPALDataApi.get_data_for_set_rule"
  end
  # verify the required parameter 'env_id' is set
  if @api_client.config.client_side_validation && env_id.nil?
    fail ArgumentError, "Missing the required parameter 'env_id' when calling OPALDataApi.get_data_for_set_rule"
  end
  # verify the required parameter 'user_set_id' is set
  if @api_client.config.client_side_validation && user_set_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_set_id' when calling OPALDataApi.get_data_for_set_rule"
  end
  # verify the required parameter 'resource_set_id' is set
  if @api_client.config.client_side_validation && resource_set_id.nil?
    fail ArgumentError, "Missing the required parameter 'resource_set_id' when calling OPALDataApi.get_data_for_set_rule"
  end
  # resource path
  local_var_path = '/v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/condition_set_rules/{user_set_id}/{resource_set_id}'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s)).sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'user_set_id' + '}', CGI.escape(user_set_id.to_s)).sub('{' + 'resource_set_id' + '}', CGI.escape(resource_set_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'])

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Array<String>>'

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

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

#get_data_for_user(org_id, proj_id, env_id, user_id, opts = {}) ⇒ UserData

Get Data For User

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

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

    the optional parameters

Returns:



271
272
273
274
# File 'lib/openapi_client/api/opal_data_api.rb', line 271

def get_data_for_user(org_id, proj_id, env_id, user_id, opts = {})
  data, _status_code, _headers = get_data_for_user_with_http_info(org_id, proj_id, env_id, user_id, opts)
  data
end

#get_data_for_user_with_http_info(org_id, proj_id, env_id, user_id, opts = {}) ⇒ Array<(UserData, Integer, Hash)>

Get Data For User

Parameters:

  • org_id (String)

    Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the &quot;slug&quot;).

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

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

    the optional parameters

Returns:

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

    UserData data, response status code and response headers



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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/openapi_client/api/opal_data_api.rb', line 283

def get_data_for_user_with_http_info(org_id, proj_id, env_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OPALDataApi.get_data_for_user ...'
  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 OPALDataApi.get_data_for_user"
  end
  # verify the required parameter 'proj_id' is set
  if @api_client.config.client_side_validation && proj_id.nil?
    fail ArgumentError, "Missing the required parameter 'proj_id' when calling OPALDataApi.get_data_for_user"
  end
  # verify the required parameter 'env_id' is set
  if @api_client.config.client_side_validation && env_id.nil?
    fail ArgumentError, "Missing the required parameter 'env_id' when calling OPALDataApi.get_data_for_user"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling OPALDataApi.get_data_for_user"
  end
  # resource path
  local_var_path = '/v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/users/{user_id}'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s)).sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_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'])

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

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

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

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

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