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