Class: Smplkit::Audit::Categories
- Inherits:
-
Object
- Object
- Smplkit::Audit::Categories
- Defined in:
- lib/smplkit/audit/categories.rb
Overview
client.audit.categories.list — distinct category values seen for the account.
Response time is independent of how many years of events the account has accumulated. Sorted alphabetically; offset paginated.
Instance Method Summary collapse
-
#initialize(api) ⇒ Categories
constructor
A new instance of Categories.
-
#list(page_number: nil, page_size: nil, meta_total: nil, environments: nil) ⇒ Smplkit::Audit::CategoryListPage
List the distinct
categoryvalues seen in the account.
Constructor Details
#initialize(api) ⇒ Categories
Returns a new instance of Categories.
11 12 13 |
# File 'lib/smplkit/audit/categories.rb', line 11 def initialize(api) @api = api end |
Instance Method Details
#list(page_number: nil, page_size: nil, meta_total: nil, environments: nil) ⇒ Smplkit::Audit::CategoryListPage
List the distinct category values seen in the account.
environments scopes the listing to a set of environments: pass an array of environment keys and/or the reserved “smplkit” control-plane bucket; the values are comma-joined into filter[environment]. Omitting it (or passing an empty array) leaves the filter off entirely.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/smplkit/audit/categories.rb', line 34 def list(page_number: nil, page_size: nil, meta_total: nil, environments: nil) opts = {} opts[:page_number] = page_number if page_number opts[:page_size] = page_size if page_size opts[:meta_total] = unless .nil? joined_environments = Smplkit::Audit.join_environments(environments) opts[:filter_environment] = joined_environments if joined_environments resp = Smplkit::Audit.call_api { @api.list_categories(opts) } rows = (resp.data || []).map { |r| Category.from_resource(r) } CategoryListPage.new(rows, Smplkit::Audit.extract_pagination(resp.)) end |