Class: CyberSourceMergedSpec::CreateReportSubscriptionRequest

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

Overview

CreateReportSubscriptionRequest 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(report_definition_name:, report_fields:, report_mime_type:, report_frequency:, report_name:, timezone:, start_time:, organization_id: SKIP, report_interval: SKIP, start_day: SKIP, report_filters: SKIP, report_preferences: SKIP, group_name: SKIP, additional_properties: nil) ⇒ CreateReportSubscriptionRequest

Returns a new instance of CreateReportSubscriptionRequest.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 129

def initialize(report_definition_name:, report_fields:, report_mime_type:,
               report_frequency:, report_name:, timezone:, start_time:,
               organization_id: SKIP, report_interval: SKIP,
               start_day: SKIP, report_filters: SKIP,
               report_preferences: SKIP, group_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @organization_id = organization_id unless organization_id == SKIP
  @report_definition_name = report_definition_name
  @report_fields = report_fields
  @report_mime_type = report_mime_type
  @report_frequency = report_frequency
  @report_interval = report_interval unless report_interval == SKIP
  @report_name = report_name
  @timezone = timezone
  @start_time = start_time
  @start_day = start_day unless start_day == SKIP
  @report_filters = report_filters unless report_filters == SKIP
  @report_preferences = report_preferences unless report_preferences == SKIP
  @group_name = group_name unless group_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#group_nameString

Valid GroupName

Returns:

  • (String)


91
92
93
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 91

def group_name
  @group_name
end

#organization_idString

Valid CyberSource organizationId

Returns:

  • (String)


14
15
16
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 14

def organization_id
  @organization_id
end

#report_definition_nameString

Valid Report Definition Name

Returns:

  • (String)


18
19
20
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 18

def report_definition_name
  @report_definition_name
end

#report_fieldsArray[String]

Valid Report Definition Name

Returns:

  • (Array[String])


22
23
24
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 22

def report_fields
  @report_fields
end

#report_filtersHash[String, Object]

List of filters to apply

Returns:

  • (Hash[String, Object])


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

def report_filters
  @report_filters
end

#report_frequencyString

'The frequency for which subscription is created.' NOTE: Do not document USER_DEFINED Frequency field in developer center Valid Values:

- 'DAILY'
- 'WEEKLY'
- 'MONTHLY'
- 'USER_DEFINED'

Returns:

  • (String)


38
39
40
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 38

def report_frequency
  @report_frequency
end

#report_intervalString

If the reportFrequency is User-defined, reportInterval should be in ISO 8601 time format Please refer the following link to know more about ISO 8601 format.Rfc Time Format Example time format for 2 hours and 30 Mins:

  • PT2H30M NOTE: Do not document reportInterval field in developer center

Returns:

  • (String)


48
49
50
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 48

def report_interval
  @report_interval
end

#report_mime_typeString

Valid values:

  • application/xml
  • text/csv

Returns:

  • (String)


28
29
30
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 28

def report_mime_type
  @report_mime_type
end

#report_nameString

If the reportFrequency is User-defined, reportInterval should be in ISO 8601 time format Please refer the following link to know more about ISO 8601 format.Rfc Time Format Example time format for 2 hours and 30 Mins:

  • PT2H30M NOTE: Do not document reportInterval field in developer center

Returns:

  • (String)


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

def report_name
  @report_name
end

#report_preferencesReportPreferences

Report Preferences

Returns:



87
88
89
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 87

def report_preferences
  @report_preferences
end

#start_dayInteger

This is the start day if the frequency is WEEKLY or MONTHLY. The value varies from 1-7 for WEEKLY and 1-31 for MONTHLY. For WEEKLY 1 means Sunday and 7 means Saturday. By default the value is 1.

Returns:

  • (Integer)


79
80
81
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 79

def start_day
  @start_day
end

#start_timeString

The hour at which the report generation should start. It should be in hhmm format.

Returns:

  • (String)


73
74
75
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 73

def start_time
  @start_time
end

#timezoneString

If the reportFrequency is User-defined, reportInterval should be in ISO 8601 time format Please refer the following link to know more about ISO 8601 format.Rfc Time Format Example time format for 2 hours and 30 Mins:

  • PT2H30M NOTE: Do not document reportInterval field in developer center

Returns:

  • (String)


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

def timezone
  @timezone
end

Class Method Details

.from_element(root) ⇒ Object



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

def self.from_element(root)
  report_definition_name = XmlUtilities.from_element(root,
                                                     'reportDefinitionName',
                                                     String)
  report_fields = XmlUtilities.from_element_to_array(root, 'reportFields',
                                                     String)
  report_mime_type = XmlUtilities.from_element(root, 'reportMimeType',
                                               String)
  report_frequency = XmlUtilities.from_element(root, 'reportFrequency',
                                               String)
  report_name = XmlUtilities.from_element(root, 'reportName', String)
  timezone = XmlUtilities.from_element(root, 'timezone', String)
  start_time = XmlUtilities.from_element(root, 'startTime', String)
  organization_id = XmlUtilities.from_element(root, 'organizationId',
                                              String)
  report_interval = XmlUtilities.from_element(root, 'reportInterval',
                                              String)
  start_day = XmlUtilities.from_element(root, 'startDay', Integer)
  report_filters = XmlUtilities.from_element_to_hash(root, 'reportFilters',
                                                     Hash)
  report_preferences = XmlUtilities.from_element(root, 'ReportPreferences',
                                                 ReportPreferences)
  group_name = XmlUtilities.from_element(root, 'groupName', String)

  new(report_definition_name: report_definition_name,
      report_fields: report_fields,
      report_mime_type: report_mime_type,
      report_frequency: report_frequency,
      report_name: report_name,
      timezone: timezone,
      start_time: start_time,
      organization_id: organization_id,
      report_interval: report_interval,
      start_day: start_day,
      report_filters: report_filters,
      report_preferences: report_preferences,
      group_name: group_name,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  report_definition_name =
    hash.key?('reportDefinitionName') ? hash['reportDefinitionName'] : nil
  report_fields = hash.key?('reportFields') ? hash['reportFields'] : nil
  report_mime_type =
    hash.key?('reportMimeType') ? hash['reportMimeType'] : nil
  report_frequency =
    hash.key?('reportFrequency') ? hash['reportFrequency'] : nil
  report_name = hash.key?('reportName') ? hash['reportName'] : nil
  timezone = hash.key?('timezone') ? hash['timezone'] : nil
  start_time = hash.key?('startTime') ? hash['startTime'] : nil
  organization_id =
    hash.key?('organizationId') ? hash['organizationId'] : SKIP
  report_interval =
    hash.key?('reportInterval') ? hash['reportInterval'] : SKIP
  start_day = hash.key?('startDay') ? hash['startDay'] : SKIP
  report_filters = hash.key?('reportFilters') ? hash['reportFilters'] : SKIP
  report_preferences = ReportPreferences.from_hash(hash['reportPreferences']) if
    hash['reportPreferences']
  group_name = hash.key?('groupName') ? hash['groupName'] : 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.
  CreateReportSubscriptionRequest.new(report_definition_name: report_definition_name,
                                      report_fields: report_fields,
                                      report_mime_type: report_mime_type,
                                      report_frequency: report_frequency,
                                      report_name: report_name,
                                      timezone: timezone,
                                      start_time: start_time,
                                      organization_id: organization_id,
                                      report_interval: report_interval,
                                      start_day: start_day,
                                      report_filters: report_filters,
                                      report_preferences: report_preferences,
                                      group_name: group_name,
                                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 94

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['organization_id'] = 'organizationId'
  @_hash['report_definition_name'] = 'reportDefinitionName'
  @_hash['report_fields'] = 'reportFields'
  @_hash['report_mime_type'] = 'reportMimeType'
  @_hash['report_frequency'] = 'reportFrequency'
  @_hash['report_interval'] = 'reportInterval'
  @_hash['report_name'] = 'reportName'
  @_hash['timezone'] = 'timezone'
  @_hash['start_time'] = 'startTime'
  @_hash['start_day'] = 'startDay'
  @_hash['report_filters'] = 'reportFilters'
  @_hash['report_preferences'] = 'reportPreferences'
  @_hash['group_name'] = 'groupName'
  @_hash
end

.nullablesObject

An array for nullable fields



125
126
127
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 125

def self.nullables
  []
end

.optionalsObject

An array for optional fields



113
114
115
116
117
118
119
120
121
122
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 113

def self.optionals
  %w[
    organization_id
    report_interval
    start_day
    report_filters
    report_preferences
    group_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



286
287
288
289
290
291
292
293
294
295
296
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 286

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} organization_id: #{@organization_id.inspect}, report_definition_name:"\
  " #{@report_definition_name.inspect}, report_fields: #{@report_fields.inspect},"\
  " report_mime_type: #{@report_mime_type.inspect}, report_frequency:"\
  " #{@report_frequency.inspect}, report_interval: #{@report_interval.inspect}, report_name:"\
  " #{@report_name.inspect}, timezone: #{@timezone.inspect}, start_time:"\
  " #{@start_time.inspect}, start_day: #{@start_day.inspect}, report_filters:"\
  " #{@report_filters.inspect}, report_preferences: #{@report_preferences.inspect},"\
  " group_name: #{@group_name.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



274
275
276
277
278
279
280
281
282
283
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 274

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} organization_id: #{@organization_id}, report_definition_name:"\
  " #{@report_definition_name}, report_fields: #{@report_fields}, report_mime_type:"\
  " #{@report_mime_type}, report_frequency: #{@report_frequency}, report_interval:"\
  " #{@report_interval}, report_name: #{@report_name}, timezone: #{@timezone}, start_time:"\
  " #{@start_time}, start_day: #{@start_day}, report_filters: #{@report_filters},"\
  " report_preferences: #{@report_preferences}, group_name: #{@group_name},"\
  " 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
265
266
267
268
269
270
271
# File 'lib/cyber_source_merged_spec/models/create_report_subscription_request.rb', line 243

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

  XmlUtilities.add_as_subelement(doc, root, 'reportDefinitionName',
                                 report_definition_name)
  XmlUtilities.add_array_as_subelement(doc, root, 'reportFields',
                                       report_fields)
  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, 'reportName', report_name)
  XmlUtilities.add_as_subelement(doc, root, 'timezone', timezone)
  XmlUtilities.add_as_subelement(doc, root, 'startTime', start_time)
  XmlUtilities.add_as_subelement(doc, root, 'organizationId',
                                 organization_id)
  XmlUtilities.add_as_subelement(doc, root, 'reportInterval',
                                 report_interval)
  XmlUtilities.add_as_subelement(doc, root, 'startDay', start_day)
  XmlUtilities.add_hash_as_subelement(doc, root, 'reportFilters',
                                      report_filters)
  XmlUtilities.add_as_subelement(doc, root, 'ReportPreferences',
                                 report_preferences)
  XmlUtilities.add_as_subelement(doc, root, 'groupName', group_name)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end