# 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 [] if result.status == 404 return result.body if result.status == 400 result.body.map { |integration| new(json: integration) } end end end end