Class: OpenapiClient::ConditionSetRulesApi
- Inherits:
-
Object
- Object
- OpenapiClient::ConditionSetRulesApi
- Defined in:
- lib/openapi_client/api/condition_set_rules_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#assign_set_permissions(proj_id, env_id, condition_set_rule_create, opts = {}) ⇒ Array<ConditionSetRuleRead>
Assign Set Permissions Grant permissions to a user set on a resource set.
-
#assign_set_permissions_with_http_info(proj_id, env_id, condition_set_rule_create, opts = {}) ⇒ Array<(Array<ConditionSetRuleRead>, Integer, Hash)>
Assign Set Permissions Grant permissions to a user set on a resource set.
-
#initialize(api_client = ApiClient.default) ⇒ ConditionSetRulesApi
constructor
A new instance of ConditionSetRulesApi.
-
#list_set_permissions(proj_id, env_id, opts = {}) ⇒ Array<ConditionSetRuleRead>
List Set Permissions Lists the condition set rules matching the filter.
-
#list_set_permissions_with_http_info(proj_id, env_id, opts = {}) ⇒ Array<(Array<ConditionSetRuleRead>, Integer, Hash)>
List Set Permissions Lists the condition set rules matching the filter.
-
#unassign_set_permissions(proj_id, env_id, condition_set_rule_remove, opts = {}) ⇒ nil
Unassign Set Permissions Revokes permissions to a user set on a resource set.
-
#unassign_set_permissions_with_http_info(proj_id, env_id, condition_set_rule_remove, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Unassign Set Permissions Revokes permissions to a user set on a resource set.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ConditionSetRulesApi
Returns a new instance of ConditionSetRulesApi.
19 20 21 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#assign_set_permissions(proj_id, env_id, condition_set_rule_create, opts = {}) ⇒ Array<ConditionSetRuleRead>
Assign Set Permissions Grant permissions to a user set on a resource set. If the permission is already granted, it is skipped.
29 30 31 32 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 29 def (proj_id, env_id, condition_set_rule_create, opts = {}) data, _status_code, _headers = (proj_id, env_id, condition_set_rule_create, opts) data end |
#assign_set_permissions_with_http_info(proj_id, env_id, condition_set_rule_create, opts = {}) ⇒ Array<(Array<ConditionSetRuleRead>, Integer, Hash)>
Assign Set Permissions Grant permissions to a user set on a resource set. If the permission is already granted, it is skipped.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 41 def (proj_id, env_id, condition_set_rule_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConditionSetRulesApi.assign_set_permissions ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetRulesApi.assign_set_permissions" end # verify the required parameter 'env_id' is set if @api_client.config.client_side_validation && env_id.nil? fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetRulesApi.assign_set_permissions" end # verify the required parameter 'condition_set_rule_create' is set if @api_client.config.client_side_validation && condition_set_rule_create.nil? fail ArgumentError, "Missing the required parameter 'condition_set_rule_create' when calling ConditionSetRulesApi.assign_set_permissions" end # resource path local_var_path = '/v2/facts/{proj_id}/{env_id}/set_rules'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(condition_set_rule_create) # return_type return_type = opts[:debug_return_type] || 'Array<ConditionSetRuleRead>' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"ConditionSetRulesApi.assign_set_permissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConditionSetRulesApi#assign_set_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_set_permissions(proj_id, env_id, opts = {}) ⇒ Array<ConditionSetRuleRead>
List Set Permissions Lists the condition set rules matching the filter. - If the ‘user_set` filter is present, will only return the permissions set of that user set. - If the `permission` filter is present, will only return the permissions sets that equals to the queried permission. - If the `resource_set` filter is present, will only return the permissions set of that resource set.
113 114 115 116 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 113 def (proj_id, env_id, opts = {}) data, _status_code, _headers = (proj_id, env_id, opts) data end |
#list_set_permissions_with_http_info(proj_id, env_id, opts = {}) ⇒ Array<(Array<ConditionSetRuleRead>, Integer, Hash)>
List Set Permissions Lists the condition set rules matching the filter. - If the `user_set` filter is present, will only return the permissions set of that user set. - If the `permission` filter is present, will only return the permissions sets that equals to the queried permission. - If the `resource_set` filter is present, will only return the permissions set of that resource set.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 129 def (proj_id, env_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConditionSetRulesApi.list_set_permissions ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetRulesApi.list_set_permissions" end # verify the required parameter 'env_id' is set if @api_client.config.client_side_validation && env_id.nil? fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetRulesApi.list_set_permissions" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ConditionSetRulesApi.list_set_permissions, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ConditionSetRulesApi.list_set_permissions, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1 fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ConditionSetRulesApi.list_set_permissions, must be greater than or equal to 1.' end # resource path local_var_path = '/v2/facts/{proj_id}/{env_id}/set_rules'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'user_set'] = opts[:'user_set'] if !opts[:'user_set'].nil? query_params[:'permission'] = opts[:'permission'] if !opts[:'permission'].nil? query_params[:'resource_set'] = opts[:'resource_set'] if !opts[:'resource_set'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<ConditionSetRuleRead>' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"ConditionSetRulesApi.list_set_permissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConditionSetRulesApi#list_set_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#unassign_set_permissions(proj_id, env_id, condition_set_rule_remove, opts = {}) ⇒ nil
Unassign Set Permissions Revokes permissions to a user set on a resource set. If the permission is not granted, it is skipped.
205 206 207 208 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 205 def (proj_id, env_id, condition_set_rule_remove, opts = {}) (proj_id, env_id, condition_set_rule_remove, opts) nil end |
#unassign_set_permissions_with_http_info(proj_id, env_id, condition_set_rule_remove, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Unassign Set Permissions Revokes permissions to a user set on a resource set. If the permission is not granted, it is skipped.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/openapi_client/api/condition_set_rules_api.rb', line 217 def (proj_id, env_id, condition_set_rule_remove, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConditionSetRulesApi.unassign_set_permissions ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling ConditionSetRulesApi.unassign_set_permissions" end # verify the required parameter 'env_id' is set if @api_client.config.client_side_validation && env_id.nil? fail ArgumentError, "Missing the required parameter 'env_id' when calling ConditionSetRulesApi.unassign_set_permissions" end # verify the required parameter 'condition_set_rule_remove' is set if @api_client.config.client_side_validation && condition_set_rule_remove.nil? fail ArgumentError, "Missing the required parameter 'condition_set_rule_remove' when calling ConditionSetRulesApi.unassign_set_permissions" end # resource path local_var_path = '/v2/facts/{proj_id}/{env_id}/set_rules'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(condition_set_rule_remove) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"ConditionSetRulesApi.unassign_set_permissions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConditionSetRulesApi#unassign_set_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |