# frozen_string_literal: true require 'codat/base_model' module Codat module Models class Integration < BaseModel ENDPOINT = '/integrations' attributes :key, :logo_url, :name, :enabled, :source_id, :integration_id, :source_type def self.all(params = {}) result = get(ENDPOINT, params) return [] unless successful_response?(result) result.body.fetch(:results, []).map { |integration| new(json: integration) } end end end end