Class: Blueticks::Resources::EnginesResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Blueticks::Resources::EnginesResource
- Defined in:
- lib/blueticks/resources/engines.rb
Instance Attribute Summary
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#list ⇒ Object
List engines.
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from Blueticks::BaseResource
Instance Method Details
#list ⇒ Object
List engines.
List the WhatsApp engines connected to the workspace. Returns an Array of Engine (empty when no engine is paired) — this endpoint is not paginated.
14 15 16 17 18 19 20 21 22 |
# File 'lib/blueticks/resources/engines.rb', line 14 def list env = client.request("GET", "/v1/engines") data = env.is_a?(Hash) ? env["data"] : nil unless data.is_a?(Array) raise Errors::ValidationError.new(message: "Expected array `data` in engines.list response") end data.map { |item| Types::Engine.from_hash(item) } end |