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,365 @@
|
|
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 ProjectsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create Project
|
23
|
+
# Creates a new project under the active organization.
|
24
|
+
# @param project_create [ProjectCreate]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [ProjectRead]
|
27
|
+
def create_project(project_create, opts = {})
|
28
|
+
data, _status_code, _headers = create_project_with_http_info(project_create, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create Project
|
33
|
+
# Creates a new project under the active organization.
|
34
|
+
# @param project_create [ProjectCreate]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(ProjectRead, Integer, Hash)>] ProjectRead data, response status code and response headers
|
37
|
+
def create_project_with_http_info(project_create, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ProjectsApi.create_project ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'project_create' is set
|
42
|
+
if @api_client.config.client_side_validation && project_create.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'project_create' when calling ProjectsApi.create_project"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v2/projects'
|
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(project_create)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'ProjectRead'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"ProjectsApi.create_project",
|
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: ProjectsApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Delete Project
|
91
|
+
# Deletes the project and all its related data.
|
92
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [nil]
|
95
|
+
def delete_project(proj_id, opts = {})
|
96
|
+
delete_project_with_http_info(proj_id, opts)
|
97
|
+
nil
|
98
|
+
end
|
99
|
+
|
100
|
+
# Delete Project
|
101
|
+
# Deletes the project and all its related data.
|
102
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
105
|
+
def delete_project_with_http_info(proj_id, opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: ProjectsApi.delete_project ...'
|
108
|
+
end
|
109
|
+
# verify the required parameter 'proj_id' is set
|
110
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ProjectsApi.delete_project"
|
112
|
+
end
|
113
|
+
# resource path
|
114
|
+
local_var_path = '/v2/projects/{proj_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s))
|
115
|
+
|
116
|
+
# query parameters
|
117
|
+
query_params = opts[:query_params] || {}
|
118
|
+
|
119
|
+
# header parameters
|
120
|
+
header_params = opts[:header_params] || {}
|
121
|
+
# HTTP header 'Accept' (if needed)
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
123
|
+
|
124
|
+
# form parameters
|
125
|
+
form_params = opts[:form_params] || {}
|
126
|
+
|
127
|
+
# http body (model)
|
128
|
+
post_body = opts[:debug_body]
|
129
|
+
|
130
|
+
# return_type
|
131
|
+
return_type = opts[:debug_return_type]
|
132
|
+
|
133
|
+
# auth_names
|
134
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
135
|
+
|
136
|
+
new_options = opts.merge(
|
137
|
+
:operation => :"ProjectsApi.delete_project",
|
138
|
+
:header_params => header_params,
|
139
|
+
:query_params => query_params,
|
140
|
+
:form_params => form_params,
|
141
|
+
:body => post_body,
|
142
|
+
:auth_names => auth_names,
|
143
|
+
:return_type => return_type
|
144
|
+
)
|
145
|
+
|
146
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
147
|
+
if @api_client.config.debugging
|
148
|
+
@api_client.config.logger.debug "API called: ProjectsApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
149
|
+
end
|
150
|
+
return data, status_code, headers
|
151
|
+
end
|
152
|
+
|
153
|
+
# Get Project
|
154
|
+
# Gets a single project matching the given proj_id, if such project exists.
|
155
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @return [ProjectRead]
|
158
|
+
def get_project(proj_id, opts = {})
|
159
|
+
data, _status_code, _headers = get_project_with_http_info(proj_id, opts)
|
160
|
+
data
|
161
|
+
end
|
162
|
+
|
163
|
+
# Get Project
|
164
|
+
# Gets a single project matching the given proj_id, if such project exists.
|
165
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
166
|
+
# @param [Hash] opts the optional parameters
|
167
|
+
# @return [Array<(ProjectRead, Integer, Hash)>] ProjectRead data, response status code and response headers
|
168
|
+
def get_project_with_http_info(proj_id, opts = {})
|
169
|
+
if @api_client.config.debugging
|
170
|
+
@api_client.config.logger.debug 'Calling API: ProjectsApi.get_project ...'
|
171
|
+
end
|
172
|
+
# verify the required parameter 'proj_id' is set
|
173
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
174
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ProjectsApi.get_project"
|
175
|
+
end
|
176
|
+
# resource path
|
177
|
+
local_var_path = '/v2/projects/{proj_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s))
|
178
|
+
|
179
|
+
# query parameters
|
180
|
+
query_params = opts[:query_params] || {}
|
181
|
+
|
182
|
+
# header parameters
|
183
|
+
header_params = opts[:header_params] || {}
|
184
|
+
# HTTP header 'Accept' (if needed)
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
186
|
+
|
187
|
+
# form parameters
|
188
|
+
form_params = opts[:form_params] || {}
|
189
|
+
|
190
|
+
# http body (model)
|
191
|
+
post_body = opts[:debug_body]
|
192
|
+
|
193
|
+
# return_type
|
194
|
+
return_type = opts[:debug_return_type] || 'ProjectRead'
|
195
|
+
|
196
|
+
# auth_names
|
197
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
198
|
+
|
199
|
+
new_options = opts.merge(
|
200
|
+
:operation => :"ProjectsApi.get_project",
|
201
|
+
:header_params => header_params,
|
202
|
+
:query_params => query_params,
|
203
|
+
:form_params => form_params,
|
204
|
+
:body => post_body,
|
205
|
+
:auth_names => auth_names,
|
206
|
+
:return_type => return_type
|
207
|
+
)
|
208
|
+
|
209
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
210
|
+
if @api_client.config.debugging
|
211
|
+
@api_client.config.logger.debug "API called: ProjectsApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
212
|
+
end
|
213
|
+
return data, status_code, headers
|
214
|
+
end
|
215
|
+
|
216
|
+
# List Projects
|
217
|
+
# Lists all the projects under the active organization.
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
220
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
221
|
+
# @return [Array<ProjectRead>]
|
222
|
+
def list_projects(opts = {})
|
223
|
+
data, _status_code, _headers = list_projects_with_http_info(opts)
|
224
|
+
data
|
225
|
+
end
|
226
|
+
|
227
|
+
# List Projects
|
228
|
+
# Lists all the projects under the active organization.
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
231
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
232
|
+
# @return [Array<(Array<ProjectRead>, Integer, Hash)>] Array<ProjectRead> data, response status code and response headers
|
233
|
+
def list_projects_with_http_info(opts = {})
|
234
|
+
if @api_client.config.debugging
|
235
|
+
@api_client.config.logger.debug 'Calling API: ProjectsApi.list_projects ...'
|
236
|
+
end
|
237
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
238
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProjectsApi.list_projects, must be greater than or equal to 1.'
|
239
|
+
end
|
240
|
+
|
241
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
242
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ProjectsApi.list_projects, must be smaller than or equal to 100.'
|
243
|
+
end
|
244
|
+
|
245
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
246
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ProjectsApi.list_projects, must be greater than or equal to 1.'
|
247
|
+
end
|
248
|
+
|
249
|
+
# resource path
|
250
|
+
local_var_path = '/v2/projects'
|
251
|
+
|
252
|
+
# query parameters
|
253
|
+
query_params = opts[:query_params] || {}
|
254
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
255
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
256
|
+
|
257
|
+
# header parameters
|
258
|
+
header_params = opts[:header_params] || {}
|
259
|
+
# HTTP header 'Accept' (if needed)
|
260
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
261
|
+
|
262
|
+
# form parameters
|
263
|
+
form_params = opts[:form_params] || {}
|
264
|
+
|
265
|
+
# http body (model)
|
266
|
+
post_body = opts[:debug_body]
|
267
|
+
|
268
|
+
# return_type
|
269
|
+
return_type = opts[:debug_return_type] || 'Array<ProjectRead>'
|
270
|
+
|
271
|
+
# auth_names
|
272
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
273
|
+
|
274
|
+
new_options = opts.merge(
|
275
|
+
:operation => :"ProjectsApi.list_projects",
|
276
|
+
:header_params => header_params,
|
277
|
+
:query_params => query_params,
|
278
|
+
:form_params => form_params,
|
279
|
+
:body => post_body,
|
280
|
+
:auth_names => auth_names,
|
281
|
+
:return_type => return_type
|
282
|
+
)
|
283
|
+
|
284
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
285
|
+
if @api_client.config.debugging
|
286
|
+
@api_client.config.logger.debug "API called: ProjectsApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
287
|
+
end
|
288
|
+
return data, status_code, headers
|
289
|
+
end
|
290
|
+
|
291
|
+
# Update Project
|
292
|
+
# Updates the project.
|
293
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
294
|
+
# @param project_update [ProjectUpdate]
|
295
|
+
# @param [Hash] opts the optional parameters
|
296
|
+
# @return [ProjectRead]
|
297
|
+
def update_project(proj_id, project_update, opts = {})
|
298
|
+
data, _status_code, _headers = update_project_with_http_info(proj_id, project_update, opts)
|
299
|
+
data
|
300
|
+
end
|
301
|
+
|
302
|
+
# Update Project
|
303
|
+
# Updates the project.
|
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 project_update [ProjectUpdate]
|
306
|
+
# @param [Hash] opts the optional parameters
|
307
|
+
# @return [Array<(ProjectRead, Integer, Hash)>] ProjectRead data, response status code and response headers
|
308
|
+
def update_project_with_http_info(proj_id, project_update, opts = {})
|
309
|
+
if @api_client.config.debugging
|
310
|
+
@api_client.config.logger.debug 'Calling API: ProjectsApi.update_project ...'
|
311
|
+
end
|
312
|
+
# verify the required parameter 'proj_id' is set
|
313
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
314
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling ProjectsApi.update_project"
|
315
|
+
end
|
316
|
+
# verify the required parameter 'project_update' is set
|
317
|
+
if @api_client.config.client_side_validation && project_update.nil?
|
318
|
+
fail ArgumentError, "Missing the required parameter 'project_update' when calling ProjectsApi.update_project"
|
319
|
+
end
|
320
|
+
# resource path
|
321
|
+
local_var_path = '/v2/projects/{proj_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s))
|
322
|
+
|
323
|
+
# query parameters
|
324
|
+
query_params = opts[:query_params] || {}
|
325
|
+
|
326
|
+
# header parameters
|
327
|
+
header_params = opts[:header_params] || {}
|
328
|
+
# HTTP header 'Accept' (if needed)
|
329
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
330
|
+
# HTTP header 'Content-Type'
|
331
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
332
|
+
if !content_type.nil?
|
333
|
+
header_params['Content-Type'] = content_type
|
334
|
+
end
|
335
|
+
|
336
|
+
# form parameters
|
337
|
+
form_params = opts[:form_params] || {}
|
338
|
+
|
339
|
+
# http body (model)
|
340
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(project_update)
|
341
|
+
|
342
|
+
# return_type
|
343
|
+
return_type = opts[:debug_return_type] || 'ProjectRead'
|
344
|
+
|
345
|
+
# auth_names
|
346
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
347
|
+
|
348
|
+
new_options = opts.merge(
|
349
|
+
:operation => :"ProjectsApi.update_project",
|
350
|
+
:header_params => header_params,
|
351
|
+
:query_params => query_params,
|
352
|
+
:form_params => form_params,
|
353
|
+
:body => post_body,
|
354
|
+
:auth_names => auth_names,
|
355
|
+
:return_type => return_type
|
356
|
+
)
|
357
|
+
|
358
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
359
|
+
if @api_client.config.debugging
|
360
|
+
@api_client.config.logger.debug "API called: ProjectsApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
361
|
+
end
|
362
|
+
return data, status_code, headers
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|