Class: CDP::Query::Actions
- Inherits:
-
Object
- Object
- CDP::Query::Actions
- Defined in:
- lib/cdp/query/actions.rb
Instance Method Summary collapse
- #distinct(tenant_id:, fields:, condition:) ⇒ Object
- #exists?(tenant_id:, condition:) ⇒ Boolean
-
#initialize(service, object_type) ⇒ Actions
constructor
A new instance of Actions.
Constructor Details
#initialize(service, object_type) ⇒ Actions
6 7 8 9 |
# File 'lib/cdp/query/actions.rb', line 6 def initialize(service, object_type) @service = service @object_type = object_type.to_s.upcase end |
Instance Method Details
#distinct(tenant_id:, fields:, condition:) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cdp/query/actions.rb', line 24 def distinct(tenant_id:, fields:, condition:) request = CDP::SearchRequest.new( tenant_id: tenant_id, distinct: CDP::Distinct.new( type: @object_type, fields: Array(fields), field_condition: build_condition(condition) ) ) @service.search(request: request) end |
#exists?(tenant_id:, condition:) ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cdp/query/actions.rb', line 11 def exists?(tenant_id:, condition:) request = CDP::SearchRequest.new( tenant_id: tenant_id, exists: CDP::Exists.new( type: @object_type, field_condition: build_condition(condition) ) ) @service.search(request: request) end |