ory-keto-client 0.5.3.alpha2 → 0.6.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +22 -31
  4. data/docs/AddOryAccessControlPolicyRoleMembersBody.md +8 -7
  5. data/docs/AuthorizationResult.md +8 -7
  6. data/docs/EnginesApi.md +319 -129
  7. data/docs/ExpandTree.md +22 -0
  8. data/docs/GetCheckResponse.md +18 -0
  9. data/docs/GetRelationTuplesResponse.md +20 -0
  10. data/docs/HealthApi.md +50 -15
  11. data/docs/HealthNotReadyStatus.md +8 -7
  12. data/docs/HealthStatus.md +8 -7
  13. data/docs/InlineResponse400.md +28 -0
  14. data/docs/InlineResponse500.md +18 -17
  15. data/docs/InternalRelationTuple.md +24 -0
  16. data/docs/OryAccessControlPolicy.md +20 -19
  17. data/docs/OryAccessControlPolicyAllowedInput.md +14 -13
  18. data/docs/OryAccessControlPolicyRole.md +10 -9
  19. data/docs/PatchDelta.md +20 -0
  20. data/docs/ReadApi.md +297 -0
  21. data/docs/Version.md +8 -7
  22. data/docs/VersionApi.md +26 -9
  23. data/docs/WriteApi.md +212 -0
  24. data/lib/ory-keto-client.rb +10 -9
  25. data/lib/ory-keto-client/api/engines_api.rb +46 -35
  26. data/lib/ory-keto-client/api/health_api.rb +10 -8
  27. data/lib/ory-keto-client/api/read_api.rb +324 -0
  28. data/lib/ory-keto-client/api/version_api.rb +6 -5
  29. data/lib/ory-keto-client/api/write_api.rb +225 -0
  30. data/lib/ory-keto-client/api_client.rb +51 -47
  31. data/lib/ory-keto-client/api_error.rb +2 -2
  32. data/lib/ory-keto-client/configuration.rb +40 -11
  33. data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_body.rb +20 -8
  34. data/lib/ory-keto-client/models/authorization_result.rb +20 -8
  35. data/lib/ory-keto-client/models/expand_tree.rb +282 -0
  36. data/lib/ory-keto-client/models/get_check_response.rb +225 -0
  37. data/lib/ory-keto-client/models/get_relation_tuples_response.rb +230 -0
  38. data/lib/ory-keto-client/models/health_not_ready_status.rb +20 -8
  39. data/lib/ory-keto-client/models/health_status.rb +20 -8
  40. data/lib/ory-keto-client/models/inline_response400.rb +265 -0
  41. data/lib/ory-keto-client/models/inline_response500.rb +21 -9
  42. data/lib/ory-keto-client/models/internal_relation_tuple.rb +268 -0
  43. data/lib/ory-keto-client/models/ory_access_control_policy.rb +22 -12
  44. data/lib/ory-keto-client/models/ory_access_control_policy_allowed_input.rb +22 -12
  45. data/lib/ory-keto-client/models/ory_access_control_policy_role.rb +20 -8
  46. data/lib/ory-keto-client/models/patch_delta.rb +227 -0
  47. data/lib/ory-keto-client/models/version.rb +20 -8
  48. data/lib/ory-keto-client/version.rb +3 -3
  49. data/ory-keto-client.gemspec +4 -5
  50. data/spec/api/read_api_spec.rb +94 -0
  51. data/spec/api/write_api_spec.rb +74 -0
  52. data/spec/api_client_spec.rb +4 -4
  53. data/spec/configuration_spec.rb +3 -3
  54. data/spec/models/expand_tree_spec.rb +50 -0
  55. data/spec/models/get_check_response_spec.rb +34 -0
  56. data/spec/models/get_relation_tuples_response_spec.rb +40 -0
  57. data/spec/models/inline_response400_spec.rb +64 -0
  58. data/spec/models/internal_relation_tuple_spec.rb +52 -0
  59. data/spec/models/patch_delta_spec.rb +40 -0
  60. data/spec/spec_helper.rb +3 -3
  61. metadata +87 -75
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
5
 
6
- The version of the OpenAPI document: Latest
6
+ The version of the OpenAPI document: v0.6.0-alpha.3
7
7
  Contact: hi@ory.sh
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -17,20 +17,21 @@ require 'ory-keto-client/version'
17
17
  require 'ory-keto-client/configuration'
18
18
 
19
19
  # Models
20
- require 'ory-keto-client/models/add_ory_access_control_policy_role_members_body'
21
- require 'ory-keto-client/models/authorization_result'
20
+ require 'ory-keto-client/models/expand_tree'
21
+ require 'ory-keto-client/models/get_check_response'
22
+ require 'ory-keto-client/models/get_relation_tuples_response'
22
23
  require 'ory-keto-client/models/health_not_ready_status'
23
24
  require 'ory-keto-client/models/health_status'
24
- require 'ory-keto-client/models/inline_response500'
25
- require 'ory-keto-client/models/ory_access_control_policy'
26
- require 'ory-keto-client/models/ory_access_control_policy_allowed_input'
27
- require 'ory-keto-client/models/ory_access_control_policy_role'
25
+ require 'ory-keto-client/models/inline_response400'
26
+ require 'ory-keto-client/models/internal_relation_tuple'
27
+ require 'ory-keto-client/models/patch_delta'
28
28
  require 'ory-keto-client/models/version'
29
29
 
30
30
  # APIs
31
- require 'ory-keto-client/api/engines_api'
32
31
  require 'ory-keto-client/api/health_api'
32
+ require 'ory-keto-client/api/read_api'
33
33
  require 'ory-keto-client/api/version_api'
34
+ require 'ory-keto-client/api/write_api'
34
35
 
35
36
  module OryHydraClient
36
37
  class << self
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
5
 
6
- The version of the OpenAPI document: Latest
6
+ The version of the OpenAPI document: v0.0.0-alpha.58
7
7
  Contact: hi@ory.sh
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 5.0.0
10
10
 
11
11
  =end
12
12
 
@@ -67,15 +67,16 @@ module OryHydraClient
67
67
  form_params = opts[:form_params] || {}
68
68
 
69
69
  # http body (model)
70
- post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
70
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
71
71
 
72
72
  # return_type
73
- return_type = opts[:return_type] || 'OryAccessControlPolicyRole'
73
+ return_type = opts[:debug_return_type] || 'OryAccessControlPolicyRole'
74
74
 
75
75
  # auth_names
76
- auth_names = opts[:auth_names] || []
76
+ auth_names = opts[:debug_auth_names] || []
77
77
 
78
78
  new_options = opts.merge(
79
+ :operation => :"EnginesApi.add_ory_access_control_policy_role_members",
79
80
  :header_params => header_params,
80
81
  :query_params => query_params,
81
82
  :form_params => form_params,
@@ -133,15 +134,16 @@ module OryHydraClient
133
134
  form_params = opts[:form_params] || {}
134
135
 
135
136
  # http body (model)
136
- post_body = opts[:body]
137
+ post_body = opts[:debug_body]
137
138
 
138
139
  # return_type
139
- return_type = opts[:return_type]
140
+ return_type = opts[:debug_return_type]
140
141
 
141
142
  # auth_names
142
- auth_names = opts[:auth_names] || []
143
+ auth_names = opts[:debug_auth_names] || []
143
144
 
144
145
  new_options = opts.merge(
146
+ :operation => :"EnginesApi.delete_ory_access_control_policy",
145
147
  :header_params => header_params,
146
148
  :query_params => query_params,
147
149
  :form_params => form_params,
@@ -201,15 +203,16 @@ module OryHydraClient
201
203
  form_params = opts[:form_params] || {}
202
204
 
203
205
  # http body (model)
204
- post_body = opts[:body]
206
+ post_body = opts[:debug_body]
205
207
 
206
208
  # return_type
207
- return_type = opts[:return_type]
209
+ return_type = opts[:debug_return_type]
208
210
 
209
211
  # auth_names
210
- auth_names = opts[:auth_names] || []
212
+ auth_names = opts[:debug_auth_names] || []
211
213
 
212
214
  new_options = opts.merge(
215
+ :operation => :"EnginesApi.delete_ory_access_control_policy_role",
213
216
  :header_params => header_params,
214
217
  :query_params => query_params,
215
218
  :form_params => form_params,
@@ -267,15 +270,16 @@ module OryHydraClient
267
270
  form_params = opts[:form_params] || {}
268
271
 
269
272
  # http body (model)
270
- post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
273
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
271
274
 
272
275
  # return_type
273
- return_type = opts[:return_type] || 'AuthorizationResult'
276
+ return_type = opts[:debug_return_type] || 'AuthorizationResult'
274
277
 
275
278
  # auth_names
276
- auth_names = opts[:auth_names] || []
279
+ auth_names = opts[:debug_auth_names] || []
277
280
 
278
281
  new_options = opts.merge(
282
+ :operation => :"EnginesApi.do_ory_access_control_policies_allow",
279
283
  :header_params => header_params,
280
284
  :query_params => query_params,
281
285
  :form_params => form_params,
@@ -333,15 +337,16 @@ module OryHydraClient
333
337
  form_params = opts[:form_params] || {}
334
338
 
335
339
  # http body (model)
336
- post_body = opts[:body]
340
+ post_body = opts[:debug_body]
337
341
 
338
342
  # return_type
339
- return_type = opts[:return_type] || 'OryAccessControlPolicy'
343
+ return_type = opts[:debug_return_type] || 'OryAccessControlPolicy'
340
344
 
341
345
  # auth_names
342
- auth_names = opts[:auth_names] || []
346
+ auth_names = opts[:debug_auth_names] || []
343
347
 
344
348
  new_options = opts.merge(
349
+ :operation => :"EnginesApi.get_ory_access_control_policy",
345
350
  :header_params => header_params,
346
351
  :query_params => query_params,
347
352
  :form_params => form_params,
@@ -401,15 +406,16 @@ module OryHydraClient
401
406
  form_params = opts[:form_params] || {}
402
407
 
403
408
  # http body (model)
404
- post_body = opts[:body]
409
+ post_body = opts[:debug_body]
405
410
 
406
411
  # return_type
407
- return_type = opts[:return_type] || 'OryAccessControlPolicyRole'
412
+ return_type = opts[:debug_return_type] || 'OryAccessControlPolicyRole'
408
413
 
409
414
  # auth_names
410
- auth_names = opts[:auth_names] || []
415
+ auth_names = opts[:debug_auth_names] || []
411
416
 
412
417
  new_options = opts.merge(
418
+ :operation => :"EnginesApi.get_ory_access_control_policy_role",
413
419
  :header_params => header_params,
414
420
  :query_params => query_params,
415
421
  :form_params => form_params,
@@ -476,15 +482,16 @@ module OryHydraClient
476
482
  form_params = opts[:form_params] || {}
477
483
 
478
484
  # http body (model)
479
- post_body = opts[:body]
485
+ post_body = opts[:debug_body]
480
486
 
481
487
  # return_type
482
- return_type = opts[:return_type] || 'Array<OryAccessControlPolicy>'
488
+ return_type = opts[:debug_return_type] || 'Array<OryAccessControlPolicy>'
483
489
 
484
490
  # auth_names
485
- auth_names = opts[:auth_names] || []
491
+ auth_names = opts[:debug_auth_names] || []
486
492
 
487
493
  new_options = opts.merge(
494
+ :operation => :"EnginesApi.list_ory_access_control_policies",
488
495
  :header_params => header_params,
489
496
  :query_params => query_params,
490
497
  :form_params => form_params,
@@ -547,15 +554,16 @@ module OryHydraClient
547
554
  form_params = opts[:form_params] || {}
548
555
 
549
556
  # http body (model)
550
- post_body = opts[:body]
557
+ post_body = opts[:debug_body]
551
558
 
552
559
  # return_type
553
- return_type = opts[:return_type] || 'Array<OryAccessControlPolicyRole>'
560
+ return_type = opts[:debug_return_type] || 'Array<OryAccessControlPolicyRole>'
554
561
 
555
562
  # auth_names
556
- auth_names = opts[:auth_names] || []
563
+ auth_names = opts[:debug_auth_names] || []
557
564
 
558
565
  new_options = opts.merge(
566
+ :operation => :"EnginesApi.list_ory_access_control_policy_roles",
559
567
  :header_params => header_params,
560
568
  :query_params => query_params,
561
569
  :form_params => form_params,
@@ -621,15 +629,16 @@ module OryHydraClient
621
629
  form_params = opts[:form_params] || {}
622
630
 
623
631
  # http body (model)
624
- post_body = opts[:body]
632
+ post_body = opts[:debug_body]
625
633
 
626
634
  # return_type
627
- return_type = opts[:return_type]
635
+ return_type = opts[:debug_return_type]
628
636
 
629
637
  # auth_names
630
- auth_names = opts[:auth_names] || []
638
+ auth_names = opts[:debug_auth_names] || []
631
639
 
632
640
  new_options = opts.merge(
641
+ :operation => :"EnginesApi.remove_ory_access_control_policy_role_members",
633
642
  :header_params => header_params,
634
643
  :query_params => query_params,
635
644
  :form_params => form_params,
@@ -685,15 +694,16 @@ module OryHydraClient
685
694
  form_params = opts[:form_params] || {}
686
695
 
687
696
  # http body (model)
688
- post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
697
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
689
698
 
690
699
  # return_type
691
- return_type = opts[:return_type] || 'OryAccessControlPolicy'
700
+ return_type = opts[:debug_return_type] || 'OryAccessControlPolicy'
692
701
 
693
702
  # auth_names
694
- auth_names = opts[:auth_names] || []
703
+ auth_names = opts[:debug_auth_names] || []
695
704
 
696
705
  new_options = opts.merge(
706
+ :operation => :"EnginesApi.upsert_ory_access_control_policy",
697
707
  :header_params => header_params,
698
708
  :query_params => query_params,
699
709
  :form_params => form_params,
@@ -751,15 +761,16 @@ module OryHydraClient
751
761
  form_params = opts[:form_params] || {}
752
762
 
753
763
  # http body (model)
754
- post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
764
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
755
765
 
756
766
  # return_type
757
- return_type = opts[:return_type] || 'OryAccessControlPolicyRole'
767
+ return_type = opts[:debug_return_type] || 'OryAccessControlPolicyRole'
758
768
 
759
769
  # auth_names
760
- auth_names = opts[:auth_names] || []
770
+ auth_names = opts[:debug_auth_names] || []
761
771
 
762
772
  new_options = opts.merge(
773
+ :operation => :"EnginesApi.upsert_ory_access_control_policy_role",
763
774
  :header_params => header_params,
764
775
  :query_params => query_params,
765
776
  :form_params => form_params,
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
5
 
6
- The version of the OpenAPI document: Latest
6
+ The version of the OpenAPI document: v0.6.0-alpha.3
7
7
  Contact: hi@ory.sh
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -51,15 +51,16 @@ module OryHydraClient
51
51
  form_params = opts[:form_params] || {}
52
52
 
53
53
  # http body (model)
54
- post_body = opts[:body]
54
+ post_body = opts[:debug_body]
55
55
 
56
56
  # return_type
57
- return_type = opts[:return_type] || 'HealthStatus'
57
+ return_type = opts[:debug_return_type] || 'HealthStatus'
58
58
 
59
59
  # auth_names
60
- auth_names = opts[:auth_names] || []
60
+ auth_names = opts[:debug_auth_names] || []
61
61
 
62
62
  new_options = opts.merge(
63
+ :operation => :"HealthApi.is_instance_alive",
63
64
  :header_params => header_params,
64
65
  :query_params => query_params,
65
66
  :form_params => form_params,
@@ -107,15 +108,16 @@ module OryHydraClient
107
108
  form_params = opts[:form_params] || {}
108
109
 
109
110
  # http body (model)
110
- post_body = opts[:body]
111
+ post_body = opts[:debug_body]
111
112
 
112
113
  # return_type
113
- return_type = opts[:return_type] || 'HealthStatus'
114
+ return_type = opts[:debug_return_type] || 'HealthStatus'
114
115
 
115
116
  # auth_names
116
- auth_names = opts[:auth_names] || []
117
+ auth_names = opts[:debug_auth_names] || []
117
118
 
118
119
  new_options = opts.merge(
120
+ :operation => :"HealthApi.is_instance_ready",
119
121
  :header_params => header_params,
120
122
  :query_params => query_params,
121
123
  :form_params => form_params,
@@ -0,0 +1,324 @@
1
+ =begin
2
+ #ORY Keto
3
+
4
+ #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
+
6
+ The version of the OpenAPI document: v0.6.0-alpha.3
7
+ Contact: hi@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OryHydraClient
16
+ class ReadApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Check a relation tuple
23
+ # To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).
24
+ # @param namespace [String] Namespace of the Relation Tuple
25
+ # @param object [String] Object of the Relation Tuple
26
+ # @param relation [String] Relation of the Relation Tuple
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :subject Subject of the Relation Tuple The subject follows the subject string encoding format.
29
+ # @return [GetCheckResponse]
30
+ def get_check(namespace, object, relation, opts = {})
31
+ data, _status_code, _headers = get_check_with_http_info(namespace, object, relation, opts)
32
+ data
33
+ end
34
+
35
+ # Check a relation tuple
36
+ # To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).
37
+ # @param namespace [String] Namespace of the Relation Tuple
38
+ # @param object [String] Object of the Relation Tuple
39
+ # @param relation [String] Relation of the Relation Tuple
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [String] :subject Subject of the Relation Tuple The subject follows the subject string encoding format.
42
+ # @return [Array<(GetCheckResponse, Integer, Hash)>] GetCheckResponse data, response status code and response headers
43
+ def get_check_with_http_info(namespace, object, relation, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: ReadApi.get_check ...'
46
+ end
47
+ # verify the required parameter 'namespace' is set
48
+ if @api_client.config.client_side_validation && namespace.nil?
49
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling ReadApi.get_check"
50
+ end
51
+ # verify the required parameter 'object' is set
52
+ if @api_client.config.client_side_validation && object.nil?
53
+ fail ArgumentError, "Missing the required parameter 'object' when calling ReadApi.get_check"
54
+ end
55
+ # verify the required parameter 'relation' is set
56
+ if @api_client.config.client_side_validation && relation.nil?
57
+ fail ArgumentError, "Missing the required parameter 'relation' when calling ReadApi.get_check"
58
+ end
59
+ # resource path
60
+ local_var_path = '/check'
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+ query_params[:'namespace'] = namespace
65
+ query_params[:'object'] = object
66
+ query_params[:'relation'] = relation
67
+ query_params[:'subject'] = opts[:'subject'] if !opts[:'subject'].nil?
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
73
+
74
+ # form parameters
75
+ form_params = opts[:form_params] || {}
76
+
77
+ # http body (model)
78
+ post_body = opts[:debug_body]
79
+
80
+ # return_type
81
+ return_type = opts[:debug_return_type] || 'GetCheckResponse'
82
+
83
+ # auth_names
84
+ auth_names = opts[:debug_auth_names] || []
85
+
86
+ new_options = opts.merge(
87
+ :operation => :"ReadApi.get_check",
88
+ :header_params => header_params,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body,
92
+ :auth_names => auth_names,
93
+ :return_type => return_type
94
+ )
95
+
96
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "API called: ReadApi#get_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
99
+ end
100
+ return data, status_code, headers
101
+ end
102
+
103
+ # Expand a Relation Tuple
104
+ # Use this endpoint to expand a relation tuple.
105
+ # @param namespace [String] Namespace of the Relation Tuple
106
+ # @param object [String] Object of the Relation Tuple
107
+ # @param relation [String] Relation of the Relation Tuple
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [Integer] :max_depth
110
+ # @return [ExpandTree]
111
+ def get_expand(namespace, object, relation, opts = {})
112
+ data, _status_code, _headers = get_expand_with_http_info(namespace, object, relation, opts)
113
+ data
114
+ end
115
+
116
+ # Expand a Relation Tuple
117
+ # Use this endpoint to expand a relation tuple.
118
+ # @param namespace [String] Namespace of the Relation Tuple
119
+ # @param object [String] Object of the Relation Tuple
120
+ # @param relation [String] Relation of the Relation Tuple
121
+ # @param [Hash] opts the optional parameters
122
+ # @option opts [Integer] :max_depth
123
+ # @return [Array<(ExpandTree, Integer, Hash)>] ExpandTree data, response status code and response headers
124
+ def get_expand_with_http_info(namespace, object, relation, opts = {})
125
+ if @api_client.config.debugging
126
+ @api_client.config.logger.debug 'Calling API: ReadApi.get_expand ...'
127
+ end
128
+ # verify the required parameter 'namespace' is set
129
+ if @api_client.config.client_side_validation && namespace.nil?
130
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling ReadApi.get_expand"
131
+ end
132
+ # verify the required parameter 'object' is set
133
+ if @api_client.config.client_side_validation && object.nil?
134
+ fail ArgumentError, "Missing the required parameter 'object' when calling ReadApi.get_expand"
135
+ end
136
+ # verify the required parameter 'relation' is set
137
+ if @api_client.config.client_side_validation && relation.nil?
138
+ fail ArgumentError, "Missing the required parameter 'relation' when calling ReadApi.get_expand"
139
+ end
140
+ # resource path
141
+ local_var_path = '/expand'
142
+
143
+ # query parameters
144
+ query_params = opts[:query_params] || {}
145
+ query_params[:'namespace'] = namespace
146
+ query_params[:'object'] = object
147
+ query_params[:'relation'] = relation
148
+ query_params[:'max-depth'] = opts[:'max_depth'] if !opts[:'max_depth'].nil?
149
+
150
+ # header parameters
151
+ header_params = opts[:header_params] || {}
152
+ # HTTP header 'Accept' (if needed)
153
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
154
+
155
+ # form parameters
156
+ form_params = opts[:form_params] || {}
157
+
158
+ # http body (model)
159
+ post_body = opts[:debug_body]
160
+
161
+ # return_type
162
+ return_type = opts[:debug_return_type] || 'ExpandTree'
163
+
164
+ # auth_names
165
+ auth_names = opts[:debug_auth_names] || []
166
+
167
+ new_options = opts.merge(
168
+ :operation => :"ReadApi.get_expand",
169
+ :header_params => header_params,
170
+ :query_params => query_params,
171
+ :form_params => form_params,
172
+ :body => post_body,
173
+ :auth_names => auth_names,
174
+ :return_type => return_type
175
+ )
176
+
177
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug "API called: ReadApi#get_expand\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
180
+ end
181
+ return data, status_code, headers
182
+ end
183
+
184
+ # Query relation tuples
185
+ # Get all relation tuples that match the query. Only the namespace field is required.
186
+ # @param namespace [String]
187
+ # @param [Hash] opts the optional parameters
188
+ # @option opts [String] :object
189
+ # @option opts [String] :relation
190
+ # @option opts [String] :subject
191
+ # @option opts [String] :page_token
192
+ # @option opts [Integer] :page_size
193
+ # @return [GetRelationTuplesResponse]
194
+ def get_relation_tuples(namespace, opts = {})
195
+ data, _status_code, _headers = get_relation_tuples_with_http_info(namespace, opts)
196
+ data
197
+ end
198
+
199
+ # Query relation tuples
200
+ # Get all relation tuples that match the query. Only the namespace field is required.
201
+ # @param namespace [String]
202
+ # @param [Hash] opts the optional parameters
203
+ # @option opts [String] :object
204
+ # @option opts [String] :relation
205
+ # @option opts [String] :subject
206
+ # @option opts [String] :page_token
207
+ # @option opts [Integer] :page_size
208
+ # @return [Array<(GetRelationTuplesResponse, Integer, Hash)>] GetRelationTuplesResponse data, response status code and response headers
209
+ def get_relation_tuples_with_http_info(namespace, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug 'Calling API: ReadApi.get_relation_tuples ...'
212
+ end
213
+ # verify the required parameter 'namespace' is set
214
+ if @api_client.config.client_side_validation && namespace.nil?
215
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling ReadApi.get_relation_tuples"
216
+ end
217
+ # resource path
218
+ local_var_path = '/relation-tuples'
219
+
220
+ # query parameters
221
+ query_params = opts[:query_params] || {}
222
+ query_params[:'namespace'] = namespace
223
+ query_params[:'object'] = opts[:'object'] if !opts[:'object'].nil?
224
+ query_params[:'relation'] = opts[:'relation'] if !opts[:'relation'].nil?
225
+ query_params[:'subject'] = opts[:'subject'] if !opts[:'subject'].nil?
226
+ query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
227
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
228
+
229
+ # header parameters
230
+ header_params = opts[:header_params] || {}
231
+ # HTTP header 'Accept' (if needed)
232
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
233
+
234
+ # form parameters
235
+ form_params = opts[:form_params] || {}
236
+
237
+ # http body (model)
238
+ post_body = opts[:debug_body]
239
+
240
+ # return_type
241
+ return_type = opts[:debug_return_type] || 'GetRelationTuplesResponse'
242
+
243
+ # auth_names
244
+ auth_names = opts[:debug_auth_names] || []
245
+
246
+ new_options = opts.merge(
247
+ :operation => :"ReadApi.get_relation_tuples",
248
+ :header_params => header_params,
249
+ :query_params => query_params,
250
+ :form_params => form_params,
251
+ :body => post_body,
252
+ :auth_names => auth_names,
253
+ :return_type => return_type
254
+ )
255
+
256
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug "API called: ReadApi#get_relation_tuples\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
259
+ end
260
+ return data, status_code, headers
261
+ end
262
+
263
+ # Check a relation tuple
264
+ # To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).
265
+ # @param [Hash] opts the optional parameters
266
+ # @option opts [InternalRelationTuple] :payload
267
+ # @return [GetCheckResponse]
268
+ def post_check(opts = {})
269
+ data, _status_code, _headers = post_check_with_http_info(opts)
270
+ data
271
+ end
272
+
273
+ # Check a relation tuple
274
+ # To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).
275
+ # @param [Hash] opts the optional parameters
276
+ # @option opts [InternalRelationTuple] :payload
277
+ # @return [Array<(GetCheckResponse, Integer, Hash)>] GetCheckResponse data, response status code and response headers
278
+ def post_check_with_http_info(opts = {})
279
+ if @api_client.config.debugging
280
+ @api_client.config.logger.debug 'Calling API: ReadApi.post_check ...'
281
+ end
282
+ # resource path
283
+ local_var_path = '/check'
284
+
285
+ # query parameters
286
+ query_params = opts[:query_params] || {}
287
+
288
+ # header parameters
289
+ header_params = opts[:header_params] || {}
290
+ # HTTP header 'Accept' (if needed)
291
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
292
+ # HTTP header 'Content-Type'
293
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
294
+
295
+ # form parameters
296
+ form_params = opts[:form_params] || {}
297
+
298
+ # http body (model)
299
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'payload'])
300
+
301
+ # return_type
302
+ return_type = opts[:debug_return_type] || 'GetCheckResponse'
303
+
304
+ # auth_names
305
+ auth_names = opts[:debug_auth_names] || []
306
+
307
+ new_options = opts.merge(
308
+ :operation => :"ReadApi.post_check",
309
+ :header_params => header_params,
310
+ :query_params => query_params,
311
+ :form_params => form_params,
312
+ :body => post_body,
313
+ :auth_names => auth_names,
314
+ :return_type => return_type
315
+ )
316
+
317
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: ReadApi#post_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+ end
324
+ end