Sha256: 5d906a60cf2162bd4c7d6542b97f94f66f52dec55295c5559ae5ca0c0f00abe0

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 Bytes

Contents

module LedgerSync
  module Adaptors
    module QuickBooksOnline
      module Customer
        module Operations
          class Find < Operation::Find
            class Contract < LedgerSync::Adaptors::Contract
              params do
                required(:ledger_id).filled(:string)
                optional(:email).maybe(:string)
                optional(:name).maybe(:string)
                optional(:phone_number).maybe(:string)
              end
            end

            private

            def operate
              return failure(nil) if resource.ledger_id.nil?

              response = adaptor.find(
                resource: 'customer',
                id: resource.ledger_id
              )

              success(response: response)
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ledger_sync-1.1.1 lib/ledger_sync/adaptors/quickbooks_online/customer/operations/find.rb