Class: OryClient::ReadApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ory-client/api/read_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReadApi

Returns a new instance of ReadApi.



19
20
21
# File 'lib/ory-client/api/read_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/ory-client/api/read_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_check(opts = {}) ⇒ GetCheckResponse

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :namespace (String)

    Namespace of the Relation Tuple

  • :object (String)

    Object of the Relation Tuple

  • :relation (String)

    Relation of the Relation Tuple

  • :subject_id (String)

    SubjectID of the Relation Tuple

  • :subject_set_namespace (String)

    Namespace of the Subject Set

  • :subject_set_object (String)

    Object of the Subject Set

  • :subject_set_relation (String)

    Relation of the Subject Set

  • :max_depth (Integer)

Returns:



34
35
36
37
# File 'lib/ory-client/api/read_api.rb', line 34

def get_check(opts = {})
  data, _status_code, _headers = get_check_with_http_info(opts)
  data
end

#get_check_mirror_status(opts = {}) ⇒ GetCheckResponse

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Returns:



107
108
109
110
# File 'lib/ory-client/api/read_api.rb', line 107

def get_check_mirror_status(opts = {})
  data, _status_code, _headers = get_check_mirror_status_with_http_info(opts)
  data
end

#get_check_mirror_status_with_http_info(opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Returns:

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

    GetCheckResponse data, response status code and response headers



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/ory-client/api/read_api.rb', line 116

def get_check_mirror_status_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReadApi.get_check_mirror_status ...'
  end
  # resource path
  local_var_path = '/relation-tuples/check'

  # 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] || 'GetCheckResponse'

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

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

#get_check_with_http_info(opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :namespace (String)

    Namespace of the Relation Tuple

  • :object (String)

    Object of the Relation Tuple

  • :relation (String)

    Relation of the Relation Tuple

  • :subject_id (String)

    SubjectID of the Relation Tuple

  • :subject_set_namespace (String)

    Namespace of the Subject Set

  • :subject_set_object (String)

    Object of the Subject Set

  • :subject_set_relation (String)

    Relation of the Subject Set

  • :max_depth (Integer)

Returns:

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

    GetCheckResponse data, response status code and response headers



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
# File 'lib/ory-client/api/read_api.rb', line 51

def get_check_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReadApi.get_check ...'
  end
  # resource path
  local_var_path = '/relation-tuples/check/openapi'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
  query_params[:'object'] = opts[:'object'] if !opts[:'object'].nil?
  query_params[:'relation'] = opts[:'relation'] if !opts[:'relation'].nil?
  query_params[:'subject_id'] = opts[:'subject_id'] if !opts[:'subject_id'].nil?
  query_params[:'subject_set.namespace'] = opts[:'subject_set_namespace'] if !opts[:'subject_set_namespace'].nil?
  query_params[:'subject_set.object'] = opts[:'subject_set_object'] if !opts[:'subject_set_object'].nil?
  query_params[:'subject_set.relation'] = opts[:'subject_set_relation'] if !opts[:'subject_set_relation'].nil?
  query_params[:'max-depth'] = opts[:'max_depth'] if !opts[:'max_depth'].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] || 'GetCheckResponse'

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

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

#get_expand(namespace, object, relation, opts = {}) ⇒ ExpandTree

Expand a Relation Tuple Use this endpoint to expand a relation tuple.

Parameters:

  • namespace (String)

    Namespace of the Subject Set

  • object (String)

    Object of the Subject Set

  • relation (String)

    Relation of the Subject Set

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

    the optional parameters

Options Hash (opts):

  • :max_depth (Integer)

Returns:



168
169
170
171
# File 'lib/ory-client/api/read_api.rb', line 168

def get_expand(namespace, object, relation, opts = {})
  data, _status_code, _headers = get_expand_with_http_info(namespace, object, relation, opts)
  data
end

#get_expand_with_http_info(namespace, object, relation, opts = {}) ⇒ Array<(ExpandTree, Integer, Hash)>

Expand a Relation Tuple Use this endpoint to expand a relation tuple.

Parameters:

  • namespace (String)

    Namespace of the Subject Set

  • object (String)

    Object of the Subject Set

  • relation (String)

    Relation of the Subject Set

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

    the optional parameters

Options Hash (opts):

  • :max_depth (Integer)

Returns:

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

    ExpandTree data, response status code and response headers



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

def get_expand_with_http_info(namespace, object, relation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReadApi.get_expand ...'
  end
  # verify the required parameter 'namespace' is set
  if @api_client.config.client_side_validation && namespace.nil?
    fail ArgumentError, "Missing the required parameter 'namespace' when calling ReadApi.get_expand"
  end
  # verify the required parameter 'object' is set
  if @api_client.config.client_side_validation && object.nil?
    fail ArgumentError, "Missing the required parameter 'object' when calling ReadApi.get_expand"
  end
  # verify the required parameter 'relation' is set
  if @api_client.config.client_side_validation && relation.nil?
    fail ArgumentError, "Missing the required parameter 'relation' when calling ReadApi.get_expand"
  end
  # resource path
  local_var_path = '/relation-tuples/expand'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'namespace'] = namespace
  query_params[:'object'] = object
  query_params[:'relation'] = relation
  query_params[:'max-depth'] = opts[:'max_depth'] if !opts[:'max_depth'].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] || 'ExpandTree'

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

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

#get_relation_tuples(opts = {}) ⇒ GetRelationTuplesResponse

Query relation tuples Get all relation tuples that match the query. Only the namespace field is required.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_token (String)
  • :page_size (Integer)
  • :namespace (String)

    Namespace of the Relation Tuple

  • :object (String)

    Object of the Relation Tuple

  • :relation (String)

    Relation of the Relation Tuple

  • :subject_id (String)

    SubjectID of the Relation Tuple

  • :subject_set_namespace (String)

    Namespace of the Subject Set

  • :subject_set_object (String)

    Object of the Subject Set

  • :subject_set_relation (String)

    Relation of the Subject Set

Returns:



254
255
256
257
# File 'lib/ory-client/api/read_api.rb', line 254

def get_relation_tuples(opts = {})
  data, _status_code, _headers = get_relation_tuples_with_http_info(opts)
  data
end

#get_relation_tuples_with_http_info(opts = {}) ⇒ Array<(GetRelationTuplesResponse, Integer, Hash)>

Query relation tuples Get all relation tuples that match the query. Only the namespace field is required.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_token (String)
  • :page_size (Integer)
  • :namespace (String)

    Namespace of the Relation Tuple

  • :object (String)

    Object of the Relation Tuple

  • :relation (String)

    Relation of the Relation Tuple

  • :subject_id (String)

    SubjectID of the Relation Tuple

  • :subject_set_namespace (String)

    Namespace of the Subject Set

  • :subject_set_object (String)

    Object of the Subject Set

  • :subject_set_relation (String)

    Relation of the Subject Set

Returns:

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

    GetRelationTuplesResponse data, response status code and response headers



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
323
# File 'lib/ory-client/api/read_api.rb', line 272

def get_relation_tuples_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReadApi.get_relation_tuples ...'
  end
  # resource path
  local_var_path = '/relation-tuples'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'namespace'] = opts[:'namespace'] if !opts[:'namespace'].nil?
  query_params[:'object'] = opts[:'object'] if !opts[:'object'].nil?
  query_params[:'relation'] = opts[:'relation'] if !opts[:'relation'].nil?
  query_params[:'subject_id'] = opts[:'subject_id'] if !opts[:'subject_id'].nil?
  query_params[:'subject_set.namespace'] = opts[:'subject_set_namespace'] if !opts[:'subject_set_namespace'].nil?
  query_params[:'subject_set.object'] = opts[:'subject_set_object'] if !opts[:'subject_set_object'].nil?
  query_params[:'subject_set.relation'] = opts[:'subject_set_relation'] if !opts[:'subject_set_relation'].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] || 'GetRelationTuplesResponse'

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

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

#post_check(opts = {}) ⇒ GetCheckResponse

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



331
332
333
334
# File 'lib/ory-client/api/read_api.rb', line 331

def post_check(opts = {})
  data, _status_code, _headers = post_check_with_http_info(opts)
  data
end

#post_check_mirror_status(opts = {}) ⇒ GetCheckResponse

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Returns:



396
397
398
399
# File 'lib/ory-client/api/read_api.rb', line 396

def post_check_mirror_status(opts = {})
  data, _status_code, _headers = post_check_mirror_status_with_http_info(opts)
  data
end

#post_check_mirror_status_with_http_info(opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Returns:

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

    GetCheckResponse data, response status code and response headers



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/ory-client/api/read_api.rb', line 405

def post_check_mirror_status_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReadApi.post_check_mirror_status ...'
  end
  # resource path
  local_var_path = '/relation-tuples/check'

  # 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] || 'GetCheckResponse'

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

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

#post_check_with_http_info(opts = {}) ⇒ Array<(GetCheckResponse, Integer, Hash)>

Check a relation tuple To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    GetCheckResponse data, response status code and response headers



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
# File 'lib/ory-client/api/read_api.rb', line 342

def post_check_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReadApi.post_check ...'
  end
  # resource path
  local_var_path = '/relation-tuples/check/openapi'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'max-depth'] = opts[:'max_depth'] if !opts[:'max_depth'].nil?

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

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

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

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

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

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