permit-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/api/api.rb +25 -0
- data/lib/api/base.rb +26 -0
- data/lib/api/resources.rb +13 -0
- data/lib/api/tenants.rb +11 -0
- data/lib/api/users.rb +50 -0
- data/lib/api/utils.rb +9 -0
- data/lib/config.rb +23 -0
- data/lib/main.rb +49 -0
- data/lib/openapi_client/api/api_keys_api.rb +413 -0
- data/lib/openapi_client/api/audit_elements_data_api.rb +118 -0
- data/lib/openapi_client/api/audit_logs_api.rb +204 -0
- data/lib/openapi_client/api/authentication_api.rb +512 -0
- data/lib/openapi_client/api/condition_set_rules_api.rb +278 -0
- data/lib/openapi_client/api/condition_sets_api.rb +428 -0
- data/lib/openapi_client/api/decision_logs_api.rb +128 -0
- data/lib/openapi_client/api/decision_logs_ingress_api.rb +90 -0
- data/lib/openapi_client/api/default_api.rb +297 -0
- data/lib/openapi_client/api/elements_configs_api.rb +657 -0
- data/lib/openapi_client/api/environments_api.rb +462 -0
- data/lib/openapi_client/api/instructions_api.rb +91 -0
- data/lib/openapi_client/api/members_api.rb +354 -0
- data/lib/openapi_client/api/opal_data_api.rb +343 -0
- data/lib/openapi_client/api/organizations_api.rb +652 -0
- data/lib/openapi_client/api/policy_api.rb +138 -0
- data/lib/openapi_client/api/policy_decision_points_api.rb +382 -0
- data/lib/openapi_client/api/policy_git_repositories_api.rb +510 -0
- data/lib/openapi_client/api/projects_api.rb +365 -0
- data/lib/openapi_client/api/resource_actions_api.rb +455 -0
- data/lib/openapi_client/api/resource_attributes_api.rb +473 -0
- data/lib/openapi_client/api/resource_instances_api.rb +425 -0
- data/lib/openapi_client/api/resource_roles_api.rb +813 -0
- data/lib/openapi_client/api/resources_api.rb +514 -0
- data/lib/openapi_client/api/role_assignments_api.rb +278 -0
- data/lib/openapi_client/api/roles_api.rb +759 -0
- data/lib/openapi_client/api/tenants_api.rb +603 -0
- data/lib/openapi_client/api/user_attributes_api.rb +458 -0
- data/lib/openapi_client/api/users_api.rb +684 -0
- data/lib/openapi_client/api/users_elements_data_api.rb +638 -0
- data/lib/openapi_client/api_client.rb +392 -0
- data/lib/openapi_client/api_error.rb +57 -0
- data/lib/openapi_client/configuration.rb +280 -0
- data/lib/openapi_client/models/action_block_editable.rb +230 -0
- data/lib/openapi_client/models/action_block_read.rb +255 -0
- data/lib/openapi_client/models/action_object.rb +275 -0
- data/lib/openapi_client/models/actor.rb +57 -0
- data/lib/openapi_client/models/add_role_permissions.rb +227 -0
- data/lib/openapi_client/models/api_key_create.rb +269 -0
- data/lib/openapi_client/models/api_key_owner_type.rb +41 -0
- data/lib/openapi_client/models/api_key_read.rb +329 -0
- data/lib/openapi_client/models/api_key_scope_read.rb +245 -0
- data/lib/openapi_client/models/attribute_block_editable.rb +235 -0
- data/lib/openapi_client/models/attribute_block_read.rb +260 -0
- data/lib/openapi_client/models/attribute_type.rb +44 -0
- data/lib/openapi_client/models/attributes.rb +231 -0
- data/lib/openapi_client/models/audit_log.rb +415 -0
- data/lib/openapi_client/models/audit_log_objects.rb +282 -0
- data/lib/openapi_client/models/authn_me_api_key_read.rb +329 -0
- data/lib/openapi_client/models/authn_me_member_read.rb +352 -0
- data/lib/openapi_client/models/authn_me_read.rb +224 -0
- data/lib/openapi_client/models/authn_me_user_read.rb +440 -0
- data/lib/openapi_client/models/condition_set_create.rb +340 -0
- data/lib/openapi_client/models/condition_set_read.rb +409 -0
- data/lib/openapi_client/models/condition_set_rule_create.rb +279 -0
- data/lib/openapi_client/models/condition_set_rule_read.rb +360 -0
- data/lib/openapi_client/models/condition_set_rule_remove.rb +279 -0
- data/lib/openapi_client/models/condition_set_type.rb +40 -0
- data/lib/openapi_client/models/condition_set_update.rb +255 -0
- data/lib/openapi_client/models/data_source_config.rb +228 -0
- data/lib/openapi_client/models/data_source_entry.rb +272 -0
- data/lib/openapi_client/models/detailed_audit_log.rb +443 -0
- data/lib/openapi_client/models/dev_login.rb +225 -0
- data/lib/openapi_client/models/dummy_engine_model.rb +229 -0
- data/lib/openapi_client/models/elements_config_create.rb +319 -0
- data/lib/openapi_client/models/elements_config_read.rb +402 -0
- data/lib/openapi_client/models/elements_config_runtime_read.rb +238 -0
- data/lib/openapi_client/models/elements_config_update.rb +268 -0
- data/lib/openapi_client/models/elements_env_type_read.rb +242 -0
- data/lib/openapi_client/models/elements_env_type_update.rb +222 -0
- data/lib/openapi_client/models/elements_permission_level.rb +44 -0
- data/lib/openapi_client/models/elements_role_read.rb +378 -0
- data/lib/openapi_client/models/elements_type.rb +41 -0
- data/lib/openapi_client/models/elements_user_create.rb +295 -0
- data/lib/openapi_client/models/elements_user_role_create.rb +225 -0
- data/lib/openapi_client/models/elements_user_role_remove.rb +225 -0
- data/lib/openapi_client/models/embedded_login_request_output.rb +265 -0
- data/lib/openapi_client/models/engine.rb +39 -0
- data/lib/openapi_client/models/environment_create.rb +281 -0
- data/lib/openapi_client/models/environment_object.rb +295 -0
- data/lib/openapi_client/models/environment_read.rb +335 -0
- data/lib/openapi_client/models/environment_stats.rb +365 -0
- data/lib/openapi_client/models/environment_update.rb +240 -0
- data/lib/openapi_client/models/failed_invite.rb +238 -0
- data/lib/openapi_client/models/full_data.rb +258 -0
- data/lib/openapi_client/models/http_validation_error.rb +221 -0
- data/lib/openapi_client/models/identity_read.rb +300 -0
- data/lib/openapi_client/models/invite_attempt_result.rb +232 -0
- data/lib/openapi_client/models/invite_create.rb +240 -0
- data/lib/openapi_client/models/invite_read.rb +325 -0
- data/lib/openapi_client/models/invite_status.rb +42 -0
- data/lib/openapi_client/models/labels.rb +238 -0
- data/lib/openapi_client/models/language_instructions.rb +252 -0
- data/lib/openapi_client/models/location_inner.rb +230 -0
- data/lib/openapi_client/models/login_result.rb +259 -0
- data/lib/openapi_client/models/member_access_level.rb +41 -0
- data/lib/openapi_client/models/member_access_obj.rb +41 -0
- data/lib/openapi_client/models/multi_invite_result.rb +238 -0
- data/lib/openapi_client/models/onboarding_step.rb +46 -0
- data/lib/openapi_client/models/opa_decision_log.rb +288 -0
- data/lib/openapi_client/models/opa_engine_decision_log.rb +345 -0
- data/lib/openapi_client/models/opa_labels.rb +238 -0
- data/lib/openapi_client/models/opa_metrics.rb +273 -0
- data/lib/openapi_client/models/opal_client.rb +305 -0
- data/lib/openapi_client/models/org_member_read.rb +420 -0
- data/lib/openapi_client/models/org_member_update.rb +230 -0
- data/lib/openapi_client/models/organization_create.rb +292 -0
- data/lib/openapi_client/models/organization_object.rb +295 -0
- data/lib/openapi_client/models/organization_read.rb +295 -0
- data/lib/openapi_client/models/organization_read_with_api_key.rb +313 -0
- data/lib/openapi_client/models/organization_update.rb +247 -0
- data/lib/openapi_client/models/paginated_result_api_key_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_audit_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_elements_config_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_opa_decision_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_user_read.rb +285 -0
- data/lib/openapi_client/models/pdp.rb +259 -0
- data/lib/openapi_client/models/pdp_config_object.rb +258 -0
- data/lib/openapi_client/models/pdp_config_read.rb +292 -0
- data/lib/openapi_client/models/pdp_context.rb +291 -0
- data/lib/openapi_client/models/pdp_state.rb +224 -0
- data/lib/openapi_client/models/pdp_state_update.rb +238 -0
- data/lib/openapi_client/models/pdp_values.rb +252 -0
- data/lib/openapi_client/models/permission_level_role_read.rb +254 -0
- data/lib/openapi_client/models/policy_repo_create.rb +318 -0
- data/lib/openapi_client/models/policy_repo_read.rb +347 -0
- data/lib/openapi_client/models/policy_repo_status.rb +41 -0
- data/lib/openapi_client/models/programming_language.rb +43 -0
- data/lib/openapi_client/models/project_create.rb +318 -0
- data/lib/openapi_client/models/project_object.rb +295 -0
- data/lib/openapi_client/models/project_read.rb +357 -0
- data/lib/openapi_client/models/project_update.rb +250 -0
- data/lib/openapi_client/models/raw_data.rb +329 -0
- data/lib/openapi_client/models/relationship_tuple_object.rb +252 -0
- data/lib/openapi_client/models/remote_config.rb +256 -0
- data/lib/openapi_client/models/remove_role_permissions.rb +227 -0
- data/lib/openapi_client/models/resource_action_create.rb +271 -0
- data/lib/openapi_client/models/resource_action_read.rb +370 -0
- data/lib/openapi_client/models/resource_action_update.rb +230 -0
- data/lib/openapi_client/models/resource_attribute_create.rb +271 -0
- data/lib/openapi_client/models/resource_attribute_read.rb +370 -0
- data/lib/openapi_client/models/resource_attribute_update.rb +230 -0
- data/lib/openapi_client/models/resource_attributes.rb +238 -0
- data/lib/openapi_client/models/resource_create.rb +310 -0
- data/lib/openapi_client/models/resource_id.rb +230 -0
- data/lib/openapi_client/models/resource_instance_create.rb +281 -0
- data/lib/openapi_client/models/resource_instance_read.rb +375 -0
- data/lib/openapi_client/models/resource_instance_update.rb +220 -0
- data/lib/openapi_client/models/resource_read.rb +374 -0
- data/lib/openapi_client/models/resource_replace.rb +274 -0
- data/lib/openapi_client/models/resource_role_create.rb +295 -0
- data/lib/openapi_client/models/resource_role_read.rb +379 -0
- data/lib/openapi_client/models/resource_role_update.rb +254 -0
- data/lib/openapi_client/models/resource_type_object.rb +286 -0
- data/lib/openapi_client/models/resource_update.rb +264 -0
- data/lib/openapi_client/models/role_assignment_create.rb +255 -0
- data/lib/openapi_client/models/role_assignment_read.rb +375 -0
- data/lib/openapi_client/models/role_assignment_remove.rb +255 -0
- data/lib/openapi_client/models/role_block.rb +244 -0
- data/lib/openapi_client/models/role_create.rb +295 -0
- data/lib/openapi_client/models/role_data.rb +221 -0
- data/lib/openapi_client/models/role_read.rb +364 -0
- data/lib/openapi_client/models/role_update.rb +254 -0
- data/lib/openapi_client/models/settings.rb +231 -0
- data/lib/openapi_client/models/ssh_auth_data.rb +295 -0
- data/lib/openapi_client/models/statistics.rb +389 -0
- data/lib/openapi_client/models/tenant_create.rb +281 -0
- data/lib/openapi_client/models/tenant_object.rb +284 -0
- data/lib/openapi_client/models/tenant_read.rb +365 -0
- data/lib/openapi_client/models/tenant_update.rb +240 -0
- data/lib/openapi_client/models/user_create.rb +286 -0
- data/lib/openapi_client/models/user_data.rb +232 -0
- data/lib/openapi_client/models/user_login_request_input.rb +240 -0
- data/lib/openapi_client/models/user_object.rb +313 -0
- data/lib/openapi_client/models/user_read.rb +336 -0
- data/lib/openapi_client/models/user_role.rb +240 -0
- data/lib/openapi_client/models/user_role_create.rb +240 -0
- data/lib/openapi_client/models/user_role_remove.rb +240 -0
- data/lib/openapi_client/models/user_update.rb +250 -0
- data/lib/openapi_client/models/validation_error.rb +254 -0
- data/lib/openapi_client/models/webhook_create.rb +235 -0
- data/lib/openapi_client/models/webhook_read.rb +315 -0
- data/lib/openapi_client/models/webhook_update.rb +230 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +220 -0
- data/lib/permit.rb +58 -0
- metadata +251 -0
@@ -0,0 +1,428 @@
|
|
1
|
+
=begin
|
2
|
+
#Permit.io API
|
3
|
+
|
4
|
+
# Authorization as a service
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class ConditionSetsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create Condition Set
|
23
|
+
# Creates a new condition set (can be either a user set or a resource set).
|
24
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
25
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
26
|
+
# @param condition_set_create [ConditionSetCreate]
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @return [ConditionSetRead]
|
29
|
+
def create_condition_set(proj_id, env_id, condition_set_create, opts = {})
|
30
|
+
data, _status_code, _headers = create_condition_set_with_http_info(proj_id, env_id, condition_set_create, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create Condition Set
|
35
|
+
# Creates a new condition set (can be either a user set or a resource set).
|
36
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
37
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
38
|
+
# @param condition_set_create [ConditionSetCreate]
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Array<(ConditionSetRead, Integer, Hash)>] ConditionSetRead data, response status code and response headers
|
41
|
+
def create_condition_set_with_http_info(proj_id, env_id, condition_set_create, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: ConditionSetsApi.create_condition_set ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'proj_id' is set
|
46
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetsApi.create_condition_set"
|
48
|
+
end
|
49
|
+
# verify the required parameter 'env_id' is set
|
50
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetsApi.create_condition_set"
|
52
|
+
end
|
53
|
+
# verify the required parameter 'condition_set_create' is set
|
54
|
+
if @api_client.config.client_side_validation && condition_set_create.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'condition_set_create' when calling ConditionSetsApi.create_condition_set"
|
56
|
+
end
|
57
|
+
# resource path
|
58
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/condition_sets'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
|
59
|
+
|
60
|
+
# query parameters
|
61
|
+
query_params = opts[:query_params] || {}
|
62
|
+
|
63
|
+
# header parameters
|
64
|
+
header_params = opts[:header_params] || {}
|
65
|
+
# HTTP header 'Accept' (if needed)
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
67
|
+
# HTTP header 'Content-Type'
|
68
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
69
|
+
if !content_type.nil?
|
70
|
+
header_params['Content-Type'] = content_type
|
71
|
+
end
|
72
|
+
|
73
|
+
# form parameters
|
74
|
+
form_params = opts[:form_params] || {}
|
75
|
+
|
76
|
+
# http body (model)
|
77
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(condition_set_create)
|
78
|
+
|
79
|
+
# return_type
|
80
|
+
return_type = opts[:debug_return_type] || 'ConditionSetRead'
|
81
|
+
|
82
|
+
# auth_names
|
83
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
84
|
+
|
85
|
+
new_options = opts.merge(
|
86
|
+
:operation => :"ConditionSetsApi.create_condition_set",
|
87
|
+
:header_params => header_params,
|
88
|
+
:query_params => query_params,
|
89
|
+
:form_params => form_params,
|
90
|
+
:body => post_body,
|
91
|
+
:auth_names => auth_names,
|
92
|
+
:return_type => return_type
|
93
|
+
)
|
94
|
+
|
95
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug "API called: ConditionSetsApi#create_condition_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
98
|
+
end
|
99
|
+
return data, status_code, headers
|
100
|
+
end
|
101
|
+
|
102
|
+
# Delete Condition Set
|
103
|
+
# Deletes a condition set and all its related data. This includes any permissions granted to said condition set (i.e: any matching condition set rules).
|
104
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
105
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
106
|
+
# @param condition_set_id [String] Either the unique id of the condition set, or the URL-friendly key of the condition set (i.e: the \"slug\").
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @return [nil]
|
109
|
+
def delete_condition_set(proj_id, env_id, condition_set_id, opts = {})
|
110
|
+
delete_condition_set_with_http_info(proj_id, env_id, condition_set_id, opts)
|
111
|
+
nil
|
112
|
+
end
|
113
|
+
|
114
|
+
# Delete Condition Set
|
115
|
+
# Deletes a condition set and all its related data. This includes any permissions granted to said condition set (i.e: any matching condition set rules).
|
116
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
117
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
118
|
+
# @param condition_set_id [String] Either the unique id of the condition set, or the URL-friendly key of the condition set (i.e: the \"slug\").
|
119
|
+
# @param [Hash] opts the optional parameters
|
120
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
121
|
+
def delete_condition_set_with_http_info(proj_id, env_id, condition_set_id, opts = {})
|
122
|
+
if @api_client.config.debugging
|
123
|
+
@api_client.config.logger.debug 'Calling API: ConditionSetsApi.delete_condition_set ...'
|
124
|
+
end
|
125
|
+
# verify the required parameter 'proj_id' is set
|
126
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
127
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetsApi.delete_condition_set"
|
128
|
+
end
|
129
|
+
# verify the required parameter 'env_id' is set
|
130
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
131
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetsApi.delete_condition_set"
|
132
|
+
end
|
133
|
+
# verify the required parameter 'condition_set_id' is set
|
134
|
+
if @api_client.config.client_side_validation && condition_set_id.nil?
|
135
|
+
fail ArgumentError, "Missing the required parameter 'condition_set_id' when calling ConditionSetsApi.delete_condition_set"
|
136
|
+
end
|
137
|
+
# resource path
|
138
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'condition_set_id' + '}', CGI.escape(condition_set_id.to_s))
|
139
|
+
|
140
|
+
# query parameters
|
141
|
+
query_params = opts[:query_params] || {}
|
142
|
+
|
143
|
+
# header parameters
|
144
|
+
header_params = opts[:header_params] || {}
|
145
|
+
# HTTP header 'Accept' (if needed)
|
146
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
147
|
+
|
148
|
+
# form parameters
|
149
|
+
form_params = opts[:form_params] || {}
|
150
|
+
|
151
|
+
# http body (model)
|
152
|
+
post_body = opts[:debug_body]
|
153
|
+
|
154
|
+
# return_type
|
155
|
+
return_type = opts[:debug_return_type]
|
156
|
+
|
157
|
+
# auth_names
|
158
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
159
|
+
|
160
|
+
new_options = opts.merge(
|
161
|
+
:operation => :"ConditionSetsApi.delete_condition_set",
|
162
|
+
:header_params => header_params,
|
163
|
+
:query_params => query_params,
|
164
|
+
:form_params => form_params,
|
165
|
+
:body => post_body,
|
166
|
+
:auth_names => auth_names,
|
167
|
+
:return_type => return_type
|
168
|
+
)
|
169
|
+
|
170
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
171
|
+
if @api_client.config.debugging
|
172
|
+
@api_client.config.logger.debug "API called: ConditionSetsApi#delete_condition_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
173
|
+
end
|
174
|
+
return data, status_code, headers
|
175
|
+
end
|
176
|
+
|
177
|
+
# Get Condition Set
|
178
|
+
# Gets a single condition set, if such condition set exists.
|
179
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
180
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
181
|
+
# @param condition_set_id [String] Either the unique id of the condition set, or the URL-friendly key of the condition set (i.e: the \"slug\").
|
182
|
+
# @param [Hash] opts the optional parameters
|
183
|
+
# @return [ConditionSetRead]
|
184
|
+
def get_condition_set(proj_id, env_id, condition_set_id, opts = {})
|
185
|
+
data, _status_code, _headers = get_condition_set_with_http_info(proj_id, env_id, condition_set_id, opts)
|
186
|
+
data
|
187
|
+
end
|
188
|
+
|
189
|
+
# Get Condition Set
|
190
|
+
# Gets a single condition set, if such condition set exists.
|
191
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
192
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
193
|
+
# @param condition_set_id [String] Either the unique id of the condition set, or the URL-friendly key of the condition set (i.e: the \"slug\").
|
194
|
+
# @param [Hash] opts the optional parameters
|
195
|
+
# @return [Array<(ConditionSetRead, Integer, Hash)>] ConditionSetRead data, response status code and response headers
|
196
|
+
def get_condition_set_with_http_info(proj_id, env_id, condition_set_id, opts = {})
|
197
|
+
if @api_client.config.debugging
|
198
|
+
@api_client.config.logger.debug 'Calling API: ConditionSetsApi.get_condition_set ...'
|
199
|
+
end
|
200
|
+
# verify the required parameter 'proj_id' is set
|
201
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
202
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetsApi.get_condition_set"
|
203
|
+
end
|
204
|
+
# verify the required parameter 'env_id' is set
|
205
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
206
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetsApi.get_condition_set"
|
207
|
+
end
|
208
|
+
# verify the required parameter 'condition_set_id' is set
|
209
|
+
if @api_client.config.client_side_validation && condition_set_id.nil?
|
210
|
+
fail ArgumentError, "Missing the required parameter 'condition_set_id' when calling ConditionSetsApi.get_condition_set"
|
211
|
+
end
|
212
|
+
# resource path
|
213
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'condition_set_id' + '}', CGI.escape(condition_set_id.to_s))
|
214
|
+
|
215
|
+
# query parameters
|
216
|
+
query_params = opts[:query_params] || {}
|
217
|
+
|
218
|
+
# header parameters
|
219
|
+
header_params = opts[:header_params] || {}
|
220
|
+
# HTTP header 'Accept' (if needed)
|
221
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
222
|
+
|
223
|
+
# form parameters
|
224
|
+
form_params = opts[:form_params] || {}
|
225
|
+
|
226
|
+
# http body (model)
|
227
|
+
post_body = opts[:debug_body]
|
228
|
+
|
229
|
+
# return_type
|
230
|
+
return_type = opts[:debug_return_type] || 'ConditionSetRead'
|
231
|
+
|
232
|
+
# auth_names
|
233
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
234
|
+
|
235
|
+
new_options = opts.merge(
|
236
|
+
:operation => :"ConditionSetsApi.get_condition_set",
|
237
|
+
:header_params => header_params,
|
238
|
+
:query_params => query_params,
|
239
|
+
:form_params => form_params,
|
240
|
+
:body => post_body,
|
241
|
+
:auth_names => auth_names,
|
242
|
+
:return_type => return_type
|
243
|
+
)
|
244
|
+
|
245
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug "API called: ConditionSetsApi#get_condition_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
248
|
+
end
|
249
|
+
return data, status_code, headers
|
250
|
+
end
|
251
|
+
|
252
|
+
# List Condition Sets
|
253
|
+
# Lists all condition sets matching a filter.
|
254
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
255
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
256
|
+
# @param [Hash] opts the optional parameters
|
257
|
+
# @option opts [ConditionSetType] :type if provided, will return only the condition sets of the specified type. e.g: only user sets.
|
258
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
259
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
260
|
+
# @return [Array<ConditionSetRead>]
|
261
|
+
def list_condition_sets(proj_id, env_id, opts = {})
|
262
|
+
data, _status_code, _headers = list_condition_sets_with_http_info(proj_id, env_id, opts)
|
263
|
+
data
|
264
|
+
end
|
265
|
+
|
266
|
+
# List Condition Sets
|
267
|
+
# Lists all condition sets matching a filter.
|
268
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
269
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
270
|
+
# @param [Hash] opts the optional parameters
|
271
|
+
# @option opts [ConditionSetType] :type if provided, will return only the condition sets of the specified type. e.g: only user sets.
|
272
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
273
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
274
|
+
# @return [Array<(Array<ConditionSetRead>, Integer, Hash)>] Array<ConditionSetRead> data, response status code and response headers
|
275
|
+
def list_condition_sets_with_http_info(proj_id, env_id, opts = {})
|
276
|
+
if @api_client.config.debugging
|
277
|
+
@api_client.config.logger.debug 'Calling API: ConditionSetsApi.list_condition_sets ...'
|
278
|
+
end
|
279
|
+
# verify the required parameter 'proj_id' is set
|
280
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
281
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetsApi.list_condition_sets"
|
282
|
+
end
|
283
|
+
# verify the required parameter 'env_id' is set
|
284
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
285
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetsApi.list_condition_sets"
|
286
|
+
end
|
287
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
288
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ConditionSetsApi.list_condition_sets, must be greater than or equal to 1.'
|
289
|
+
end
|
290
|
+
|
291
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
292
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ConditionSetsApi.list_condition_sets, must be smaller than or equal to 100.'
|
293
|
+
end
|
294
|
+
|
295
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
296
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ConditionSetsApi.list_condition_sets, must be greater than or equal to 1.'
|
297
|
+
end
|
298
|
+
|
299
|
+
# resource path
|
300
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/condition_sets'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
|
301
|
+
|
302
|
+
# query parameters
|
303
|
+
query_params = opts[:query_params] || {}
|
304
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
305
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
306
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
307
|
+
|
308
|
+
# header parameters
|
309
|
+
header_params = opts[:header_params] || {}
|
310
|
+
# HTTP header 'Accept' (if needed)
|
311
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
312
|
+
|
313
|
+
# form parameters
|
314
|
+
form_params = opts[:form_params] || {}
|
315
|
+
|
316
|
+
# http body (model)
|
317
|
+
post_body = opts[:debug_body]
|
318
|
+
|
319
|
+
# return_type
|
320
|
+
return_type = opts[:debug_return_type] || 'Array<ConditionSetRead>'
|
321
|
+
|
322
|
+
# auth_names
|
323
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
324
|
+
|
325
|
+
new_options = opts.merge(
|
326
|
+
:operation => :"ConditionSetsApi.list_condition_sets",
|
327
|
+
:header_params => header_params,
|
328
|
+
:query_params => query_params,
|
329
|
+
:form_params => form_params,
|
330
|
+
:body => post_body,
|
331
|
+
:auth_names => auth_names,
|
332
|
+
:return_type => return_type
|
333
|
+
)
|
334
|
+
|
335
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
336
|
+
if @api_client.config.debugging
|
337
|
+
@api_client.config.logger.debug "API called: ConditionSetsApi#list_condition_sets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
338
|
+
end
|
339
|
+
return data, status_code, headers
|
340
|
+
end
|
341
|
+
|
342
|
+
# Update Condition Set
|
343
|
+
# Partially updates a condition set. Fields that will be provided will be completely overwritten.
|
344
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
345
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
346
|
+
# @param condition_set_id [String] Either the unique id of the condition set, or the URL-friendly key of the condition set (i.e: the \"slug\").
|
347
|
+
# @param condition_set_update [ConditionSetUpdate]
|
348
|
+
# @param [Hash] opts the optional parameters
|
349
|
+
# @return [ConditionSetRead]
|
350
|
+
def update_condition_set(proj_id, env_id, condition_set_id, condition_set_update, opts = {})
|
351
|
+
data, _status_code, _headers = update_condition_set_with_http_info(proj_id, env_id, condition_set_id, condition_set_update, opts)
|
352
|
+
data
|
353
|
+
end
|
354
|
+
|
355
|
+
# Update Condition Set
|
356
|
+
# Partially updates a condition set. Fields that will be provided will be completely overwritten.
|
357
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
358
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
359
|
+
# @param condition_set_id [String] Either the unique id of the condition set, or the URL-friendly key of the condition set (i.e: the \"slug\").
|
360
|
+
# @param condition_set_update [ConditionSetUpdate]
|
361
|
+
# @param [Hash] opts the optional parameters
|
362
|
+
# @return [Array<(ConditionSetRead, Integer, Hash)>] ConditionSetRead data, response status code and response headers
|
363
|
+
def update_condition_set_with_http_info(proj_id, env_id, condition_set_id, condition_set_update, opts = {})
|
364
|
+
if @api_client.config.debugging
|
365
|
+
@api_client.config.logger.debug 'Calling API: ConditionSetsApi.update_condition_set ...'
|
366
|
+
end
|
367
|
+
# verify the required parameter 'proj_id' is set
|
368
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
369
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetsApi.update_condition_set"
|
370
|
+
end
|
371
|
+
# verify the required parameter 'env_id' is set
|
372
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
373
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetsApi.update_condition_set"
|
374
|
+
end
|
375
|
+
# verify the required parameter 'condition_set_id' is set
|
376
|
+
if @api_client.config.client_side_validation && condition_set_id.nil?
|
377
|
+
fail ArgumentError, "Missing the required parameter 'condition_set_id' when calling ConditionSetsApi.update_condition_set"
|
378
|
+
end
|
379
|
+
# verify the required parameter 'condition_set_update' is set
|
380
|
+
if @api_client.config.client_side_validation && condition_set_update.nil?
|
381
|
+
fail ArgumentError, "Missing the required parameter 'condition_set_update' when calling ConditionSetsApi.update_condition_set"
|
382
|
+
end
|
383
|
+
# resource path
|
384
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'condition_set_id' + '}', CGI.escape(condition_set_id.to_s))
|
385
|
+
|
386
|
+
# query parameters
|
387
|
+
query_params = opts[:query_params] || {}
|
388
|
+
|
389
|
+
# header parameters
|
390
|
+
header_params = opts[:header_params] || {}
|
391
|
+
# HTTP header 'Accept' (if needed)
|
392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
393
|
+
# HTTP header 'Content-Type'
|
394
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
395
|
+
if !content_type.nil?
|
396
|
+
header_params['Content-Type'] = content_type
|
397
|
+
end
|
398
|
+
|
399
|
+
# form parameters
|
400
|
+
form_params = opts[:form_params] || {}
|
401
|
+
|
402
|
+
# http body (model)
|
403
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(condition_set_update)
|
404
|
+
|
405
|
+
# return_type
|
406
|
+
return_type = opts[:debug_return_type] || 'ConditionSetRead'
|
407
|
+
|
408
|
+
# auth_names
|
409
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
410
|
+
|
411
|
+
new_options = opts.merge(
|
412
|
+
:operation => :"ConditionSetsApi.update_condition_set",
|
413
|
+
:header_params => header_params,
|
414
|
+
:query_params => query_params,
|
415
|
+
:form_params => form_params,
|
416
|
+
:body => post_body,
|
417
|
+
:auth_names => auth_names,
|
418
|
+
:return_type => return_type
|
419
|
+
)
|
420
|
+
|
421
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
422
|
+
if @api_client.config.debugging
|
423
|
+
@api_client.config.logger.debug "API called: ConditionSetsApi#update_condition_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
424
|
+
end
|
425
|
+
return data, status_code, headers
|
426
|
+
end
|
427
|
+
end
|
428
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
=begin
|
2
|
+
#Permit.io API
|
3
|
+
|
4
|
+
# Authorization as a service
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class DecisionLogsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List PDP Decisions
|
23
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
24
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
25
|
+
# @param pdp_id [String] The unique id of the pdp
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [Array<String>] :users List of user IDs to filter by
|
28
|
+
# @option opts [Boolean] :approved Filter by approved decisions
|
29
|
+
# @option opts [Array<String>] :resources Filter by resources
|
30
|
+
# @option opts [Integer] :timestamp_from Filter by timestamp from
|
31
|
+
# @option opts [Integer] :timestamp_to Filter by timestamp to
|
32
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
33
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
34
|
+
# @return [PaginatedResultOPADecisionLog]
|
35
|
+
def list_pdp_decision_logs(proj_id, env_id, pdp_id, opts = {})
|
36
|
+
data, _status_code, _headers = list_pdp_decision_logs_with_http_info(proj_id, env_id, pdp_id, opts)
|
37
|
+
data
|
38
|
+
end
|
39
|
+
|
40
|
+
# List PDP Decisions
|
41
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
42
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
43
|
+
# @param pdp_id [String] The unique id of the pdp
|
44
|
+
# @param [Hash] opts the optional parameters
|
45
|
+
# @option opts [Array<String>] :users List of user IDs to filter by
|
46
|
+
# @option opts [Boolean] :approved Filter by approved decisions
|
47
|
+
# @option opts [Array<String>] :resources Filter by resources
|
48
|
+
# @option opts [Integer] :timestamp_from Filter by timestamp from
|
49
|
+
# @option opts [Integer] :timestamp_to Filter by timestamp to
|
50
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
51
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
52
|
+
# @return [Array<(PaginatedResultOPADecisionLog, Integer, Hash)>] PaginatedResultOPADecisionLog data, response status code and response headers
|
53
|
+
def list_pdp_decision_logs_with_http_info(proj_id, env_id, pdp_id, opts = {})
|
54
|
+
if @api_client.config.debugging
|
55
|
+
@api_client.config.logger.debug 'Calling API: DecisionLogsApi.list_pdp_decision_logs ...'
|
56
|
+
end
|
57
|
+
# verify the required parameter 'proj_id' is set
|
58
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
59
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling DecisionLogsApi.list_pdp_decision_logs"
|
60
|
+
end
|
61
|
+
# verify the required parameter 'env_id' is set
|
62
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
63
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling DecisionLogsApi.list_pdp_decision_logs"
|
64
|
+
end
|
65
|
+
# verify the required parameter 'pdp_id' is set
|
66
|
+
if @api_client.config.client_side_validation && pdp_id.nil?
|
67
|
+
fail ArgumentError, "Missing the required parameter 'pdp_id' when calling DecisionLogsApi.list_pdp_decision_logs"
|
68
|
+
end
|
69
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
70
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DecisionLogsApi.list_pdp_decision_logs, must be greater than or equal to 1.'
|
71
|
+
end
|
72
|
+
|
73
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
74
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling DecisionLogsApi.list_pdp_decision_logs, must be smaller than or equal to 100.'
|
75
|
+
end
|
76
|
+
|
77
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
78
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling DecisionLogsApi.list_pdp_decision_logs, must be greater than or equal to 1.'
|
79
|
+
end
|
80
|
+
|
81
|
+
# resource path
|
82
|
+
local_var_path = '/v2/pdps/{proj_id}/{env_id}/decision-logs/{pdp_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'pdp_id' + '}', CGI.escape(pdp_id.to_s))
|
83
|
+
|
84
|
+
# query parameters
|
85
|
+
query_params = opts[:query_params] || {}
|
86
|
+
query_params[:'users'] = @api_client.build_collection_param(opts[:'users'], :multi) if !opts[:'users'].nil?
|
87
|
+
query_params[:'approved'] = opts[:'approved'] if !opts[:'approved'].nil?
|
88
|
+
query_params[:'resources'] = @api_client.build_collection_param(opts[:'resources'], :multi) if !opts[:'resources'].nil?
|
89
|
+
query_params[:'timestamp_from'] = opts[:'timestamp_from'] if !opts[:'timestamp_from'].nil?
|
90
|
+
query_params[:'timestamp_to'] = opts[:'timestamp_to'] if !opts[:'timestamp_to'].nil?
|
91
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
92
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
93
|
+
|
94
|
+
# header parameters
|
95
|
+
header_params = opts[:header_params] || {}
|
96
|
+
# HTTP header 'Accept' (if needed)
|
97
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
98
|
+
|
99
|
+
# form parameters
|
100
|
+
form_params = opts[:form_params] || {}
|
101
|
+
|
102
|
+
# http body (model)
|
103
|
+
post_body = opts[:debug_body]
|
104
|
+
|
105
|
+
# return_type
|
106
|
+
return_type = opts[:debug_return_type] || 'PaginatedResultOPADecisionLog'
|
107
|
+
|
108
|
+
# auth_names
|
109
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
110
|
+
|
111
|
+
new_options = opts.merge(
|
112
|
+
:operation => :"DecisionLogsApi.list_pdp_decision_logs",
|
113
|
+
:header_params => header_params,
|
114
|
+
:query_params => query_params,
|
115
|
+
:form_params => form_params,
|
116
|
+
:body => post_body,
|
117
|
+
:auth_names => auth_names,
|
118
|
+
:return_type => return_type
|
119
|
+
)
|
120
|
+
|
121
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
122
|
+
if @api_client.config.debugging
|
123
|
+
@api_client.config.logger.debug "API called: DecisionLogsApi#list_pdp_decision_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
124
|
+
end
|
125
|
+
return data, status_code, headers
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
=begin
|
2
|
+
#Permit.io API
|
3
|
+
|
4
|
+
# Authorization as a service
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class DecisionLogsIngressApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# OPA Decision Logs Ingress
|
23
|
+
# This ingress endpoint captures OPA decision logs.
|
24
|
+
# @param request_body [Array<Object>]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def insert_opa_decision_logs(request_body, opts = {})
|
28
|
+
insert_opa_decision_logs_with_http_info(request_body, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# OPA Decision Logs Ingress
|
33
|
+
# This ingress endpoint captures OPA decision logs.
|
34
|
+
# @param request_body [Array<Object>]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def insert_opa_decision_logs_with_http_info(request_body, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: DecisionLogsIngressApi.insert_opa_decision_logs ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'request_body' is set
|
42
|
+
if @api_client.config.client_side_validation && request_body.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'request_body' when calling DecisionLogsIngressApi.insert_opa_decision_logs"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v2/decision-logs/ingress'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type]
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"DecisionLogsIngressApi.insert_opa_decision_logs",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: DecisionLogsIngressApi#insert_opa_decision_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|