Class: RBACApiClient::PermissionApi
- Inherits:
-
Object
- Object
- RBACApiClient::PermissionApi
- Defined in:
- lib/insights-rbac-api-client/api/permission_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ PermissionApi
constructor
A new instance of PermissionApi.
-
#list_permission_options(field, opts = {}) ⇒ PermissionOptionsPagination
List the available options for fields of permissions for a tenant By default, options of application is returned.
-
#list_permission_options_with_http_info(field, opts = {}) ⇒ Array<(PermissionOptionsPagination, Integer, Hash)>
List the available options for fields of permissions for a tenant By default, options of application is returned.
-
#list_permissions(opts = {}) ⇒ PermissionPagination
List the permissions for a tenant By default, responses are sorted in ascending order by permission application.
-
#list_permissions_with_http_info(opts = {}) ⇒ Array<(PermissionPagination, Integer, Hash)>
List the permissions for a tenant By default, responses are sorted in ascending order by permission application.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PermissionApi
Returns a new instance of PermissionApi.
19 20 21 |
# File 'lib/insights-rbac-api-client/api/permission_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/insights-rbac-api-client/api/permission_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#list_permission_options(field, opts = {}) ⇒ PermissionOptionsPagination
List the available options for fields of permissions for a tenant By default, options of application is returned. And could be resource_type or verb on demand.
34 35 36 37 |
# File 'lib/insights-rbac-api-client/api/permission_api.rb', line 34 def (field, opts = {}) data, _status_code, _headers = (field, opts) data end |
#list_permission_options_with_http_info(field, opts = {}) ⇒ Array<(PermissionOptionsPagination, Integer, Hash)>
List the available options for fields of permissions for a tenant By default, options of application is returned. And could be resource_type or verb on demand.
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/insights-rbac-api-client/api/permission_api.rb', line 51 def (field, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PermissionApi.list_permission_options ...' end # verify the required parameter 'field' is set if @api_client.config.client_side_validation && field.nil? fail ArgumentError, "Missing the required parameter 'field' when calling PermissionApi.list_permission_options" end # verify enum value allowable_values = ["application", "resource_type", "verb"] if @api_client.config.client_side_validation && !allowable_values.include?(field) fail ArgumentError, "invalid value for \"field\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PermissionApi.list_permission_options, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PermissionApi.list_permission_options, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling PermissionApi.list_permission_options, must be greater than or equal to 0.' end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'exclude_globals'] && !allowable_values.include?(opts[:'exclude_globals']) fail ArgumentError, "invalid value for \"exclude_globals\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'allowed_only'] && !allowable_values.include?(opts[:'allowed_only']) fail ArgumentError, "invalid value for \"allowed_only\", must be one of #{allowable_values}" end # resource path local_var_path = '/permissions/options/' # query parameters query_params = opts[:query_params] || {} query_params[:'field'] = field query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'application'] = opts[:'application'] if !opts[:'application'].nil? query_params[:'resource_type'] = opts[:'resource_type'] if !opts[:'resource_type'].nil? query_params[:'verb'] = opts[:'verb'] if !opts[:'verb'].nil? query_params[:'exclude_globals'] = opts[:'exclude_globals'] if !opts[:'exclude_globals'].nil? query_params[:'allowed_only'] = opts[:'allowed_only'] if !opts[:'allowed_only'].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] || 'PermissionOptionsPagination' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"PermissionApi.list_permission_options", :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: PermissionApi#list_permission_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_permissions(opts = {}) ⇒ PermissionPagination
List the permissions for a tenant By default, responses are sorted in ascending order by permission application.
146 147 148 149 |
# File 'lib/insights-rbac-api-client/api/permission_api.rb', line 146 def (opts = {}) data, _status_code, _headers = (opts) data end |
#list_permissions_with_http_info(opts = {}) ⇒ Array<(PermissionPagination, Integer, Hash)>
List the permissions for a tenant By default, responses are sorted in ascending order by permission application.
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 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 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 |
# File 'lib/insights-rbac-api-client/api/permission_api.rb', line 165 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PermissionApi.list_permissions ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PermissionApi.list_permissions, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PermissionApi.list_permissions, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling PermissionApi.list_permissions, must be greater than or equal to 0.' end allowable_values = ["application", "resource_type", "verb", "permission"] if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'exclude_globals'] && !allowable_values.include?(opts[:'exclude_globals']) fail ArgumentError, "invalid value for \"exclude_globals\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'allowed_only'] && !allowable_values.include?(opts[:'allowed_only']) fail ArgumentError, "invalid value for \"allowed_only\", must be one of #{allowable_values}" end # resource path local_var_path = '/permissions/' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'application'] = opts[:'application'] if !opts[:'application'].nil? query_params[:'resource_type'] = opts[:'resource_type'] if !opts[:'resource_type'].nil? query_params[:'verb'] = opts[:'verb'] if !opts[:'verb'].nil? query_params[:'permission'] = opts[:'permission'] if !opts[:'permission'].nil? query_params[:'exclude_globals'] = opts[:'exclude_globals'] if !opts[:'exclude_globals'].nil? query_params[:'exclude_roles'] = opts[:'exclude_roles'] if !opts[:'exclude_roles'].nil? query_params[:'allowed_only'] = opts[:'allowed_only'] if !opts[:'allowed_only'].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] || 'PermissionPagination' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"PermissionApi.list_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: PermissionApi#list_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |