Method: Warrant::Object.list
- Defined in:
- lib/warrant/models/object.rb
.list(filters = {}, options = {}) ⇒ Array<Object>
Lists all objects for your organization and environment
145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/warrant/models/object.rb', line 145 def self.list(filters = {}, = {}) res = APIOperations.get(URI.parse("#{::Warrant.config.api_base}/v2/objects"), params: Util.normalize_params(filters), options: ) case res when Net::HTTPSuccess list_result = JSON.parse(res.body, symbolize_names: true) objects = list_result[:results].map{ |object| Object.new(object[:objectType], object[:objectId], object[:meta], object[:createdAt]) } return ListResponse.new(objects, list_result[:prevCursor], list_result[:nextCursor]) else APIOperations.raise_error(res) end end |