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,455 @@
|
|
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 ResourceActionsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create Resource Action
|
23
|
+
# Creates a new action that can affect the resource.
|
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 resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
27
|
+
# @param resource_action_create [ResourceActionCreate]
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @return [ResourceActionRead]
|
30
|
+
def create_resource_action(proj_id, env_id, resource_id, resource_action_create, opts = {})
|
31
|
+
data, _status_code, _headers = create_resource_action_with_http_info(proj_id, env_id, resource_id, resource_action_create, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Create Resource Action
|
36
|
+
# Creates a new action that can affect the resource.
|
37
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
38
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
39
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
40
|
+
# @param resource_action_create [ResourceActionCreate]
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @return [Array<(ResourceActionRead, Integer, Hash)>] ResourceActionRead data, response status code and response headers
|
43
|
+
def create_resource_action_with_http_info(proj_id, env_id, resource_id, resource_action_create, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: ResourceActionsApi.create_resource_action ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'proj_id' is set
|
48
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceActionsApi.create_resource_action"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'env_id' is set
|
52
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceActionsApi.create_resource_action"
|
54
|
+
end
|
55
|
+
# verify the required parameter 'resource_id' is set
|
56
|
+
if @api_client.config.client_side_validation && resource_id.nil?
|
57
|
+
fail ArgumentError, "Missing the required parameter 'resource_id' when calling ResourceActionsApi.create_resource_action"
|
58
|
+
end
|
59
|
+
# verify the required parameter 'resource_action_create' is set
|
60
|
+
if @api_client.config.client_side_validation && resource_action_create.nil?
|
61
|
+
fail ArgumentError, "Missing the required parameter 'resource_action_create' when calling ResourceActionsApi.create_resource_action"
|
62
|
+
end
|
63
|
+
# resource path
|
64
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s))
|
65
|
+
|
66
|
+
# query parameters
|
67
|
+
query_params = opts[:query_params] || {}
|
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
|
+
# HTTP header 'Content-Type'
|
74
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
75
|
+
if !content_type.nil?
|
76
|
+
header_params['Content-Type'] = content_type
|
77
|
+
end
|
78
|
+
|
79
|
+
# form parameters
|
80
|
+
form_params = opts[:form_params] || {}
|
81
|
+
|
82
|
+
# http body (model)
|
83
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(resource_action_create)
|
84
|
+
|
85
|
+
# return_type
|
86
|
+
return_type = opts[:debug_return_type] || 'ResourceActionRead'
|
87
|
+
|
88
|
+
# auth_names
|
89
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
90
|
+
|
91
|
+
new_options = opts.merge(
|
92
|
+
:operation => :"ResourceActionsApi.create_resource_action",
|
93
|
+
:header_params => header_params,
|
94
|
+
:query_params => query_params,
|
95
|
+
:form_params => form_params,
|
96
|
+
:body => post_body,
|
97
|
+
:auth_names => auth_names,
|
98
|
+
:return_type => return_type
|
99
|
+
)
|
100
|
+
|
101
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug "API called: ResourceActionsApi#create_resource_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
104
|
+
end
|
105
|
+
return data, status_code, headers
|
106
|
+
end
|
107
|
+
|
108
|
+
# Delete Resource Action
|
109
|
+
# Deletes the action and all its related data. This includes any permissions granted to perform the action.
|
110
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
111
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
112
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
113
|
+
# @param action_id [String] Either the unique id of the action, or the URL-friendly key of the action (i.e: the \"slug\").
|
114
|
+
# @param [Hash] opts the optional parameters
|
115
|
+
# @return [nil]
|
116
|
+
def delete_resource_action(proj_id, env_id, resource_id, action_id, opts = {})
|
117
|
+
delete_resource_action_with_http_info(proj_id, env_id, resource_id, action_id, opts)
|
118
|
+
nil
|
119
|
+
end
|
120
|
+
|
121
|
+
# Delete Resource Action
|
122
|
+
# Deletes the action and all its related data. This includes any permissions granted to perform the action.
|
123
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
124
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
125
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
126
|
+
# @param action_id [String] Either the unique id of the action, or the URL-friendly key of the action (i.e: the \"slug\").
|
127
|
+
# @param [Hash] opts the optional parameters
|
128
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
129
|
+
def delete_resource_action_with_http_info(proj_id, env_id, resource_id, action_id, opts = {})
|
130
|
+
if @api_client.config.debugging
|
131
|
+
@api_client.config.logger.debug 'Calling API: ResourceActionsApi.delete_resource_action ...'
|
132
|
+
end
|
133
|
+
# verify the required parameter 'proj_id' is set
|
134
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
135
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceActionsApi.delete_resource_action"
|
136
|
+
end
|
137
|
+
# verify the required parameter 'env_id' is set
|
138
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
139
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceActionsApi.delete_resource_action"
|
140
|
+
end
|
141
|
+
# verify the required parameter 'resource_id' is set
|
142
|
+
if @api_client.config.client_side_validation && resource_id.nil?
|
143
|
+
fail ArgumentError, "Missing the required parameter 'resource_id' when calling ResourceActionsApi.delete_resource_action"
|
144
|
+
end
|
145
|
+
# verify the required parameter 'action_id' is set
|
146
|
+
if @api_client.config.client_side_validation && action_id.nil?
|
147
|
+
fail ArgumentError, "Missing the required parameter 'action_id' when calling ResourceActionsApi.delete_resource_action"
|
148
|
+
end
|
149
|
+
# resource path
|
150
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions/{action_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s)).sub('{' + 'action_id' + '}', CGI.escape(action_id.to_s))
|
151
|
+
|
152
|
+
# query parameters
|
153
|
+
query_params = opts[:query_params] || {}
|
154
|
+
|
155
|
+
# header parameters
|
156
|
+
header_params = opts[:header_params] || {}
|
157
|
+
# HTTP header 'Accept' (if needed)
|
158
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
159
|
+
|
160
|
+
# form parameters
|
161
|
+
form_params = opts[:form_params] || {}
|
162
|
+
|
163
|
+
# http body (model)
|
164
|
+
post_body = opts[:debug_body]
|
165
|
+
|
166
|
+
# return_type
|
167
|
+
return_type = opts[:debug_return_type]
|
168
|
+
|
169
|
+
# auth_names
|
170
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
171
|
+
|
172
|
+
new_options = opts.merge(
|
173
|
+
:operation => :"ResourceActionsApi.delete_resource_action",
|
174
|
+
:header_params => header_params,
|
175
|
+
:query_params => query_params,
|
176
|
+
:form_params => form_params,
|
177
|
+
:body => post_body,
|
178
|
+
:auth_names => auth_names,
|
179
|
+
:return_type => return_type
|
180
|
+
)
|
181
|
+
|
182
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
183
|
+
if @api_client.config.debugging
|
184
|
+
@api_client.config.logger.debug "API called: ResourceActionsApi#delete_resource_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
185
|
+
end
|
186
|
+
return data, status_code, headers
|
187
|
+
end
|
188
|
+
|
189
|
+
# Get Resource Action
|
190
|
+
# Gets a single action defined on the resource, if such action 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 resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
194
|
+
# @param action_id [String] Either the unique id of the action, or the URL-friendly key of the action (i.e: the \"slug\").
|
195
|
+
# @param [Hash] opts the optional parameters
|
196
|
+
# @return [ResourceActionRead]
|
197
|
+
def get_resource_action(proj_id, env_id, resource_id, action_id, opts = {})
|
198
|
+
data, _status_code, _headers = get_resource_action_with_http_info(proj_id, env_id, resource_id, action_id, opts)
|
199
|
+
data
|
200
|
+
end
|
201
|
+
|
202
|
+
# Get Resource Action
|
203
|
+
# Gets a single action defined on the resource, if such action exists.
|
204
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
205
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
206
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
207
|
+
# @param action_id [String] Either the unique id of the action, or the URL-friendly key of the action (i.e: the \"slug\").
|
208
|
+
# @param [Hash] opts the optional parameters
|
209
|
+
# @return [Array<(ResourceActionRead, Integer, Hash)>] ResourceActionRead data, response status code and response headers
|
210
|
+
def get_resource_action_with_http_info(proj_id, env_id, resource_id, action_id, opts = {})
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug 'Calling API: ResourceActionsApi.get_resource_action ...'
|
213
|
+
end
|
214
|
+
# verify the required parameter 'proj_id' is set
|
215
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
216
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceActionsApi.get_resource_action"
|
217
|
+
end
|
218
|
+
# verify the required parameter 'env_id' is set
|
219
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
220
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceActionsApi.get_resource_action"
|
221
|
+
end
|
222
|
+
# verify the required parameter 'resource_id' is set
|
223
|
+
if @api_client.config.client_side_validation && resource_id.nil?
|
224
|
+
fail ArgumentError, "Missing the required parameter 'resource_id' when calling ResourceActionsApi.get_resource_action"
|
225
|
+
end
|
226
|
+
# verify the required parameter 'action_id' is set
|
227
|
+
if @api_client.config.client_side_validation && action_id.nil?
|
228
|
+
fail ArgumentError, "Missing the required parameter 'action_id' when calling ResourceActionsApi.get_resource_action"
|
229
|
+
end
|
230
|
+
# resource path
|
231
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions/{action_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s)).sub('{' + 'action_id' + '}', CGI.escape(action_id.to_s))
|
232
|
+
|
233
|
+
# query parameters
|
234
|
+
query_params = opts[:query_params] || {}
|
235
|
+
|
236
|
+
# header parameters
|
237
|
+
header_params = opts[:header_params] || {}
|
238
|
+
# HTTP header 'Accept' (if needed)
|
239
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
240
|
+
|
241
|
+
# form parameters
|
242
|
+
form_params = opts[:form_params] || {}
|
243
|
+
|
244
|
+
# http body (model)
|
245
|
+
post_body = opts[:debug_body]
|
246
|
+
|
247
|
+
# return_type
|
248
|
+
return_type = opts[:debug_return_type] || 'ResourceActionRead'
|
249
|
+
|
250
|
+
# auth_names
|
251
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
252
|
+
|
253
|
+
new_options = opts.merge(
|
254
|
+
:operation => :"ResourceActionsApi.get_resource_action",
|
255
|
+
:header_params => header_params,
|
256
|
+
:query_params => query_params,
|
257
|
+
:form_params => form_params,
|
258
|
+
:body => post_body,
|
259
|
+
:auth_names => auth_names,
|
260
|
+
:return_type => return_type
|
261
|
+
)
|
262
|
+
|
263
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
264
|
+
if @api_client.config.debugging
|
265
|
+
@api_client.config.logger.debug "API called: ResourceActionsApi#get_resource_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
266
|
+
end
|
267
|
+
return data, status_code, headers
|
268
|
+
end
|
269
|
+
|
270
|
+
# List Resource Actions
|
271
|
+
# Lists all the actions defined on the resource.
|
272
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
273
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
274
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
275
|
+
# @param [Hash] opts the optional parameters
|
276
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
277
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
278
|
+
# @return [Array<ResourceActionRead>]
|
279
|
+
def list_resource_actions(proj_id, env_id, resource_id, opts = {})
|
280
|
+
data, _status_code, _headers = list_resource_actions_with_http_info(proj_id, env_id, resource_id, opts)
|
281
|
+
data
|
282
|
+
end
|
283
|
+
|
284
|
+
# List Resource Actions
|
285
|
+
# Lists all the actions defined on the resource.
|
286
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
287
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
288
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
289
|
+
# @param [Hash] opts the optional parameters
|
290
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
291
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
292
|
+
# @return [Array<(Array<ResourceActionRead>, Integer, Hash)>] Array<ResourceActionRead> data, response status code and response headers
|
293
|
+
def list_resource_actions_with_http_info(proj_id, env_id, resource_id, opts = {})
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug 'Calling API: ResourceActionsApi.list_resource_actions ...'
|
296
|
+
end
|
297
|
+
# verify the required parameter 'proj_id' is set
|
298
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
299
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceActionsApi.list_resource_actions"
|
300
|
+
end
|
301
|
+
# verify the required parameter 'env_id' is set
|
302
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
303
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceActionsApi.list_resource_actions"
|
304
|
+
end
|
305
|
+
# verify the required parameter 'resource_id' is set
|
306
|
+
if @api_client.config.client_side_validation && resource_id.nil?
|
307
|
+
fail ArgumentError, "Missing the required parameter 'resource_id' when calling ResourceActionsApi.list_resource_actions"
|
308
|
+
end
|
309
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
310
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ResourceActionsApi.list_resource_actions, must be greater than or equal to 1.'
|
311
|
+
end
|
312
|
+
|
313
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
314
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ResourceActionsApi.list_resource_actions, must be smaller than or equal to 100.'
|
315
|
+
end
|
316
|
+
|
317
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
318
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ResourceActionsApi.list_resource_actions, must be greater than or equal to 1.'
|
319
|
+
end
|
320
|
+
|
321
|
+
# resource path
|
322
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s))
|
323
|
+
|
324
|
+
# query parameters
|
325
|
+
query_params = opts[:query_params] || {}
|
326
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
327
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
328
|
+
|
329
|
+
# header parameters
|
330
|
+
header_params = opts[:header_params] || {}
|
331
|
+
# HTTP header 'Accept' (if needed)
|
332
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
333
|
+
|
334
|
+
# form parameters
|
335
|
+
form_params = opts[:form_params] || {}
|
336
|
+
|
337
|
+
# http body (model)
|
338
|
+
post_body = opts[:debug_body]
|
339
|
+
|
340
|
+
# return_type
|
341
|
+
return_type = opts[:debug_return_type] || 'Array<ResourceActionRead>'
|
342
|
+
|
343
|
+
# auth_names
|
344
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
345
|
+
|
346
|
+
new_options = opts.merge(
|
347
|
+
:operation => :"ResourceActionsApi.list_resource_actions",
|
348
|
+
:header_params => header_params,
|
349
|
+
:query_params => query_params,
|
350
|
+
:form_params => form_params,
|
351
|
+
:body => post_body,
|
352
|
+
:auth_names => auth_names,
|
353
|
+
:return_type => return_type
|
354
|
+
)
|
355
|
+
|
356
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
357
|
+
if @api_client.config.debugging
|
358
|
+
@api_client.config.logger.debug "API called: ResourceActionsApi#list_resource_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
359
|
+
end
|
360
|
+
return data, status_code, headers
|
361
|
+
end
|
362
|
+
|
363
|
+
# Update Resource Action
|
364
|
+
# Partially updates the action defined on a resource. Fields that will be provided will be completely overwritten.
|
365
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
366
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
367
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
368
|
+
# @param action_id [String] Either the unique id of the action, or the URL-friendly key of the action (i.e: the \"slug\").
|
369
|
+
# @param resource_action_update [ResourceActionUpdate]
|
370
|
+
# @param [Hash] opts the optional parameters
|
371
|
+
# @return [ResourceActionRead]
|
372
|
+
def update_resource_action(proj_id, env_id, resource_id, action_id, resource_action_update, opts = {})
|
373
|
+
data, _status_code, _headers = update_resource_action_with_http_info(proj_id, env_id, resource_id, action_id, resource_action_update, opts)
|
374
|
+
data
|
375
|
+
end
|
376
|
+
|
377
|
+
# Update Resource Action
|
378
|
+
# Partially updates the action defined on a resource. Fields that will be provided will be completely overwritten.
|
379
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
380
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
381
|
+
# @param resource_id [String] Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
|
382
|
+
# @param action_id [String] Either the unique id of the action, or the URL-friendly key of the action (i.e: the \"slug\").
|
383
|
+
# @param resource_action_update [ResourceActionUpdate]
|
384
|
+
# @param [Hash] opts the optional parameters
|
385
|
+
# @return [Array<(ResourceActionRead, Integer, Hash)>] ResourceActionRead data, response status code and response headers
|
386
|
+
def update_resource_action_with_http_info(proj_id, env_id, resource_id, action_id, resource_action_update, opts = {})
|
387
|
+
if @api_client.config.debugging
|
388
|
+
@api_client.config.logger.debug 'Calling API: ResourceActionsApi.update_resource_action ...'
|
389
|
+
end
|
390
|
+
# verify the required parameter 'proj_id' is set
|
391
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
392
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceActionsApi.update_resource_action"
|
393
|
+
end
|
394
|
+
# verify the required parameter 'env_id' is set
|
395
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
396
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceActionsApi.update_resource_action"
|
397
|
+
end
|
398
|
+
# verify the required parameter 'resource_id' is set
|
399
|
+
if @api_client.config.client_side_validation && resource_id.nil?
|
400
|
+
fail ArgumentError, "Missing the required parameter 'resource_id' when calling ResourceActionsApi.update_resource_action"
|
401
|
+
end
|
402
|
+
# verify the required parameter 'action_id' is set
|
403
|
+
if @api_client.config.client_side_validation && action_id.nil?
|
404
|
+
fail ArgumentError, "Missing the required parameter 'action_id' when calling ResourceActionsApi.update_resource_action"
|
405
|
+
end
|
406
|
+
# verify the required parameter 'resource_action_update' is set
|
407
|
+
if @api_client.config.client_side_validation && resource_action_update.nil?
|
408
|
+
fail ArgumentError, "Missing the required parameter 'resource_action_update' when calling ResourceActionsApi.update_resource_action"
|
409
|
+
end
|
410
|
+
# resource path
|
411
|
+
local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions/{action_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s)).sub('{' + 'action_id' + '}', CGI.escape(action_id.to_s))
|
412
|
+
|
413
|
+
# query parameters
|
414
|
+
query_params = opts[:query_params] || {}
|
415
|
+
|
416
|
+
# header parameters
|
417
|
+
header_params = opts[:header_params] || {}
|
418
|
+
# HTTP header 'Accept' (if needed)
|
419
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
420
|
+
# HTTP header 'Content-Type'
|
421
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
422
|
+
if !content_type.nil?
|
423
|
+
header_params['Content-Type'] = content_type
|
424
|
+
end
|
425
|
+
|
426
|
+
# form parameters
|
427
|
+
form_params = opts[:form_params] || {}
|
428
|
+
|
429
|
+
# http body (model)
|
430
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(resource_action_update)
|
431
|
+
|
432
|
+
# return_type
|
433
|
+
return_type = opts[:debug_return_type] || 'ResourceActionRead'
|
434
|
+
|
435
|
+
# auth_names
|
436
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
437
|
+
|
438
|
+
new_options = opts.merge(
|
439
|
+
:operation => :"ResourceActionsApi.update_resource_action",
|
440
|
+
:header_params => header_params,
|
441
|
+
:query_params => query_params,
|
442
|
+
:form_params => form_params,
|
443
|
+
:body => post_body,
|
444
|
+
:auth_names => auth_names,
|
445
|
+
:return_type => return_type
|
446
|
+
)
|
447
|
+
|
448
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
449
|
+
if @api_client.config.debugging
|
450
|
+
@api_client.config.logger.debug "API called: ResourceActionsApi#update_resource_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
451
|
+
end
|
452
|
+
return data, status_code, headers
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|