Class: CityPayApiClient::TransactionReportRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/citypay_api_client/models/transaction_report_request.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TransactionReportRequest

Initializes the object

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash



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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 132

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::TransactionReportRequest` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::TransactionReportRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'fields')
    if (value = attributes[:'fields']).is_a?(Array)
      self.fields = value
    end
  end

  if attributes.key?(:'from')
    self.from = attributes[:'from']
  else
    self.from = nil
  end

  if attributes.key?(:'include_authorised')
    self.include_authorised = attributes[:'include_authorised']
  end

  if attributes.key?(:'include_cancelled')
    self.include_cancelled = attributes[:'include_cancelled']
  end

  if attributes.key?(:'include_declined')
    self.include_declined = attributes[:'include_declined']
  end

  if attributes.key?(:'include_rejected')
    self.include_rejected = attributes[:'include_rejected']
  end

  if attributes.key?(:'include_unfulfilled')
    self.include_unfulfilled = attributes[:'include_unfulfilled']
  end

  if attributes.key?(:'max_results')
    self.max_results = attributes[:'max_results']
  end

  if attributes.key?(:'merchantid')
    self.merchantid = attributes[:'merchantid']
  else
    self.merchantid = nil
  end

  if attributes.key?(:'mode')
    self.mode = attributes[:'mode']
  end

  if attributes.key?(:'next_token')
    self.next_token = attributes[:'next_token']
  end

  if attributes.key?(:'order_by')
    self.order_by = attributes[:'order_by']
  end

  if attributes.key?(:'pii_masked')
    self.pii_masked = attributes[:'pii_masked']
  end

  if attributes.key?(:'type_refund')
    self.type_refund = attributes[:'type_refund']
  end

  if attributes.key?(:'type_sale')
    self.type_sale = attributes[:'type_sale']
  end

  if attributes.key?(:'type_verify')
    self.type_verify = attributes[:'type_verify']
  end

  if attributes.key?(:'_until')
    self._until = attributes[:'_until']
  else
    self._until = nil
  end
end

Instance Attribute Details

#_untilObject

The date and time of transactions until.



66
67
68
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 66

def _until
  @_until
end

#fieldsObject

Returns the value of attribute fields.



18
19
20
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 18

def fields
  @fields
end

#fromObject

The date and time of transactions from.



21
22
23
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 21

def from
  @from
end

#include_authorisedObject

Include transactions fully authorised in the results.



24
25
26
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 24

def include_authorised
  @include_authorised
end

#include_cancelledObject

Include transactions that were cancelled in the results.



27
28
29
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 27

def include_cancelled
  @include_cancelled
end

#include_declinedObject

Include transactions that were declined or not honoured in the results.



30
31
32
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 30

def include_declined
  @include_declined
end

#include_rejectedObject

Include transactions that were rejected due to validation issues.



33
34
35
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 33

def include_rejected
  @include_rejected
end

#include_unfulfilledObject

Includes transactions that were initiated but not completed—e.g. those pending authentication or challenge responses that were never fulfilled.



36
37
38
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 36

def include_unfulfilled
  @include_unfulfilled
end

#max_resultsObject

The maximum number of results to return in a single response. This value is used to limit the size of data returned by the API, enhancing performance and manageability. Values should be between 5 and 250.



39
40
41
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 39

def max_results
  @max_results
end

#merchantidObject

The merchant id of the transactions to review.



42
43
44
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 42

def merchantid
  @merchantid
end

#modeObject

Defines a preset profile for the level of detail in the returned fields. This simplifies response formatting for common use cases. Available values: - ‘basic` (default): Returns a minimal, high-level view with key fields for reporting or dashboards. - `extended`: Adds fields useful for customer support, settlement analysis, or more in-depth tracking, while still omitting sensitive personal or low-level fields. - `full`: Returns all available transaction fields, including internal flags, personal data (where applicable), and detailed metadata. Use with care.



45
46
47
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 45

def mode
  @mode
end

#next_tokenObject

A token that identifies the starting point of the page of results to be returned. An empty value indicates the start of the dataset. When supplied, it is validated and used to fetch the subsequent page of results. This token is typically obtained from the response of a previous pagination request.



48
49
50
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 48

def next_token
  @next_token
end

#order_byObject

Specifies the field by which results are ordered. Available fields are [trans_no,date_when,amount]. By default, fields are ordered by OrderByExpression(trans_no,ASC). To order in descending order, prefix with ‘-’ or suffix with ‘ DESC’.



51
52
53
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 51

def order_by
  @order_by
end

#pii_maskedObject

Defines whether personal identifiable information is masked which it is by default.



54
55
56
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 54

def pii_masked
  @pii_masked
end

#type_refundObject

Include refunds in the results.



57
58
59
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 57

def type_refund
  @type_refund
end

#type_saleObject

Include sales in the results.



60
61
62
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 60

def type_sale
  @type_sale
end

#type_verifyObject

Include verifications in the results.



63
64
65
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 63

def type_verify
  @type_verify
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • type Data type

  • value Value to be deserialized

Returns:

  • Deserialized data



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 316

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = CityPayApiClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



92
93
94
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 92

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



97
98
99
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 97

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 69

def self.attribute_map
  {
    :'fields' => :'fields',
    :'from' => :'from',
    :'include_authorised' => :'include_authorised',
    :'include_cancelled' => :'include_cancelled',
    :'include_declined' => :'include_declined',
    :'include_rejected' => :'include_rejected',
    :'include_unfulfilled' => :'include_unfulfilled',
    :'max_results' => :'maxResults',
    :'merchantid' => :'merchantid',
    :'mode' => :'mode',
    :'next_token' => :'nextToken',
    :'order_by' => :'orderBy',
    :'pii_masked' => :'pii_masked',
    :'type_refund' => :'type_refund',
    :'type_sale' => :'type_sale',
    :'type_verify' => :'type_verify',
    :'_until' => :'until'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 292

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



125
126
127
128
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 125

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 102

def self.openapi_types
  {
    :'fields' => :'Array<String>',
    :'from' => :'Time',
    :'include_authorised' => :'Boolean',
    :'include_cancelled' => :'Boolean',
    :'include_declined' => :'Boolean',
    :'include_rejected' => :'Boolean',
    :'include_unfulfilled' => :'Boolean',
    :'max_results' => :'Integer',
    :'merchantid' => :'Integer',
    :'mode' => :'String',
    :'next_token' => :'String',
    :'order_by' => :'String',
    :'pii_masked' => :'Boolean',
    :'type_refund' => :'Boolean',
    :'type_sale' => :'Boolean',
    :'type_verify' => :'Boolean',
    :'_until' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • to be compared



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 255

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      fields == o.fields &&
      from == o.from &&
      include_authorised == o.include_authorised &&
      include_cancelled == o.include_cancelled &&
      include_declined == o.include_declined &&
      include_rejected == o.include_rejected &&
      include_unfulfilled == o.include_unfulfilled &&
      max_results == o.max_results &&
      merchantid == o.merchantid &&
      mode == o.mode &&
      next_token == o.next_token &&
      order_by == o.order_by &&
      pii_masked == o.pii_masked &&
      type_refund == o.type_refund &&
      type_sale == o.type_sale &&
      type_verify == o.type_verify &&
      _until == o._until
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • Any valid value

Returns:

  • Returns the value in the form of hash



387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 387

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • to be compared

Returns:

See Also:

  • `==` method


279
280
281
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 279

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • Hash code



285
286
287
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 285

def hash
  [fields, from, include_authorised, include_cancelled, include_declined, include_rejected, include_unfulfilled, max_results, merchantid, mode, next_token, order_by, pii_masked, type_refund, type_sale, type_verify, _until].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 225

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @from.nil?
    invalid_properties.push('invalid value for "from", from cannot be nil.')
  end

  if @merchantid.nil?
    invalid_properties.push('invalid value for "merchantid", merchantid cannot be nil.')
  end

  if @_until.nil?
    invalid_properties.push('invalid value for "_until", _until cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • Returns the object in the form of hash



363
364
365
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 363

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 369

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • String presentation of the object



357
358
359
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 357

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • true if the model is valid



245
246
247
248
249
250
251
# File 'lib/citypay_api_client/models/transaction_report_request.rb', line 245

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @from.nil?
  return false if @merchantid.nil?
  return false if @_until.nil?
  true
end