Sha256: f58e8155bc3bd3c1050fefd3f91bece5f86e6e5fbdc4eecb735f570c441d7902

Contents?: true

Size: 835 Bytes

Versions: 3

Compression:

Stored size: 835 Bytes

Contents

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

            private

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

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

              success(response: response)
            rescue OAuth2::Error => e
              failure(e)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ledger_sync-1.0.3 lib/ledger_sync/adaptors/quickbooks_online/product/operations/find.rb
ledger_sync-1.0.2 lib/ledger_sync/adaptors/quickbooks_online/product/operations/find.rb
ledger_sync-1.0.0 lib/ledger_sync/adaptors/quickbooks_online/product/operations/find.rb