Class: Unit::CheckPayment::ListPaymentParams

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/check_payment/list_check_payment_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit = CHECK_PAYMENT_LIMIT, offset = CHECK_PAYMENT_OFFSET, account_id = nil, customer_id = nil, tags = nil, sort = nil, since = nil, _until = nil, status = nil, from_amount = nil, to_amount = nil, check_number = nil, include = nil) ⇒ ListPaymentParams

Returns a new instance of ListPaymentParams.

Parameters:

  • limit (Integer) (defaults to: CHECK_PAYMENT_LIMIT)
    • optional

  • offset (Integer) (defaults to: CHECK_PAYMENT_OFFSET)
    • optional

  • account_id (String) (defaults to: nil)
    • optional

  • customer_id (String) (defaults to: nil)
    • optional

  • tags (Hash) (defaults to: nil)
    • optional

  • sort (String) (defaults to: nil)
    • optional

  • since (String) (defaults to: nil)
    • optional

  • _until (String) (defaults to: nil)
    • optional

  • status (Array<String>) (defaults to: nil)
    • optional

  • from_amount (String) (defaults to: nil)
    • optional

  • to_amount (String) (defaults to: nil)
    • optional

  • check_number (String) (defaults to: nil)
    • optional

  • include (Array<String>) (defaults to: nil)
    • optional



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 24

def initialize(limit = CHECK_PAYMENT_LIMIT, offset = CHECK_PAYMENT_OFFSET,  = nil,
               customer_id = nil, tags = nil, sort = nil, since = nil, _until = nil, status = nil, from_amount = nil,
               to_amount = nil, check_number = nil, include = nil)
  @limit = limit
  @offset = offset
  @account_id = 
  @customer_id = customer_id
  @tags = tags
  @sort = sort
  @since = since
  @until = _until
  @status = status
  @from_amount = from_amount
  @to_amount = to_amount
  @check_number = check_number
  @include = include
end

Instance Attribute Details

#_untilObject (readonly)

Returns the value of attribute _until.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def _until
  @_until
end

#account_idObject (readonly)

Returns the value of attribute account_id.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def 
  @account_id
end

#check_numberObject (readonly)

Returns the value of attribute check_number.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def check_number
  @check_number
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def customer_id
  @customer_id
end

#from_amountObject (readonly)

Returns the value of attribute from_amount.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def from_amount
  @from_amount
end

#includeObject (readonly)

Returns the value of attribute include.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def include
  @include
end

#limitObject (readonly)

Returns the value of attribute limit.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def offset
  @offset
end

#sinceObject (readonly)

Returns the value of attribute since.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def since
  @since
end

#sortObject (readonly)

Returns the value of attribute sort.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def sort
  @sort
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def status
  @status
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def tags
  @tags
end

#to_amountObject (readonly)

Returns the value of attribute to_amount.



8
9
10
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 8

def to_amount
  @to_amount
end

Instance Method Details

#to_hashObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/unit/models/check_payment/list_check_payment_params.rb', line 42

def to_hash
  params = {
    "page[limit]": limit,
    "page[offset]": offset,
    "filter[accountId]": ,
    "filter[customerId]": customer_id,
    "filter[tags]": tags,
    "sort": sort,
    "filter[since]": since,
    "filter[until]": _until,
    "filter[fromAmount]": from_amount,
    "filter[toAmount]": to_amount,
    "filter[checkNumber]": check_number,
    "include": include&.join(",")
  }
  status&.each_with_index&.map do |val, index|
    params.merge!({ "filter[status][#{index}]": val })
  end
end