Class: ApiReference::ListInvoicesParams

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

Overview

ListInvoicesParams 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(customer_id: SKIP, external_customer_id: SKIP, subscription_id: SKIP, status: SKIP, status_1: SKIP, due_date_window: SKIP, date_type: DateType::INVOICE_DATE, due_date: SKIP, due_date_gt: SKIP, due_date_lt: SKIP, amount: SKIP, amount_gt: SKIP, amount_lt: SKIP, is_recurring: SKIP, limit: 20, cursor: SKIP, invoice_date_gte: SKIP, invoice_date_gt: SKIP, invoice_date_lt: SKIP, invoice_date_lte: SKIP) ⇒ ListInvoicesParams

Returns a new instance of ListInvoicesParams.



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/api_reference/models/list_invoices_params.rb', line 202

def initialize(customer_id: SKIP, external_customer_id: SKIP,
               subscription_id: SKIP, status: SKIP, status_1: SKIP,
               due_date_window: SKIP, date_type: DateType::INVOICE_DATE,
               due_date: SKIP, due_date_gt: SKIP, due_date_lt: SKIP,
               amount: SKIP, amount_gt: SKIP, amount_lt: SKIP,
               is_recurring: SKIP, limit: 20, cursor: SKIP,
               invoice_date_gte: SKIP, invoice_date_gt: SKIP,
               invoice_date_lt: SKIP, invoice_date_lte: SKIP)
  @customer_id = customer_id unless customer_id == SKIP
  @external_customer_id = external_customer_id unless external_customer_id == SKIP
  @subscription_id = subscription_id unless subscription_id == SKIP
  @status = status unless status == SKIP
  @status_1 = status_1 unless status_1 == SKIP
  @due_date_window = due_date_window unless due_date_window == SKIP
  @date_type = date_type unless date_type == SKIP
  @due_date = due_date unless due_date == SKIP
  @due_date_gt = due_date_gt unless due_date_gt == SKIP
  @due_date_lt = due_date_lt unless due_date_lt == SKIP
  @amount = amount unless amount == SKIP
  @amount_gt = amount_gt unless amount_gt == SKIP
  @amount_lt = amount_lt unless amount_lt == SKIP
  @is_recurring = is_recurring unless is_recurring == SKIP
  @limit = limit unless limit == SKIP
  @cursor = cursor unless cursor == SKIP
  @invoice_date_gte = invoice_date_gte unless invoice_date_gte == SKIP
  @invoice_date_gt = invoice_date_gt unless invoice_date_gt == SKIP
  @invoice_date_lt = invoice_date_lt unless invoice_date_lt == SKIP
  @invoice_date_lte = invoice_date_lte unless invoice_date_lte == SKIP
end

Instance Attribute Details

#amountString

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (String)


73
74
75
# File 'lib/api_reference/models/list_invoices_params.rb', line 73

def amount
  @amount
end

#amount_gtString

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (String)


80
81
82
# File 'lib/api_reference/models/list_invoices_params.rb', line 80

def amount_gt
  @amount_gt
end

#amount_ltString

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (String)


87
88
89
# File 'lib/api_reference/models/list_invoices_params.rb', line 87

def amount_lt
  @amount_lt
end

#cursorString

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

Returns:

  • (String)


103
104
105
# File 'lib/api_reference/models/list_invoices_params.rb', line 103

def cursor
  @cursor
end

#customer_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def customer_id
  @customer_id
end

#date_typeDateType

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:



45
46
47
# File 'lib/api_reference/models/list_invoices_params.rb', line 45

def date_type
  @date_type
end

#due_dateDate

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (Date)


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

def due_date
  @due_date
end

#due_date_gtDate

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (Date)


59
60
61
# File 'lib/api_reference/models/list_invoices_params.rb', line 59

def due_date_gt
  @due_date_gt
end

#due_date_ltDate

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (Date)


66
67
68
# File 'lib/api_reference/models/list_invoices_params.rb', line 66

def due_date_lt
  @due_date_lt
end

#due_date_windowString

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (String)


38
39
40
# File 'lib/api_reference/models/list_invoices_params.rb', line 38

def due_date_window
  @due_date_window
end

#external_customer_idString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/api_reference/models/list_invoices_params.rb', line 19

def external_customer_id
  @external_customer_id
end

#invoice_date_gtDateTime

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

Returns:

  • (DateTime)


113
114
115
# File 'lib/api_reference/models/list_invoices_params.rb', line 113

def invoice_date_gt
  @invoice_date_gt
end

#invoice_date_gteDateTime

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

Returns:

  • (DateTime)


108
109
110
# File 'lib/api_reference/models/list_invoices_params.rb', line 108

def invoice_date_gte
  @invoice_date_gte
end

#invoice_date_ltDateTime

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

Returns:

  • (DateTime)


118
119
120
# File 'lib/api_reference/models/list_invoices_params.rb', line 118

def invoice_date_lt
  @invoice_date_lt
end

#invoice_date_lteDateTime

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

Returns:

  • (DateTime)


123
124
125
# File 'lib/api_reference/models/list_invoices_params.rb', line 123

def invoice_date_lte
  @invoice_date_lte
end

#is_recurringTrueClass | FalseClass

Filters invoices by their due dates within a specific time range in the past. Specify the range as a number followed by 'd' (days) or 'm' (months). For example, '7d' filters invoices due in the last 7 days, and '2m' filters those due in the last 2 months.

Returns:

  • (TrueClass | FalseClass)


94
95
96
# File 'lib/api_reference/models/list_invoices_params.rb', line 94

def is_recurring
  @is_recurring
end

#limitInteger

The number of items to fetch. Defaults to 20.

Returns:

  • (Integer)


98
99
100
# File 'lib/api_reference/models/list_invoices_params.rb', line 98

def limit
  @limit
end

#statusStatus1

TODO: Write general description for this method

Returns:



27
28
29
# File 'lib/api_reference/models/list_invoices_params.rb', line 27

def status
  @status
end

#status_1Array[Status11]

TODO: Write general description for this method

Returns:



31
32
33
# File 'lib/api_reference/models/list_invoices_params.rb', line 31

def status_1
  @status_1
end

#subscription_idString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/api_reference/models/list_invoices_params.rb', line 23

def subscription_id
  @subscription_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/api_reference/models/list_invoices_params.rb', line 233

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP
  external_customer_id =
    hash.key?('external_customer_id') ? hash['external_customer_id'] : SKIP
  subscription_id =
    hash.key?('subscription_id') ? hash['subscription_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  status_1 = hash.key?('status_1') ? hash['status_1'] : SKIP
  due_date_window =
    hash.key?('due_date_window') ? hash['due_date_window'] : SKIP
  date_type = hash['date_type'] ||= DateType::INVOICE_DATE
  due_date = hash.key?('due_date') ? hash['due_date'] : SKIP
  due_date_gt = hash.key?('due_date[gt]') ? hash['due_date[gt]'] : SKIP
  due_date_lt = hash.key?('due_date[lt]') ? hash['due_date[lt]'] : SKIP
  amount = hash.key?('amount') ? hash['amount'] : SKIP
  amount_gt = hash.key?('amount[gt]') ? hash['amount[gt]'] : SKIP
  amount_lt = hash.key?('amount[lt]') ? hash['amount[lt]'] : SKIP
  is_recurring = hash.key?('is_recurring') ? hash['is_recurring'] : SKIP
  limit = hash['limit'] ||= 20
  cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
  invoice_date_gte = if hash.key?('invoice_date[gte]')
                       (DateTimeHelper.from_rfc3339(hash['invoice_date[gte]']) if hash['invoice_date[gte]'])
                     else
                       SKIP
                     end
  invoice_date_gt = if hash.key?('invoice_date[gt]')
                      (DateTimeHelper.from_rfc3339(hash['invoice_date[gt]']) if hash['invoice_date[gt]'])
                    else
                      SKIP
                    end
  invoice_date_lt = if hash.key?('invoice_date[lt]')
                      (DateTimeHelper.from_rfc3339(hash['invoice_date[lt]']) if hash['invoice_date[lt]'])
                    else
                      SKIP
                    end
  invoice_date_lte = if hash.key?('invoice_date[lte]')
                       (DateTimeHelper.from_rfc3339(hash['invoice_date[lte]']) if hash['invoice_date[lte]'])
                     else
                       SKIP
                     end

  # Create object from extracted values.
  ListInvoicesParams.new(customer_id: customer_id,
                         external_customer_id: external_customer_id,
                         subscription_id: subscription_id,
                         status: status,
                         status_1: status_1,
                         due_date_window: due_date_window,
                         date_type: date_type,
                         due_date: due_date,
                         due_date_gt: due_date_gt,
                         due_date_lt: due_date_lt,
                         amount: amount,
                         amount_gt: amount_gt,
                         amount_lt: amount_lt,
                         is_recurring: is_recurring,
                         limit: limit,
                         cursor: cursor,
                         invoice_date_gte: invoice_date_gte,
                         invoice_date_gt: invoice_date_gt,
                         invoice_date_lt: invoice_date_lt,
                         invoice_date_lte: invoice_date_lte)
end

.namesObject

A mapping from model property names to API property names.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/api_reference/models/list_invoices_params.rb', line 126

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer_id'] = 'customer_id'
  @_hash['external_customer_id'] = 'external_customer_id'
  @_hash['subscription_id'] = 'subscription_id'
  @_hash['status'] = 'status'
  @_hash['status_1'] = 'status_1'
  @_hash['due_date_window'] = 'due_date_window'
  @_hash['date_type'] = 'date_type'
  @_hash['due_date'] = 'due_date'
  @_hash['due_date_gt'] = 'due_date[gt]'
  @_hash['due_date_lt'] = 'due_date[lt]'
  @_hash['amount'] = 'amount'
  @_hash['amount_gt'] = 'amount[gt]'
  @_hash['amount_lt'] = 'amount[lt]'
  @_hash['is_recurring'] = 'is_recurring'
  @_hash['limit'] = 'limit'
  @_hash['cursor'] = 'cursor'
  @_hash['invoice_date_gte'] = 'invoice_date[gte]'
  @_hash['invoice_date_gt'] = 'invoice_date[gt]'
  @_hash['invoice_date_lt'] = 'invoice_date[lt]'
  @_hash['invoice_date_lte'] = 'invoice_date[lte]'
  @_hash
end

.nullablesObject

An array for nullable fields



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/api_reference/models/list_invoices_params.rb', line 178

def self.nullables
  %w[
    customer_id
    external_customer_id
    subscription_id
    status
    status_1
    due_date_window
    date_type
    due_date
    due_date_gt
    due_date_lt
    amount
    amount_gt
    amount_lt
    is_recurring
    cursor
    invoice_date_gte
    invoice_date_gt
    invoice_date_lt
    invoice_date_lte
  ]
end

.optionalsObject

An array for optional fields



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/api_reference/models/list_invoices_params.rb', line 152

def self.optionals
  %w[
    customer_id
    external_customer_id
    subscription_id
    status
    status_1
    due_date_window
    date_type
    due_date
    due_date_gt
    due_date_lt
    amount
    amount_gt
    amount_lt
    is_recurring
    limit
    cursor
    invoice_date_gte
    invoice_date_gt
    invoice_date_lt
    invoice_date_lte
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/api_reference/models/list_invoices_params.rb', line 330

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} customer_id: #{@customer_id.inspect}, external_customer_id:"\
  " #{@external_customer_id.inspect}, subscription_id: #{@subscription_id.inspect}, status:"\
  " #{@status.inspect}, status_1: #{@status_1.inspect}, due_date_window:"\
  " #{@due_date_window.inspect}, date_type: #{@date_type.inspect}, due_date:"\
  " #{@due_date.inspect}, due_date_gt: #{@due_date_gt.inspect}, due_date_lt:"\
  " #{@due_date_lt.inspect}, amount: #{@amount.inspect}, amount_gt: #{@amount_gt.inspect},"\
  " amount_lt: #{@amount_lt.inspect}, is_recurring: #{@is_recurring.inspect}, limit:"\
  " #{@limit.inspect}, cursor: #{@cursor.inspect}, invoice_date_gte:"\
  " #{@invoice_date_gte.inspect}, invoice_date_gt: #{@invoice_date_gt.inspect},"\
  " invoice_date_lt: #{@invoice_date_lt.inspect}, invoice_date_lte:"\
  " #{@invoice_date_lte.inspect}>"
end

#to_custom_invoice_date_gtObject



304
305
306
# File 'lib/api_reference/models/list_invoices_params.rb', line 304

def to_custom_invoice_date_gt
  DateTimeHelper.to_rfc3339(invoice_date_gt)
end

#to_custom_invoice_date_gteObject



300
301
302
# File 'lib/api_reference/models/list_invoices_params.rb', line 300

def to_custom_invoice_date_gte
  DateTimeHelper.to_rfc3339(invoice_date_gte)
end

#to_custom_invoice_date_ltObject



308
309
310
# File 'lib/api_reference/models/list_invoices_params.rb', line 308

def to_custom_invoice_date_lt
  DateTimeHelper.to_rfc3339(invoice_date_lt)
end

#to_custom_invoice_date_lteObject



312
313
314
# File 'lib/api_reference/models/list_invoices_params.rb', line 312

def to_custom_invoice_date_lte
  DateTimeHelper.to_rfc3339(invoice_date_lte)
end

#to_sObject

Provides a human-readable string representation of the object.



317
318
319
320
321
322
323
324
325
326
327
# File 'lib/api_reference/models/list_invoices_params.rb', line 317

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} customer_id: #{@customer_id}, external_customer_id:"\
  " #{@external_customer_id}, subscription_id: #{@subscription_id}, status: #{@status},"\
  " status_1: #{@status_1}, due_date_window: #{@due_date_window}, date_type: #{@date_type},"\
  " due_date: #{@due_date}, due_date_gt: #{@due_date_gt}, due_date_lt: #{@due_date_lt},"\
  " amount: #{@amount}, amount_gt: #{@amount_gt}, amount_lt: #{@amount_lt}, is_recurring:"\
  " #{@is_recurring}, limit: #{@limit}, cursor: #{@cursor}, invoice_date_gte:"\
  " #{@invoice_date_gte}, invoice_date_gt: #{@invoice_date_gt}, invoice_date_lt:"\
  " #{@invoice_date_lt}, invoice_date_lte: #{@invoice_date_lte}>"
end