Class: CyberSourceMergedSpec::ReportSearchResult

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

Overview

Report Search Result Bean

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(link: SKIP, report_definition_id: SKIP, report_name: SKIP, report_mime_type: SKIP, report_frequency: SKIP, status: SKIP, report_start_time: SKIP, report_end_time: SKIP, timezone: SKIP, report_id: SKIP, organization_id: SKIP, queued_time: SKIP, report_generating_time: SKIP, report_completed_time: SKIP, subscription_type: SKIP, group_id: SKIP, additional_properties: nil) ⇒ ReportSearchResult

Returns a new instance of ReportSearchResult.



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

def initialize(link: SKIP, report_definition_id: SKIP, report_name: SKIP,
               report_mime_type: SKIP, report_frequency: SKIP, status: SKIP,
               report_start_time: SKIP, report_end_time: SKIP,
               timezone: SKIP, report_id: SKIP, organization_id: SKIP,
               queued_time: SKIP, report_generating_time: SKIP,
               report_completed_time: SKIP, subscription_type: SKIP,
               group_id: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @link = link unless link == SKIP
  @report_definition_id = report_definition_id unless report_definition_id == SKIP
  @report_name = report_name unless report_name == SKIP
  @report_mime_type = report_mime_type unless report_mime_type == SKIP
  @report_frequency = report_frequency unless report_frequency == SKIP
  @status = status unless status == SKIP
  @report_start_time = report_start_time unless report_start_time == SKIP
  @report_end_time = report_end_time unless report_end_time == SKIP
  @timezone = timezone unless timezone == SKIP
  @report_id = report_id unless report_id == SKIP
  @organization_id = organization_id unless organization_id == SKIP
  @queued_time = queued_time unless queued_time == SKIP
  @report_generating_time = report_generating_time unless report_generating_time == SKIP
  @report_completed_time = report_completed_time unless report_completed_time == SKIP
  @subscription_type = subscription_type unless subscription_type == SKIP
  @group_id = group_id unless group_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#group_idString

Id for selected group.

Returns:

  • (String)


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

def group_id
  @group_id
end

TODO: Write general description for this method

Returns:



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

def link
  @link
end

#organization_idString

CyberSource Merchant Id

Returns:

  • (String)


70
71
72
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 70

def organization_id
  @organization_id
end

#queued_timeDateTime

Specifies the time of the report in queued in ISO 8601 format

Returns:

  • (DateTime)


74
75
76
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 74

def queued_time
  @queued_time
end

#report_completed_timeDateTime

Specifies the time of the report completed the generation in ISO 8601 format

Returns:

  • (DateTime)


83
84
85
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 83

def report_completed_time
  @report_completed_time
end

#report_definition_idString

Unique Report Identifier of each report type

Returns:

  • (String)


19
20
21
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 19

def report_definition_id
  @report_definition_id
end

#report_end_timeDateTime

Specifies the report end time in ISO 8601 format

Returns:

  • (DateTime)


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

def report_end_time
  @report_end_time
end

#report_frequencyString

Frequency of the report to get generated Valid Values:

  • DAILY
  • WEEKLY
  • MONTHLY
  • ADHOC

Returns:

  • (String)


39
40
41
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 39

def report_frequency
  @report_frequency
end

#report_generating_timeDateTime

Specifies the time of the report started to generate in ISO 8601 format

Returns:

  • (DateTime)


78
79
80
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 78

def report_generating_time
  @report_generating_time
end

#report_idString

Unique identifier generated for every reports

Returns:

  • (String)


66
67
68
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 66

def report_id
  @report_id
end

#report_mime_typeString

Format of the report to get generated Valid Values:

  • application/xml
  • text/csv

Returns:

  • (String)


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

def report_mime_type
  @report_mime_type
end

#report_nameString

Name of the report specified by merchant while creating the report

Returns:

  • (String)


23
24
25
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 23

def report_name
  @report_name
end

#report_start_timeDateTime

Specifies the report start time in ISO 8601 format

Returns:

  • (DateTime)


54
55
56
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 54

def report_start_time
  @report_start_time
end

#statusString

Status of the report Valid Values:

  • COMPLETED
  • PENDING
  • QUEUED
  • RUNNING
  • ERROR
  • NO_DATA

Returns:

  • (String)


50
51
52
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 50

def status
  @status
end

#subscription_typeString

Specifies whether the subscription created is either Custom, Standard or Classic

Returns:

  • (String)


88
89
90
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 88

def subscription_type
  @subscription_type
end

#timezoneString

Time Zone

Returns:

  • (String)


62
63
64
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 62

def timezone
  @timezone
end

Class Method Details

.from_element(root) ⇒ Object



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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 266

def self.from_element(root)
  link = XmlUtilities.from_element(root, 'Link', Link)
  report_definition_id = XmlUtilities.from_element(root,
                                                   'reportDefinitionId',
                                                   String)
  report_name = XmlUtilities.from_element(root, 'reportName', String)
  report_mime_type = XmlUtilities.from_element(root, 'reportMimeType',
                                               String)
  report_frequency = XmlUtilities.from_element(root, 'reportFrequency',
                                               String)
  status = XmlUtilities.from_element(root, 'status', String)
  report_start_time = XmlUtilities.from_element(root, 'reportStartTime',
                                                String,
                                                datetime_format: 'rfc3339')
  report_end_time = XmlUtilities.from_element(root, 'reportEndTime', String,
                                              datetime_format: 'rfc3339')
  timezone = XmlUtilities.from_element(root, 'timezone', String)
  report_id = XmlUtilities.from_element(root, 'reportId', String)
  organization_id = XmlUtilities.from_element(root, 'organizationId',
                                              String)
  queued_time = XmlUtilities.from_element(root, 'queuedTime', String,
                                          datetime_format: 'rfc3339')
  report_generating_time = XmlUtilities.from_element(
    root, 'reportGeneratingTime', String,
    datetime_format: 'rfc3339'
  )
  report_completed_time = XmlUtilities.from_element(
    root, 'reportCompletedTime', String,
    datetime_format: 'rfc3339'
  )
  subscription_type = XmlUtilities.from_element(root, 'subscriptionType',
                                                String)
  group_id = XmlUtilities.from_element(root, 'groupId', String)

  new(link: link,
      report_definition_id: report_definition_id,
      report_name: report_name,
      report_mime_type: report_mime_type,
      report_frequency: report_frequency,
      status: status,
      report_start_time: report_start_time,
      report_end_time: report_end_time,
      timezone: timezone,
      report_id: report_id,
      organization_id: organization_id,
      queued_time: queued_time,
      report_generating_time: report_generating_time,
      report_completed_time: report_completed_time,
      subscription_type: subscription_type,
      group_id: group_id,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 173

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  link = Link.from_hash(hash['_link']) if hash['_link']
  report_definition_id =
    hash.key?('reportDefinitionId') ? hash['reportDefinitionId'] : SKIP
  report_name = hash.key?('reportName') ? hash['reportName'] : SKIP
  report_mime_type =
    hash.key?('reportMimeType') ? hash['reportMimeType'] : SKIP
  report_frequency =
    hash.key?('reportFrequency') ? hash['reportFrequency'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  report_start_time = if hash.key?('reportStartTime')
                        (DateTimeHelper.from_rfc3339(hash['reportStartTime']) if hash['reportStartTime'])
                      else
                        SKIP
                      end
  report_end_time = if hash.key?('reportEndTime')
                      (DateTimeHelper.from_rfc3339(hash['reportEndTime']) if hash['reportEndTime'])
                    else
                      SKIP
                    end
  timezone = hash.key?('timezone') ? hash['timezone'] : SKIP
  report_id = hash.key?('reportId') ? hash['reportId'] : SKIP
  organization_id =
    hash.key?('organizationId') ? hash['organizationId'] : SKIP
  queued_time = if hash.key?('queuedTime')
                  (DateTimeHelper.from_rfc3339(hash['queuedTime']) if hash['queuedTime'])
                else
                  SKIP
                end
  report_generating_time = if hash.key?('reportGeneratingTime')
                             (DateTimeHelper.from_rfc3339(hash['reportGeneratingTime']) if hash['reportGeneratingTime'])
                           else
                             SKIP
                           end
  report_completed_time = if hash.key?('reportCompletedTime')
                            (DateTimeHelper.from_rfc3339(hash['reportCompletedTime']) if hash['reportCompletedTime'])
                          else
                            SKIP
                          end
  subscription_type =
    hash.key?('subscriptionType') ? hash['subscriptionType'] : SKIP
  group_id = hash.key?('groupId') ? hash['groupId'] : SKIP

  # 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.
  ReportSearchResult.new(link: link,
                         report_definition_id: report_definition_id,
                         report_name: report_name,
                         report_mime_type: report_mime_type,
                         report_frequency: report_frequency,
                         status: status,
                         report_start_time: report_start_time,
                         report_end_time: report_end_time,
                         timezone: timezone,
                         report_id: report_id,
                         organization_id: organization_id,
                         queued_time: queued_time,
                         report_generating_time: report_generating_time,
                         report_completed_time: report_completed_time,
                         subscription_type: subscription_type,
                         group_id: group_id,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 95

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['link'] = '_link'
  @_hash['report_definition_id'] = 'reportDefinitionId'
  @_hash['report_name'] = 'reportName'
  @_hash['report_mime_type'] = 'reportMimeType'
  @_hash['report_frequency'] = 'reportFrequency'
  @_hash['status'] = 'status'
  @_hash['report_start_time'] = 'reportStartTime'
  @_hash['report_end_time'] = 'reportEndTime'
  @_hash['timezone'] = 'timezone'
  @_hash['report_id'] = 'reportId'
  @_hash['organization_id'] = 'organizationId'
  @_hash['queued_time'] = 'queuedTime'
  @_hash['report_generating_time'] = 'reportGeneratingTime'
  @_hash['report_completed_time'] = 'reportCompletedTime'
  @_hash['subscription_type'] = 'subscriptionType'
  @_hash['group_id'] = 'groupId'
  @_hash
end

.nullablesObject

An array for nullable fields



139
140
141
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 139

def self.nullables
  []
end

.optionalsObject

An array for optional fields



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 117

def self.optionals
  %w[
    link
    report_definition_id
    report_name
    report_mime_type
    report_frequency
    status
    report_start_time
    report_end_time
    timezone
    report_id
    organization_id
    queued_time
    report_generating_time
    report_completed_time
    subscription_type
    group_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 372

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} link: #{@link.inspect}, report_definition_id:"\
  " #{@report_definition_id.inspect}, report_name: #{@report_name.inspect}, report_mime_type:"\
  " #{@report_mime_type.inspect}, report_frequency: #{@report_frequency.inspect}, status:"\
  " #{@status.inspect}, report_start_time: #{@report_start_time.inspect}, report_end_time:"\
  " #{@report_end_time.inspect}, timezone: #{@timezone.inspect}, report_id:"\
  " #{@report_id.inspect}, organization_id: #{@organization_id.inspect}, queued_time:"\
  " #{@queued_time.inspect}, report_generating_time: #{@report_generating_time.inspect},"\
  " report_completed_time: #{@report_completed_time.inspect}, subscription_type:"\
  " #{@subscription_type.inspect}, group_id: #{@group_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_queued_timeObject



254
255
256
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 254

def to_custom_queued_time
  DateTimeHelper.to_rfc3339(queued_time)
end

#to_custom_report_completed_timeObject



262
263
264
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 262

def to_custom_report_completed_time
  DateTimeHelper.to_rfc3339(report_completed_time)
end

#to_custom_report_end_timeObject



250
251
252
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 250

def to_custom_report_end_time
  DateTimeHelper.to_rfc3339(report_end_time)
end

#to_custom_report_generating_timeObject



258
259
260
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 258

def to_custom_report_generating_time
  DateTimeHelper.to_rfc3339(report_generating_time)
end

#to_custom_report_start_timeObject



246
247
248
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 246

def to_custom_report_start_time
  DateTimeHelper.to_rfc3339(report_start_time)
end

#to_sObject

Provides a human-readable string representation of the object.



359
360
361
362
363
364
365
366
367
368
369
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 359

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} link: #{@link}, report_definition_id: #{@report_definition_id},"\
  " report_name: #{@report_name}, report_mime_type: #{@report_mime_type}, report_frequency:"\
  " #{@report_frequency}, status: #{@status}, report_start_time: #{@report_start_time},"\
  " report_end_time: #{@report_end_time}, timezone: #{@timezone}, report_id: #{@report_id},"\
  " organization_id: #{@organization_id}, queued_time: #{@queued_time},"\
  " report_generating_time: #{@report_generating_time}, report_completed_time:"\
  " #{@report_completed_time}, subscription_type: #{@subscription_type}, group_id:"\
  " #{@group_id}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



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
354
355
356
# File 'lib/cyber_source_merged_spec/models/report_search_result.rb', line 319

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

  XmlUtilities.add_as_subelement(doc, root, 'Link', link)
  XmlUtilities.add_as_subelement(doc, root, 'reportDefinitionId',
                                 report_definition_id)
  XmlUtilities.add_as_subelement(doc, root, 'reportName', report_name)
  XmlUtilities.add_as_subelement(doc, root, 'reportMimeType',
                                 report_mime_type)
  XmlUtilities.add_as_subelement(doc, root, 'reportFrequency',
                                 report_frequency)
  XmlUtilities.add_as_subelement(doc, root, 'status', status)
  XmlUtilities.add_as_subelement(doc, root, 'reportStartTime',
                                 report_start_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'reportEndTime',
                                 report_end_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'timezone', timezone)
  XmlUtilities.add_as_subelement(doc, root, 'reportId', report_id)
  XmlUtilities.add_as_subelement(doc, root, 'organizationId',
                                 organization_id)
  XmlUtilities.add_as_subelement(doc, root, 'queuedTime', queued_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'reportGeneratingTime',
                                 report_generating_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'reportCompletedTime',
                                 report_completed_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'subscriptionType',
                                 subscription_type)
  XmlUtilities.add_as_subelement(doc, root, 'groupId', group_id)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end