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.
Files changed (196) hide show
  1. checksums.yaml +7 -0
  2. data/lib/api/api.rb +25 -0
  3. data/lib/api/base.rb +26 -0
  4. data/lib/api/resources.rb +13 -0
  5. data/lib/api/tenants.rb +11 -0
  6. data/lib/api/users.rb +50 -0
  7. data/lib/api/utils.rb +9 -0
  8. data/lib/config.rb +23 -0
  9. data/lib/main.rb +49 -0
  10. data/lib/openapi_client/api/api_keys_api.rb +413 -0
  11. data/lib/openapi_client/api/audit_elements_data_api.rb +118 -0
  12. data/lib/openapi_client/api/audit_logs_api.rb +204 -0
  13. data/lib/openapi_client/api/authentication_api.rb +512 -0
  14. data/lib/openapi_client/api/condition_set_rules_api.rb +278 -0
  15. data/lib/openapi_client/api/condition_sets_api.rb +428 -0
  16. data/lib/openapi_client/api/decision_logs_api.rb +128 -0
  17. data/lib/openapi_client/api/decision_logs_ingress_api.rb +90 -0
  18. data/lib/openapi_client/api/default_api.rb +297 -0
  19. data/lib/openapi_client/api/elements_configs_api.rb +657 -0
  20. data/lib/openapi_client/api/environments_api.rb +462 -0
  21. data/lib/openapi_client/api/instructions_api.rb +91 -0
  22. data/lib/openapi_client/api/members_api.rb +354 -0
  23. data/lib/openapi_client/api/opal_data_api.rb +343 -0
  24. data/lib/openapi_client/api/organizations_api.rb +652 -0
  25. data/lib/openapi_client/api/policy_api.rb +138 -0
  26. data/lib/openapi_client/api/policy_decision_points_api.rb +382 -0
  27. data/lib/openapi_client/api/policy_git_repositories_api.rb +510 -0
  28. data/lib/openapi_client/api/projects_api.rb +365 -0
  29. data/lib/openapi_client/api/resource_actions_api.rb +455 -0
  30. data/lib/openapi_client/api/resource_attributes_api.rb +473 -0
  31. data/lib/openapi_client/api/resource_instances_api.rb +425 -0
  32. data/lib/openapi_client/api/resource_roles_api.rb +813 -0
  33. data/lib/openapi_client/api/resources_api.rb +514 -0
  34. data/lib/openapi_client/api/role_assignments_api.rb +278 -0
  35. data/lib/openapi_client/api/roles_api.rb +759 -0
  36. data/lib/openapi_client/api/tenants_api.rb +603 -0
  37. data/lib/openapi_client/api/user_attributes_api.rb +458 -0
  38. data/lib/openapi_client/api/users_api.rb +684 -0
  39. data/lib/openapi_client/api/users_elements_data_api.rb +638 -0
  40. data/lib/openapi_client/api_client.rb +392 -0
  41. data/lib/openapi_client/api_error.rb +57 -0
  42. data/lib/openapi_client/configuration.rb +280 -0
  43. data/lib/openapi_client/models/action_block_editable.rb +230 -0
  44. data/lib/openapi_client/models/action_block_read.rb +255 -0
  45. data/lib/openapi_client/models/action_object.rb +275 -0
  46. data/lib/openapi_client/models/actor.rb +57 -0
  47. data/lib/openapi_client/models/add_role_permissions.rb +227 -0
  48. data/lib/openapi_client/models/api_key_create.rb +269 -0
  49. data/lib/openapi_client/models/api_key_owner_type.rb +41 -0
  50. data/lib/openapi_client/models/api_key_read.rb +329 -0
  51. data/lib/openapi_client/models/api_key_scope_read.rb +245 -0
  52. data/lib/openapi_client/models/attribute_block_editable.rb +235 -0
  53. data/lib/openapi_client/models/attribute_block_read.rb +260 -0
  54. data/lib/openapi_client/models/attribute_type.rb +44 -0
  55. data/lib/openapi_client/models/attributes.rb +231 -0
  56. data/lib/openapi_client/models/audit_log.rb +415 -0
  57. data/lib/openapi_client/models/audit_log_objects.rb +282 -0
  58. data/lib/openapi_client/models/authn_me_api_key_read.rb +329 -0
  59. data/lib/openapi_client/models/authn_me_member_read.rb +352 -0
  60. data/lib/openapi_client/models/authn_me_read.rb +224 -0
  61. data/lib/openapi_client/models/authn_me_user_read.rb +440 -0
  62. data/lib/openapi_client/models/condition_set_create.rb +340 -0
  63. data/lib/openapi_client/models/condition_set_read.rb +409 -0
  64. data/lib/openapi_client/models/condition_set_rule_create.rb +279 -0
  65. data/lib/openapi_client/models/condition_set_rule_read.rb +360 -0
  66. data/lib/openapi_client/models/condition_set_rule_remove.rb +279 -0
  67. data/lib/openapi_client/models/condition_set_type.rb +40 -0
  68. data/lib/openapi_client/models/condition_set_update.rb +255 -0
  69. data/lib/openapi_client/models/data_source_config.rb +228 -0
  70. data/lib/openapi_client/models/data_source_entry.rb +272 -0
  71. data/lib/openapi_client/models/detailed_audit_log.rb +443 -0
  72. data/lib/openapi_client/models/dev_login.rb +225 -0
  73. data/lib/openapi_client/models/dummy_engine_model.rb +229 -0
  74. data/lib/openapi_client/models/elements_config_create.rb +319 -0
  75. data/lib/openapi_client/models/elements_config_read.rb +402 -0
  76. data/lib/openapi_client/models/elements_config_runtime_read.rb +238 -0
  77. data/lib/openapi_client/models/elements_config_update.rb +268 -0
  78. data/lib/openapi_client/models/elements_env_type_read.rb +242 -0
  79. data/lib/openapi_client/models/elements_env_type_update.rb +222 -0
  80. data/lib/openapi_client/models/elements_permission_level.rb +44 -0
  81. data/lib/openapi_client/models/elements_role_read.rb +378 -0
  82. data/lib/openapi_client/models/elements_type.rb +41 -0
  83. data/lib/openapi_client/models/elements_user_create.rb +295 -0
  84. data/lib/openapi_client/models/elements_user_role_create.rb +225 -0
  85. data/lib/openapi_client/models/elements_user_role_remove.rb +225 -0
  86. data/lib/openapi_client/models/embedded_login_request_output.rb +265 -0
  87. data/lib/openapi_client/models/engine.rb +39 -0
  88. data/lib/openapi_client/models/environment_create.rb +281 -0
  89. data/lib/openapi_client/models/environment_object.rb +295 -0
  90. data/lib/openapi_client/models/environment_read.rb +335 -0
  91. data/lib/openapi_client/models/environment_stats.rb +365 -0
  92. data/lib/openapi_client/models/environment_update.rb +240 -0
  93. data/lib/openapi_client/models/failed_invite.rb +238 -0
  94. data/lib/openapi_client/models/full_data.rb +258 -0
  95. data/lib/openapi_client/models/http_validation_error.rb +221 -0
  96. data/lib/openapi_client/models/identity_read.rb +300 -0
  97. data/lib/openapi_client/models/invite_attempt_result.rb +232 -0
  98. data/lib/openapi_client/models/invite_create.rb +240 -0
  99. data/lib/openapi_client/models/invite_read.rb +325 -0
  100. data/lib/openapi_client/models/invite_status.rb +42 -0
  101. data/lib/openapi_client/models/labels.rb +238 -0
  102. data/lib/openapi_client/models/language_instructions.rb +252 -0
  103. data/lib/openapi_client/models/location_inner.rb +230 -0
  104. data/lib/openapi_client/models/login_result.rb +259 -0
  105. data/lib/openapi_client/models/member_access_level.rb +41 -0
  106. data/lib/openapi_client/models/member_access_obj.rb +41 -0
  107. data/lib/openapi_client/models/multi_invite_result.rb +238 -0
  108. data/lib/openapi_client/models/onboarding_step.rb +46 -0
  109. data/lib/openapi_client/models/opa_decision_log.rb +288 -0
  110. data/lib/openapi_client/models/opa_engine_decision_log.rb +345 -0
  111. data/lib/openapi_client/models/opa_labels.rb +238 -0
  112. data/lib/openapi_client/models/opa_metrics.rb +273 -0
  113. data/lib/openapi_client/models/opal_client.rb +305 -0
  114. data/lib/openapi_client/models/org_member_read.rb +420 -0
  115. data/lib/openapi_client/models/org_member_update.rb +230 -0
  116. data/lib/openapi_client/models/organization_create.rb +292 -0
  117. data/lib/openapi_client/models/organization_object.rb +295 -0
  118. data/lib/openapi_client/models/organization_read.rb +295 -0
  119. data/lib/openapi_client/models/organization_read_with_api_key.rb +313 -0
  120. data/lib/openapi_client/models/organization_update.rb +247 -0
  121. data/lib/openapi_client/models/paginated_result_api_key_read.rb +285 -0
  122. data/lib/openapi_client/models/paginated_result_audit_log.rb +285 -0
  123. data/lib/openapi_client/models/paginated_result_elements_config_read.rb +285 -0
  124. data/lib/openapi_client/models/paginated_result_opa_decision_log.rb +285 -0
  125. data/lib/openapi_client/models/paginated_result_user_read.rb +285 -0
  126. data/lib/openapi_client/models/pdp.rb +259 -0
  127. data/lib/openapi_client/models/pdp_config_object.rb +258 -0
  128. data/lib/openapi_client/models/pdp_config_read.rb +292 -0
  129. data/lib/openapi_client/models/pdp_context.rb +291 -0
  130. data/lib/openapi_client/models/pdp_state.rb +224 -0
  131. data/lib/openapi_client/models/pdp_state_update.rb +238 -0
  132. data/lib/openapi_client/models/pdp_values.rb +252 -0
  133. data/lib/openapi_client/models/permission_level_role_read.rb +254 -0
  134. data/lib/openapi_client/models/policy_repo_create.rb +318 -0
  135. data/lib/openapi_client/models/policy_repo_read.rb +347 -0
  136. data/lib/openapi_client/models/policy_repo_status.rb +41 -0
  137. data/lib/openapi_client/models/programming_language.rb +43 -0
  138. data/lib/openapi_client/models/project_create.rb +318 -0
  139. data/lib/openapi_client/models/project_object.rb +295 -0
  140. data/lib/openapi_client/models/project_read.rb +357 -0
  141. data/lib/openapi_client/models/project_update.rb +250 -0
  142. data/lib/openapi_client/models/raw_data.rb +329 -0
  143. data/lib/openapi_client/models/relationship_tuple_object.rb +252 -0
  144. data/lib/openapi_client/models/remote_config.rb +256 -0
  145. data/lib/openapi_client/models/remove_role_permissions.rb +227 -0
  146. data/lib/openapi_client/models/resource_action_create.rb +271 -0
  147. data/lib/openapi_client/models/resource_action_read.rb +370 -0
  148. data/lib/openapi_client/models/resource_action_update.rb +230 -0
  149. data/lib/openapi_client/models/resource_attribute_create.rb +271 -0
  150. data/lib/openapi_client/models/resource_attribute_read.rb +370 -0
  151. data/lib/openapi_client/models/resource_attribute_update.rb +230 -0
  152. data/lib/openapi_client/models/resource_attributes.rb +238 -0
  153. data/lib/openapi_client/models/resource_create.rb +310 -0
  154. data/lib/openapi_client/models/resource_id.rb +230 -0
  155. data/lib/openapi_client/models/resource_instance_create.rb +281 -0
  156. data/lib/openapi_client/models/resource_instance_read.rb +375 -0
  157. data/lib/openapi_client/models/resource_instance_update.rb +220 -0
  158. data/lib/openapi_client/models/resource_read.rb +374 -0
  159. data/lib/openapi_client/models/resource_replace.rb +274 -0
  160. data/lib/openapi_client/models/resource_role_create.rb +295 -0
  161. data/lib/openapi_client/models/resource_role_read.rb +379 -0
  162. data/lib/openapi_client/models/resource_role_update.rb +254 -0
  163. data/lib/openapi_client/models/resource_type_object.rb +286 -0
  164. data/lib/openapi_client/models/resource_update.rb +264 -0
  165. data/lib/openapi_client/models/role_assignment_create.rb +255 -0
  166. data/lib/openapi_client/models/role_assignment_read.rb +375 -0
  167. data/lib/openapi_client/models/role_assignment_remove.rb +255 -0
  168. data/lib/openapi_client/models/role_block.rb +244 -0
  169. data/lib/openapi_client/models/role_create.rb +295 -0
  170. data/lib/openapi_client/models/role_data.rb +221 -0
  171. data/lib/openapi_client/models/role_read.rb +364 -0
  172. data/lib/openapi_client/models/role_update.rb +254 -0
  173. data/lib/openapi_client/models/settings.rb +231 -0
  174. data/lib/openapi_client/models/ssh_auth_data.rb +295 -0
  175. data/lib/openapi_client/models/statistics.rb +389 -0
  176. data/lib/openapi_client/models/tenant_create.rb +281 -0
  177. data/lib/openapi_client/models/tenant_object.rb +284 -0
  178. data/lib/openapi_client/models/tenant_read.rb +365 -0
  179. data/lib/openapi_client/models/tenant_update.rb +240 -0
  180. data/lib/openapi_client/models/user_create.rb +286 -0
  181. data/lib/openapi_client/models/user_data.rb +232 -0
  182. data/lib/openapi_client/models/user_login_request_input.rb +240 -0
  183. data/lib/openapi_client/models/user_object.rb +313 -0
  184. data/lib/openapi_client/models/user_read.rb +336 -0
  185. data/lib/openapi_client/models/user_role.rb +240 -0
  186. data/lib/openapi_client/models/user_role_create.rb +240 -0
  187. data/lib/openapi_client/models/user_role_remove.rb +240 -0
  188. data/lib/openapi_client/models/user_update.rb +250 -0
  189. data/lib/openapi_client/models/validation_error.rb +254 -0
  190. data/lib/openapi_client/models/webhook_create.rb +235 -0
  191. data/lib/openapi_client/models/webhook_read.rb +315 -0
  192. data/lib/openapi_client/models/webhook_update.rb +230 -0
  193. data/lib/openapi_client/version.rb +15 -0
  194. data/lib/openapi_client.rb +220 -0
  195. data/lib/permit.rb +58 -0
  196. metadata +251 -0
@@ -0,0 +1,638 @@
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 UsersElementsDataApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Assign role to user
23
+ # Assigns a role to the user within the tenant. The tenant defines the scope of the assignment. In other words, the role is effective only within the tenant.
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 elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \"slug\").
27
+ # @param user_id [String] Either the unique id of the user, or the URL-friendly key of the user (i.e: the \"slug\").
28
+ # @param elements_user_role_create [ElementsUserRoleCreate]
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [RoleAssignmentRead]
31
+ def elements_assign_role_to_user(proj_id, env_id, elements_config_id, user_id, elements_user_role_create, opts = {})
32
+ data, _status_code, _headers = elements_assign_role_to_user_with_http_info(proj_id, env_id, elements_config_id, user_id, elements_user_role_create, opts)
33
+ data
34
+ end
35
+
36
+ # Assign role to user
37
+ # Assigns a role to the user within the tenant. The tenant defines the scope of the assignment. In other words, the role is effective only within the tenant.
38
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
39
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
40
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \"slug\").
41
+ # @param user_id [String] Either the unique id of the user, or the URL-friendly key of the user (i.e: the \"slug\").
42
+ # @param elements_user_role_create [ElementsUserRoleCreate]
43
+ # @param [Hash] opts the optional parameters
44
+ # @return [Array<(RoleAssignmentRead, Integer, Hash)>] RoleAssignmentRead data, response status code and response headers
45
+ def elements_assign_role_to_user_with_http_info(proj_id, env_id, elements_config_id, user_id, elements_user_role_create, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.elements_assign_role_to_user ...'
48
+ end
49
+ # verify the required parameter 'proj_id' is set
50
+ if @api_client.config.client_side_validation && proj_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.elements_assign_role_to_user"
52
+ end
53
+ # verify the required parameter 'env_id' is set
54
+ if @api_client.config.client_side_validation && env_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.elements_assign_role_to_user"
56
+ end
57
+ # verify the required parameter 'elements_config_id' is set
58
+ if @api_client.config.client_side_validation && elements_config_id.nil?
59
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.elements_assign_role_to_user"
60
+ end
61
+ # verify the required parameter 'user_id' is set
62
+ if @api_client.config.client_side_validation && user_id.nil?
63
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersElementsDataApi.elements_assign_role_to_user"
64
+ end
65
+ # verify the required parameter 'elements_user_role_create' is set
66
+ if @api_client.config.client_side_validation && elements_user_role_create.nil?
67
+ fail ArgumentError, "Missing the required parameter 'elements_user_role_create' when calling UsersElementsDataApi.elements_assign_role_to_user"
68
+ end
69
+ # resource path
70
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users/{user_id}/roles'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
71
+
72
+ # query parameters
73
+ query_params = opts[:query_params] || {}
74
+
75
+ # header parameters
76
+ header_params = opts[:header_params] || {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
79
+ # HTTP header 'Content-Type'
80
+ content_type = @api_client.select_header_content_type(['application/json'])
81
+ if !content_type.nil?
82
+ header_params['Content-Type'] = content_type
83
+ end
84
+
85
+ # form parameters
86
+ form_params = opts[:form_params] || {}
87
+
88
+ # http body (model)
89
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(elements_user_role_create)
90
+
91
+ # return_type
92
+ return_type = opts[:debug_return_type] || 'RoleAssignmentRead'
93
+
94
+ # auth_names
95
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
96
+
97
+ new_options = opts.merge(
98
+ :operation => :"UsersElementsDataApi.elements_assign_role_to_user",
99
+ :header_params => header_params,
100
+ :query_params => query_params,
101
+ :form_params => form_params,
102
+ :body => post_body,
103
+ :auth_names => auth_names,
104
+ :return_type => return_type
105
+ )
106
+
107
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#elements_assign_role_to_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
110
+ end
111
+ return data, status_code, headers
112
+ end
113
+
114
+ # Create user
115
+ # Creates a new user inside the Permit.io system, from that point forward you may run permission checks on that user. If the user is already created: will return 200 instead of 201, and will return the existing user object in the response body.
116
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
117
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
118
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
119
+ # @param elements_user_create [ElementsUserCreate]
120
+ # @param [Hash] opts the optional parameters
121
+ # @return [UserRead]
122
+ def elements_create_user(proj_id, env_id, elements_config_id, elements_user_create, opts = {})
123
+ data, _status_code, _headers = elements_create_user_with_http_info(proj_id, env_id, elements_config_id, elements_user_create, opts)
124
+ data
125
+ end
126
+
127
+ # Create user
128
+ # Creates a new user inside the Permit.io system, from that point forward you may run permission checks on that user. If the user is already created: will return 200 instead of 201, and will return the existing user object in the response body.
129
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
130
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
131
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
132
+ # @param elements_user_create [ElementsUserCreate]
133
+ # @param [Hash] opts the optional parameters
134
+ # @return [Array<(UserRead, Integer, Hash)>] UserRead data, response status code and response headers
135
+ def elements_create_user_with_http_info(proj_id, env_id, elements_config_id, elements_user_create, opts = {})
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.elements_create_user ...'
138
+ end
139
+ # verify the required parameter 'proj_id' is set
140
+ if @api_client.config.client_side_validation && proj_id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.elements_create_user"
142
+ end
143
+ # verify the required parameter 'env_id' is set
144
+ if @api_client.config.client_side_validation && env_id.nil?
145
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.elements_create_user"
146
+ end
147
+ # verify the required parameter 'elements_config_id' is set
148
+ if @api_client.config.client_side_validation && elements_config_id.nil?
149
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.elements_create_user"
150
+ end
151
+ # verify the required parameter 'elements_user_create' is set
152
+ if @api_client.config.client_side_validation && elements_user_create.nil?
153
+ fail ArgumentError, "Missing the required parameter 'elements_user_create' when calling UsersElementsDataApi.elements_create_user"
154
+ end
155
+ # resource path
156
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s))
157
+
158
+ # query parameters
159
+ query_params = opts[:query_params] || {}
160
+
161
+ # header parameters
162
+ header_params = opts[:header_params] || {}
163
+ # HTTP header 'Accept' (if needed)
164
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
165
+ # HTTP header 'Content-Type'
166
+ content_type = @api_client.select_header_content_type(['application/json'])
167
+ if !content_type.nil?
168
+ header_params['Content-Type'] = content_type
169
+ end
170
+
171
+ # form parameters
172
+ form_params = opts[:form_params] || {}
173
+
174
+ # http body (model)
175
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(elements_user_create)
176
+
177
+ # return_type
178
+ return_type = opts[:debug_return_type] || 'UserRead'
179
+
180
+ # auth_names
181
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
182
+
183
+ new_options = opts.merge(
184
+ :operation => :"UsersElementsDataApi.elements_create_user",
185
+ :header_params => header_params,
186
+ :query_params => query_params,
187
+ :form_params => form_params,
188
+ :body => post_body,
189
+ :auth_names => auth_names,
190
+ :return_type => return_type
191
+ )
192
+
193
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
194
+ if @api_client.config.debugging
195
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#elements_create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
196
+ end
197
+ return data, status_code, headers
198
+ end
199
+
200
+ # Delete user
201
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
202
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
203
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
204
+ # @param user_id [String] Either the unique id of the user, or the URL-friendly key of the user (i.e: the \&quot;slug\&quot;).
205
+ # @param [Hash] opts the optional parameters
206
+ # @return [nil]
207
+ def elements_delete_user(proj_id, env_id, elements_config_id, user_id, opts = {})
208
+ elements_delete_user_with_http_info(proj_id, env_id, elements_config_id, user_id, opts)
209
+ nil
210
+ end
211
+
212
+ # Delete user
213
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
214
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
215
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
216
+ # @param user_id [String] Either the unique id of the user, or the URL-friendly key of the user (i.e: the \&quot;slug\&quot;).
217
+ # @param [Hash] opts the optional parameters
218
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
219
+ def elements_delete_user_with_http_info(proj_id, env_id, elements_config_id, user_id, opts = {})
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.elements_delete_user ...'
222
+ end
223
+ # verify the required parameter 'proj_id' is set
224
+ if @api_client.config.client_side_validation && proj_id.nil?
225
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.elements_delete_user"
226
+ end
227
+ # verify the required parameter 'env_id' is set
228
+ if @api_client.config.client_side_validation && env_id.nil?
229
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.elements_delete_user"
230
+ end
231
+ # verify the required parameter 'elements_config_id' is set
232
+ if @api_client.config.client_side_validation && elements_config_id.nil?
233
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.elements_delete_user"
234
+ end
235
+ # verify the required parameter 'user_id' is set
236
+ if @api_client.config.client_side_validation && user_id.nil?
237
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersElementsDataApi.elements_delete_user"
238
+ end
239
+ # resource path
240
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users/{user_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+
245
+ # header parameters
246
+ header_params = opts[:header_params] || {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
249
+
250
+ # form parameters
251
+ form_params = opts[:form_params] || {}
252
+
253
+ # http body (model)
254
+ post_body = opts[:debug_body]
255
+
256
+ # return_type
257
+ return_type = opts[:debug_return_type]
258
+
259
+ # auth_names
260
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
261
+
262
+ new_options = opts.merge(
263
+ :operation => :"UsersElementsDataApi.elements_delete_user",
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => return_type
270
+ )
271
+
272
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#elements_delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ return data, status_code, headers
277
+ end
278
+
279
+ # List roles
280
+ # Lists all the users defined within an environment.
281
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
282
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
283
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
284
+ # @param [Hash] opts the optional parameters
285
+ # @option opts [String] :search Text search for the email field
286
+ # @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
287
+ # @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
288
+ # @return [Array<ElementsRoleRead>]
289
+ def elements_list_roles(proj_id, env_id, elements_config_id, opts = {})
290
+ data, _status_code, _headers = elements_list_roles_with_http_info(proj_id, env_id, elements_config_id, opts)
291
+ data
292
+ end
293
+
294
+ # List roles
295
+ # Lists all the users defined within an environment.
296
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
297
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
298
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
299
+ # @param [Hash] opts the optional parameters
300
+ # @option opts [String] :search Text search for the email field
301
+ # @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
302
+ # @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
303
+ # @return [Array<(Array<ElementsRoleRead>, Integer, Hash)>] Array<ElementsRoleRead> data, response status code and response headers
304
+ def elements_list_roles_with_http_info(proj_id, env_id, elements_config_id, opts = {})
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.elements_list_roles ...'
307
+ end
308
+ # verify the required parameter 'proj_id' is set
309
+ if @api_client.config.client_side_validation && proj_id.nil?
310
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.elements_list_roles"
311
+ end
312
+ # verify the required parameter 'env_id' is set
313
+ if @api_client.config.client_side_validation && env_id.nil?
314
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.elements_list_roles"
315
+ end
316
+ # verify the required parameter 'elements_config_id' is set
317
+ if @api_client.config.client_side_validation && elements_config_id.nil?
318
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.elements_list_roles"
319
+ end
320
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
321
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling UsersElementsDataApi.elements_list_roles, must be greater than or equal to 1.'
322
+ end
323
+
324
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
325
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling UsersElementsDataApi.elements_list_roles, must be smaller than or equal to 100.'
326
+ end
327
+
328
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
329
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling UsersElementsDataApi.elements_list_roles, must be greater than or equal to 1.'
330
+ end
331
+
332
+ # resource path
333
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/roles'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s))
334
+
335
+ # query parameters
336
+ query_params = opts[:query_params] || {}
337
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
338
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
339
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
340
+
341
+ # header parameters
342
+ header_params = opts[:header_params] || {}
343
+ # HTTP header 'Accept' (if needed)
344
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
345
+
346
+ # form parameters
347
+ form_params = opts[:form_params] || {}
348
+
349
+ # http body (model)
350
+ post_body = opts[:debug_body]
351
+
352
+ # return_type
353
+ return_type = opts[:debug_return_type] || 'Array<ElementsRoleRead>'
354
+
355
+ # auth_names
356
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
357
+
358
+ new_options = opts.merge(
359
+ :operation => :"UsersElementsDataApi.elements_list_roles",
360
+ :header_params => header_params,
361
+ :query_params => query_params,
362
+ :form_params => form_params,
363
+ :body => post_body,
364
+ :auth_names => auth_names,
365
+ :return_type => return_type
366
+ )
367
+
368
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
369
+ if @api_client.config.debugging
370
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#elements_list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
371
+ end
372
+ return data, status_code, headers
373
+ end
374
+
375
+ # List users
376
+ # Lists all the users defined within an environment.
377
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
378
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
379
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
380
+ # @param [Hash] opts the optional parameters
381
+ # @option opts [String] :search Text search for the email field
382
+ # @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
383
+ # @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
384
+ # @return [PaginatedResultUserRead]
385
+ def elements_list_users(proj_id, env_id, elements_config_id, opts = {})
386
+ data, _status_code, _headers = elements_list_users_with_http_info(proj_id, env_id, elements_config_id, opts)
387
+ data
388
+ end
389
+
390
+ # List users
391
+ # Lists all the users defined within an environment.
392
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
393
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
394
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
395
+ # @param [Hash] opts the optional parameters
396
+ # @option opts [String] :search Text search for the email field
397
+ # @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
398
+ # @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
399
+ # @return [Array<(PaginatedResultUserRead, Integer, Hash)>] PaginatedResultUserRead data, response status code and response headers
400
+ def elements_list_users_with_http_info(proj_id, env_id, elements_config_id, opts = {})
401
+ if @api_client.config.debugging
402
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.elements_list_users ...'
403
+ end
404
+ # verify the required parameter 'proj_id' is set
405
+ if @api_client.config.client_side_validation && proj_id.nil?
406
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.elements_list_users"
407
+ end
408
+ # verify the required parameter 'env_id' is set
409
+ if @api_client.config.client_side_validation && env_id.nil?
410
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.elements_list_users"
411
+ end
412
+ # verify the required parameter 'elements_config_id' is set
413
+ if @api_client.config.client_side_validation && elements_config_id.nil?
414
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.elements_list_users"
415
+ end
416
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
417
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling UsersElementsDataApi.elements_list_users, must be greater than or equal to 1.'
418
+ end
419
+
420
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
421
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling UsersElementsDataApi.elements_list_users, must be smaller than or equal to 100.'
422
+ end
423
+
424
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
425
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling UsersElementsDataApi.elements_list_users, must be greater than or equal to 1.'
426
+ end
427
+
428
+ # resource path
429
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s))
430
+
431
+ # query parameters
432
+ query_params = opts[:query_params] || {}
433
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
434
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
435
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
436
+
437
+ # header parameters
438
+ header_params = opts[:header_params] || {}
439
+ # HTTP header 'Accept' (if needed)
440
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
441
+
442
+ # form parameters
443
+ form_params = opts[:form_params] || {}
444
+
445
+ # http body (model)
446
+ post_body = opts[:debug_body]
447
+
448
+ # return_type
449
+ return_type = opts[:debug_return_type] || 'PaginatedResultUserRead'
450
+
451
+ # auth_names
452
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
453
+
454
+ new_options = opts.merge(
455
+ :operation => :"UsersElementsDataApi.elements_list_users",
456
+ :header_params => header_params,
457
+ :query_params => query_params,
458
+ :form_params => form_params,
459
+ :body => post_body,
460
+ :auth_names => auth_names,
461
+ :return_type => return_type
462
+ )
463
+
464
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
465
+ if @api_client.config.debugging
466
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#elements_list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
467
+ end
468
+ return data, status_code, headers
469
+ end
470
+
471
+ # Unassign role from user
472
+ # Unassigns the role from the user within the tenant. The tenant defines the scope of the assignment. In other words, the role is effective only within the tenant. If the role is not actually assigned, will return 404.
473
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
474
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
475
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
476
+ # @param user_id [String] Either the unique id of the user, or the URL-friendly key of the user (i.e: the \&quot;slug\&quot;).
477
+ # @param elements_user_role_remove [ElementsUserRoleRemove]
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [nil]
480
+ def elements_unassign_role_from_user(proj_id, env_id, elements_config_id, user_id, elements_user_role_remove, opts = {})
481
+ elements_unassign_role_from_user_with_http_info(proj_id, env_id, elements_config_id, user_id, elements_user_role_remove, opts)
482
+ nil
483
+ end
484
+
485
+ # Unassign role from user
486
+ # Unassigns the role from the user within the tenant. The tenant defines the scope of the assignment. In other words, the role is effective only within the tenant. If the role is not actually assigned, will return 404.
487
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
488
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
489
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
490
+ # @param user_id [String] Either the unique id of the user, or the URL-friendly key of the user (i.e: the \&quot;slug\&quot;).
491
+ # @param elements_user_role_remove [ElementsUserRoleRemove]
492
+ # @param [Hash] opts the optional parameters
493
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
494
+ def elements_unassign_role_from_user_with_http_info(proj_id, env_id, elements_config_id, user_id, elements_user_role_remove, opts = {})
495
+ if @api_client.config.debugging
496
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.elements_unassign_role_from_user ...'
497
+ end
498
+ # verify the required parameter 'proj_id' is set
499
+ if @api_client.config.client_side_validation && proj_id.nil?
500
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.elements_unassign_role_from_user"
501
+ end
502
+ # verify the required parameter 'env_id' is set
503
+ if @api_client.config.client_side_validation && env_id.nil?
504
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.elements_unassign_role_from_user"
505
+ end
506
+ # verify the required parameter 'elements_config_id' is set
507
+ if @api_client.config.client_side_validation && elements_config_id.nil?
508
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.elements_unassign_role_from_user"
509
+ end
510
+ # verify the required parameter 'user_id' is set
511
+ if @api_client.config.client_side_validation && user_id.nil?
512
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersElementsDataApi.elements_unassign_role_from_user"
513
+ end
514
+ # verify the required parameter 'elements_user_role_remove' is set
515
+ if @api_client.config.client_side_validation && elements_user_role_remove.nil?
516
+ fail ArgumentError, "Missing the required parameter 'elements_user_role_remove' when calling UsersElementsDataApi.elements_unassign_role_from_user"
517
+ end
518
+ # resource path
519
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users/{user_id}/roles'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
520
+
521
+ # query parameters
522
+ query_params = opts[:query_params] || {}
523
+
524
+ # header parameters
525
+ header_params = opts[:header_params] || {}
526
+ # HTTP header 'Accept' (if needed)
527
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
528
+ # HTTP header 'Content-Type'
529
+ content_type = @api_client.select_header_content_type(['application/json'])
530
+ if !content_type.nil?
531
+ header_params['Content-Type'] = content_type
532
+ end
533
+
534
+ # form parameters
535
+ form_params = opts[:form_params] || {}
536
+
537
+ # http body (model)
538
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(elements_user_role_remove)
539
+
540
+ # return_type
541
+ return_type = opts[:debug_return_type]
542
+
543
+ # auth_names
544
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
545
+
546
+ new_options = opts.merge(
547
+ :operation => :"UsersElementsDataApi.elements_unassign_role_from_user",
548
+ :header_params => header_params,
549
+ :query_params => query_params,
550
+ :form_params => form_params,
551
+ :body => post_body,
552
+ :auth_names => auth_names,
553
+ :return_type => return_type
554
+ )
555
+
556
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
557
+ if @api_client.config.debugging
558
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#elements_unassign_role_from_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
559
+ end
560
+ return data, status_code, headers
561
+ end
562
+
563
+ # Set Config Active
564
+ # Updates the embed_config.
565
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
566
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
567
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
568
+ # @param [Hash] opts the optional parameters
569
+ # @return [nil]
570
+ def set_config_active(elements_config_id, proj_id, env_id, opts = {})
571
+ set_config_active_with_http_info(elements_config_id, proj_id, env_id, opts)
572
+ nil
573
+ end
574
+
575
+ # Set Config Active
576
+ # Updates the embed_config.
577
+ # @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \&quot;slug\&quot;).
578
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
579
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
580
+ # @param [Hash] opts the optional parameters
581
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
582
+ def set_config_active_with_http_info(elements_config_id, proj_id, env_id, opts = {})
583
+ if @api_client.config.debugging
584
+ @api_client.config.logger.debug 'Calling API: UsersElementsDataApi.set_config_active ...'
585
+ end
586
+ # verify the required parameter 'elements_config_id' is set
587
+ if @api_client.config.client_side_validation && elements_config_id.nil?
588
+ fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling UsersElementsDataApi.set_config_active"
589
+ end
590
+ # verify the required parameter 'proj_id' is set
591
+ if @api_client.config.client_side_validation && proj_id.nil?
592
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling UsersElementsDataApi.set_config_active"
593
+ end
594
+ # verify the required parameter 'env_id' is set
595
+ if @api_client.config.client_side_validation && env_id.nil?
596
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling UsersElementsDataApi.set_config_active"
597
+ end
598
+ # resource path
599
+ local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/active'.sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s)).sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
600
+
601
+ # query parameters
602
+ query_params = opts[:query_params] || {}
603
+
604
+ # header parameters
605
+ header_params = opts[:header_params] || {}
606
+ # HTTP header 'Accept' (if needed)
607
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
608
+
609
+ # form parameters
610
+ form_params = opts[:form_params] || {}
611
+
612
+ # http body (model)
613
+ post_body = opts[:debug_body]
614
+
615
+ # return_type
616
+ return_type = opts[:debug_return_type]
617
+
618
+ # auth_names
619
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
620
+
621
+ new_options = opts.merge(
622
+ :operation => :"UsersElementsDataApi.set_config_active",
623
+ :header_params => header_params,
624
+ :query_params => query_params,
625
+ :form_params => form_params,
626
+ :body => post_body,
627
+ :auth_names => auth_names,
628
+ :return_type => return_type
629
+ )
630
+
631
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
632
+ if @api_client.config.debugging
633
+ @api_client.config.logger.debug "API called: UsersElementsDataApi#set_config_active\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
634
+ end
635
+ return data, status_code, headers
636
+ end
637
+ end
638
+ end