Class: CyberSourceMergedSpec::TssV2TransactionsPost201Response

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb

Overview

TssV2TransactionsPost201Response 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(search_id: SKIP, save: SKIP, name: SKIP, timezone: SKIP, query: SKIP, offset: SKIP, limit: SKIP, sort: SKIP, count: SKIP, total_count: SKIP, submit_time_utc: SKIP, embedded: SKIP, links: SKIP, additional_properties: nil) ⇒ TssV2TransactionsPost201Response

Returns a new instance of TssV2TransactionsPost201Response.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 145

def initialize(search_id: SKIP, save: SKIP, name: SKIP, timezone: SKIP,
               query: SKIP, offset: SKIP, limit: SKIP, sort: SKIP,
               count: SKIP, total_count: SKIP, submit_time_utc: SKIP,
               embedded: SKIP, links: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @search_id = search_id unless search_id == SKIP
  @save = save unless save == SKIP
  @name = name unless name == SKIP
  @timezone = timezone unless timezone == SKIP
  @query = query unless query == SKIP
  @offset = offset unless offset == SKIP
  @limit = limit unless limit == SKIP
  @sort = sort unless sort == SKIP
  @count = count unless count == SKIP
  @total_count = total_count unless total_count == SKIP
  @submit_time_utc = submit_time_utc unless submit_time_utc == SKIP
  @embedded = embedded unless embedded == SKIP
  @links = links unless links == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#countInteger

Results for this page, this could be below the limit.

Returns:

  • (Integer)


72
73
74
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 72

def count
  @count
end

#embeddedEmbedded56

Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. Returned by Cybersource for all services.

Returns:



92
93
94
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 92

def embedded
  @embedded
end

#limitInteger

Controls the maximum number of items that may be returned for a single request. The default is 20, the maximum is 2500.

Returns:

  • (Integer)


63
64
65
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 63

def limit
  @limit
end

Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. Returned by Cybersource for all services.

Returns:



100
101
102
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 100

def links
  @links
end

#nameString

Name of this search. When save is set to true, this search is saved with this name.

Returns:

  • (String)


30
31
32
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 30

def name
  @name
end

#offsetInteger

Controls the starting point within the collection of results, which defaults to 0. The first item in the collection is retrieved by setting a zero offset. For example, if you have a collection of 15 items to be retrieved from a resource and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value like this: offset=0 offset=5 offset=10 Note: If an offset larger than the number of results is provided, this will result in no embedded object being returned.

Returns:

  • (Integer)


58
59
60
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 58

def offset
  @offset
end

#queryString

String that contains the filters and variables for which you want to search. For information about supported field-filters and operators, see the [Query Filters]( https://developer.cybersource.com/api/developer-guides/dita-txn-search-det ails-rest-api-dev-guide-102718/txn-search-intro/txn-filtering.html) section of the Transaction Search Developer Guide.

Returns:

  • (String)


44
45
46
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 44

def query
  @query
end

#saveTrueClass | FalseClass

Indicates whether or not you want to save this search request for future use. The options are:

  • true
  • false (default value) If set to true, this field returns searchID in the response. You can use this value to retrieve the details of the saved search.

Returns:

  • (TrueClass | FalseClass)


25
26
27
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 25

def save
  @save
end

#search_idString

An unique identification number assigned by CyberSource to identify each Search request.

Returns:

  • (String)


15
16
17
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 15

def search_id
  @search_id
end

#sortString

A comma separated list of the following form: submitTimeUtc:desc

Returns:

  • (String)


68
69
70
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 68

def sort
  @sort
end

#submit_time_utcString

Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. Returned by Cybersource for all services.

Returns:

  • (String)


84
85
86
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 84

def submit_time_utc
  @submit_time_utc
end

#timezoneString

Merchant’s time zone in ISO standard, using the TZ database format. For example: America/Chicago

Returns:

  • (String)


35
36
37
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 35

def timezone
  @timezone
end

#total_countInteger

Total number of results.

Returns:

  • (Integer)


76
77
78
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 76

def total_count
  @total_count
end

Class Method Details

.from_element(root) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 212

def self.from_element(root)
  search_id = XmlUtilities.from_element(root, 'searchId', String)
  save = XmlUtilities.from_element(root, 'save', TrueClass)
  name = XmlUtilities.from_element(root, 'name', String)
  timezone = XmlUtilities.from_element(root, 'timezone', String)
  query = XmlUtilities.from_element(root, 'query', String)
  offset = XmlUtilities.from_element(root, 'offset', Integer)
  limit = XmlUtilities.from_element(root, 'limit', Integer)
  sort = XmlUtilities.from_element(root, 'sort', String)
  count = XmlUtilities.from_element(root, 'count', Integer)
  total_count = XmlUtilities.from_element(root, 'totalCount', Integer)
  submit_time_utc = XmlUtilities.from_element(root, 'submitTimeUtc', String)
  embedded = XmlUtilities.from_element(root, 'Embedded56', Embedded56)
  links = XmlUtilities.from_element(root, 'Links1', Links1)

  new(search_id: search_id,
      save: save,
      name: name,
      timezone: timezone,
      query: query,
      offset: offset,
      limit: limit,
      sort: sort,
      count: count,
      total_count: total_count,
      submit_time_utc: submit_time_utc,
      embedded: embedded,
      links: links,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 169

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  search_id = hash.key?('searchId') ? hash['searchId'] : SKIP
  save = hash.key?('save') ? hash['save'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  timezone = hash.key?('timezone') ? hash['timezone'] : SKIP
  query = hash.key?('query') ? hash['query'] : SKIP
  offset = hash.key?('offset') ? hash['offset'] : SKIP
  limit = hash.key?('limit') ? hash['limit'] : SKIP
  sort = hash.key?('sort') ? hash['sort'] : SKIP
  count = hash.key?('count') ? hash['count'] : SKIP
  total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
  submit_time_utc =
    hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP
  embedded = Embedded56.from_hash(hash['_embedded']) if hash['_embedded']
  links = Links1.from_hash(hash['_links']) if hash['_links']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  TssV2TransactionsPost201Response.new(search_id: search_id,
                                       save: save,
                                       name: name,
                                       timezone: timezone,
                                       query: query,
                                       offset: offset,
                                       limit: limit,
                                       sort: sort,
                                       count: count,
                                       total_count: total_count,
                                       submit_time_utc: submit_time_utc,
                                       embedded: embedded,
                                       links: links,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 103

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['search_id'] = 'searchId'
  @_hash['save'] = 'save'
  @_hash['name'] = 'name'
  @_hash['timezone'] = 'timezone'
  @_hash['query'] = 'query'
  @_hash['offset'] = 'offset'
  @_hash['limit'] = 'limit'
  @_hash['sort'] = 'sort'
  @_hash['count'] = 'count'
  @_hash['total_count'] = 'totalCount'
  @_hash['submit_time_utc'] = 'submitTimeUtc'
  @_hash['embedded'] = '_embedded'
  @_hash['links'] = '_links'
  @_hash
end

.nullablesObject

An array for nullable fields



141
142
143
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 141

def self.nullables
  []
end

.optionalsObject

An array for optional fields



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 122

def self.optionals
  %w[
    search_id
    save
    name
    timezone
    query
    offset
    limit
    sort
    count
    total_count
    submit_time_utc
    embedded
    links
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



277
278
279
280
281
282
283
284
285
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 277

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} search_id: #{@search_id.inspect}, save: #{@save.inspect}, name:"\
  " #{@name.inspect}, timezone: #{@timezone.inspect}, query: #{@query.inspect}, offset:"\
  " #{@offset.inspect}, limit: #{@limit.inspect}, sort: #{@sort.inspect}, count:"\
  " #{@count.inspect}, total_count: #{@total_count.inspect}, submit_time_utc:"\
  " #{@submit_time_utc.inspect}, embedded: #{@embedded.inspect}, links: #{@links.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



267
268
269
270
271
272
273
274
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 267

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} search_id: #{@search_id}, save: #{@save}, name: #{@name}, timezone:"\
  " #{@timezone}, query: #{@query}, offset: #{@offset}, limit: #{@limit}, sort: #{@sort},"\
  " count: #{@count}, total_count: #{@total_count}, submit_time_utc: #{@submit_time_utc},"\
  " embedded: #{@embedded}, links: #{@links}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/cyber_source_merged_spec/models/tss_v2_transactions_post201_response.rb', line 243

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'searchId', search_id)
  XmlUtilities.add_as_subelement(doc, root, 'save', save)
  XmlUtilities.add_as_subelement(doc, root, 'name', name)
  XmlUtilities.add_as_subelement(doc, root, 'timezone', timezone)
  XmlUtilities.add_as_subelement(doc, root, 'query', query)
  XmlUtilities.add_as_subelement(doc, root, 'offset', offset)
  XmlUtilities.add_as_subelement(doc, root, 'limit', limit)
  XmlUtilities.add_as_subelement(doc, root, 'sort', sort)
  XmlUtilities.add_as_subelement(doc, root, 'count', count)
  XmlUtilities.add_as_subelement(doc, root, 'totalCount', total_count)
  XmlUtilities.add_as_subelement(doc, root, 'submitTimeUtc',
                                 submit_time_utc)
  XmlUtilities.add_as_subelement(doc, root, 'Embedded56', embedded)
  XmlUtilities.add_as_subelement(doc, root, 'Links1', links)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end