Class: ApiReference::FetchCustomerCreditLedgerQueryParams

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb

Overview

FetchCustomerCreditLedgerQueryParams Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(limit: 20, cursor: SKIP, currency: SKIP, minimum_amount: SKIP, entry_type: SKIP, entry_status: SKIP, created_at_gte: SKIP, created_at_gt: SKIP, created_at_lt: SKIP, created_at_lte: SKIP) ⇒ FetchCustomerCreditLedgerQueryParams

Returns a new instance of FetchCustomerCreditLedgerQueryParams.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 101

def initialize(limit: 20, cursor: SKIP, currency: SKIP,
               minimum_amount: SKIP, entry_type: SKIP, entry_status: SKIP,
               created_at_gte: SKIP, created_at_gt: SKIP,
               created_at_lt: SKIP, created_at_lte: SKIP)
  @limit = limit unless limit == SKIP
  @cursor = cursor unless cursor == SKIP
  @currency = currency unless currency == SKIP
  @minimum_amount = minimum_amount unless minimum_amount == SKIP
  @entry_type = entry_type unless entry_type == SKIP
  @entry_status = entry_status unless entry_status == SKIP
  @created_at_gte = created_at_gte unless created_at_gte == SKIP
  @created_at_gt = created_at_gt unless created_at_gt == SKIP
  @created_at_lt = created_at_lt unless created_at_lt == SKIP
  @created_at_lte = created_at_lte unless created_at_lte == SKIP
end

Instance Attribute Details

#created_at_gtDateTime

The ledger currency or custom pricing unit to use.

Returns:

  • (DateTime)


44
45
46
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 44

def created_at_gt
  @created_at_gt
end

#created_at_gteDateTime

The ledger currency or custom pricing unit to use.

Returns:

  • (DateTime)


40
41
42
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 40

def created_at_gte
  @created_at_gte
end

#created_at_ltDateTime

The ledger currency or custom pricing unit to use.

Returns:

  • (DateTime)


48
49
50
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 48

def created_at_lt
  @created_at_lt
end

#created_at_lteDateTime

The ledger currency or custom pricing unit to use.

Returns:

  • (DateTime)


52
53
54
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 52

def created_at_lte
  @created_at_lte
end

#currencyString

The ledger currency or custom pricing unit to use.

Returns:

  • (String)


24
25
26
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 24

def currency
  @currency
end

#cursorString

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

Returns:

  • (String)


20
21
22
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 20

def cursor
  @cursor
end

#entry_statusEntryStatus

The ledger currency or custom pricing unit to use.

Returns:



36
37
38
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 36

def entry_status
  @entry_status
end

#entry_typeEntryType

The ledger currency or custom pricing unit to use.

Returns:



32
33
34
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 32

def entry_type
  @entry_type
end

#limitInteger

The number of items to fetch. Defaults to 20.

Returns:

  • (Integer)


15
16
17
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 15

def limit
  @limit
end

#minimum_amountString

The ledger currency or custom pricing unit to use.

Returns:

  • (String)


28
29
30
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 28

def minimum_amount
  @minimum_amount
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 118

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  limit = hash['limit'] ||= 20
  cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
  currency = hash.key?('currency') ? hash['currency'] : SKIP
  minimum_amount =
    hash.key?('minimum_amount') ? hash['minimum_amount'] : SKIP
  entry_type = hash.key?('entry_type') ? hash['entry_type'] : SKIP
  entry_status = hash.key?('entry_status') ? hash['entry_status'] : SKIP
  created_at_gte = if hash.key?('created_at[gte]')
                     (DateTimeHelper.from_rfc3339(hash['created_at[gte]']) if hash['created_at[gte]'])
                   else
                     SKIP
                   end
  created_at_gt = if hash.key?('created_at[gt]')
                    (DateTimeHelper.from_rfc3339(hash['created_at[gt]']) if hash['created_at[gt]'])
                  else
                    SKIP
                  end
  created_at_lt = if hash.key?('created_at[lt]')
                    (DateTimeHelper.from_rfc3339(hash['created_at[lt]']) if hash['created_at[lt]'])
                  else
                    SKIP
                  end
  created_at_lte = if hash.key?('created_at[lte]')
                     (DateTimeHelper.from_rfc3339(hash['created_at[lte]']) if hash['created_at[lte]'])
                   else
                     SKIP
                   end

  # Create object from extracted values.
  FetchCustomerCreditLedgerQueryParams.new(limit: limit,
                                           cursor: cursor,
                                           currency: currency,
                                           minimum_amount: minimum_amount,
                                           entry_type: entry_type,
                                           entry_status: entry_status,
                                           created_at_gte: created_at_gte,
                                           created_at_gt: created_at_gt,
                                           created_at_lt: created_at_lt,
                                           created_at_lte: created_at_lte)
end

.namesObject

A mapping from model property names to API property names.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 55

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['limit'] = 'limit'
  @_hash['cursor'] = 'cursor'
  @_hash['currency'] = 'currency'
  @_hash['minimum_amount'] = 'minimum_amount'
  @_hash['entry_type'] = 'entry_type'
  @_hash['entry_status'] = 'entry_status'
  @_hash['created_at_gte'] = 'created_at[gte]'
  @_hash['created_at_gt'] = 'created_at[gt]'
  @_hash['created_at_lt'] = 'created_at[lt]'
  @_hash['created_at_lte'] = 'created_at[lte]'
  @_hash
end

.nullablesObject

An array for nullable fields



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 87

def self.nullables
  %w[
    cursor
    currency
    minimum_amount
    entry_type
    entry_status
    created_at_gte
    created_at_gt
    created_at_lt
    created_at_lte
  ]
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 71

def self.optionals
  %w[
    limit
    cursor
    currency
    minimum_amount
    entry_type
    entry_status
    created_at_gte
    created_at_gt
    created_at_lt
    created_at_lte
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



189
190
191
192
193
194
195
196
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 189

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} limit: #{@limit.inspect}, cursor: #{@cursor.inspect}, currency:"\
  " #{@currency.inspect}, minimum_amount: #{@minimum_amount.inspect}, entry_type:"\
  " #{@entry_type.inspect}, entry_status: #{@entry_status.inspect}, created_at_gte:"\
  " #{@created_at_gte.inspect}, created_at_gt: #{@created_at_gt.inspect}, created_at_lt:"\
  " #{@created_at_lt.inspect}, created_at_lte: #{@created_at_lte.inspect}>"
end

#to_custom_created_at_gtObject



167
168
169
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 167

def to_custom_created_at_gt
  DateTimeHelper.to_rfc3339(created_at_gt)
end

#to_custom_created_at_gteObject



163
164
165
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 163

def to_custom_created_at_gte
  DateTimeHelper.to_rfc3339(created_at_gte)
end

#to_custom_created_at_ltObject



171
172
173
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 171

def to_custom_created_at_lt
  DateTimeHelper.to_rfc3339(created_at_lt)
end

#to_custom_created_at_lteObject



175
176
177
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 175

def to_custom_created_at_lte
  DateTimeHelper.to_rfc3339(created_at_lte)
end

#to_sObject

Provides a human-readable string representation of the object.



180
181
182
183
184
185
186
# File 'lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb', line 180

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} limit: #{@limit}, cursor: #{@cursor}, currency: #{@currency},"\
  " minimum_amount: #{@minimum_amount}, entry_type: #{@entry_type}, entry_status:"\
  " #{@entry_status}, created_at_gte: #{@created_at_gte}, created_at_gt: #{@created_at_gt},"\
  " created_at_lt: #{@created_at_lt}, created_at_lte: #{@created_at_lte}>"
end