Sha256: 49cb7a561b6938bb7ff549eccdc0dc29967da196a6aa14572983dea5bc9b09e1

Contents?: true

Size: 2 KB

Versions: 3

Compression:

Stored size: 2 KB

Contents

# frozen_string_literal: true
module FinApps
  module REST
    class Client < BaseClient # :nodoc:
      using ObjectExtensions
      using StringExtensions

      include FinApps::REST::Defaults

      # @param [String] tenant_identifier
      # @param [String] tenant_token
      # @param [Hash] options
      # @return [FinApps::REST::Client]
      def initialize(tenant_identifier, tenant_token, options={}, logger=nil)
        raise FinApps::MissingArgumentsError.new 'Invalid company_identifier.' if tenant_identifier.blank?
        raise FinApps::MissingArgumentsError.new 'Invalid company_token.' if tenant_token.blank?

        merged_options = FinApps::REST::Defaults::DEFAULTS.merge(options.merge(tenant_identifier: tenant_identifier,
                                                                               tenant_token: tenant_token))
        super(merged_options, logger)
      end

      def users
        @users ||= FinApps::REST::Users.new self
      end

      def sessions
        @sessions ||= FinApps::REST::Sessions.new self
      end

      def order_tokens
        @order_tokens ||= FinApps::REST::OrderTokens.new self
      end

      def orders
        @orders ||= FinApps::REST::Orders.new self
      end

      def order_reports
        @order_reports ||= FinApps::REST::OrderReports.new self
      end

      def order_statuses
        @order_statuses ||= FinApps::REST::OrderStatuses.new self
      end

      def institutions
        @institutions ||= FinApps::REST::Institutions.new self
      end

      def institutions_forms
        @institutions_forms ||= FinApps::REST::InstitutionsForms.new self
      end

      def user_institutions_statuses
        @user_institutions_statuses ||= FinApps::REST::UserInstitutionsStatuses.new self
      end

      def user_institutions
        @user_institutions ||= FinApps::REST::UserInstitutions.new self
      end

      def user_institutions_forms
        @user_institutions_forms ||= FinApps::REST::UserInstitutionsForms.new self
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
finapps-2.1.2 lib/finapps/rest/client.rb
finapps-2.1.1 lib/finapps/rest/client.rb
finapps-2.0.30 lib/finapps/rest/client.rb