Class: CyberSourceMergedSpec::ReportDefinition

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

Overview

ReportDefinition 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(type: SKIP, report_definition_id: SKIP, report_defintion_name: SKIP, supported_formats: SKIP, description: SKIP, default_settings: SKIP, subscription_type: SKIP, additional_properties: nil) ⇒ ReportDefinition

Returns a new instance of ReportDefinition.



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 206

def initialize(type: SKIP, report_definition_id: SKIP,
               report_defintion_name: SKIP, supported_formats: SKIP,
               description: SKIP, default_settings: SKIP,
               subscription_type: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @type = type unless type == SKIP
  @report_definition_id = report_definition_id unless report_definition_id == SKIP
  @report_defintion_name = report_defintion_name unless report_defintion_name == SKIP
  @supported_formats = supported_formats unless supported_formats == SKIP
  @description = description unless description == SKIP
  @default_settings = default_settings unless default_settings == SKIP
  @subscription_type = subscription_type unless subscription_type == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#default_settingsReportDefinitionDefaultSettings

Id Definition Class
210 TransactionRequestClass
211 PaymentBatchDetailClass
212 ExceptionDetailClass
213 ProcessorSettlementDetailClass
214 ProcessorEventsDetailClass
215 FundingDetailClass
216 AgingDetailClass
217 ChargebackAndRetrievalDetailClass
218 DepositDetailClass
219 FeeDetailClass
220 InvoiceSummaryClass
221 PayerAuthDetailClass
222 ConversionDetailClass
225 BillableTransactionsDetailClass
270 JPTransactionDetailClass
271 ServiceFeeDetailClass
310 GatewayTransactionRequestClass
400 DecisionManagerEventDetailClass
401 DecisionManagerDetailClass
410 FeeSummaryClass
420 TaxCalculationClass
520 POSTerminalExceptionClass
620 SubscriptionDetailClass
630 StandardBillingDataPackageClass
706 StandardMonthlyFeeClass


164
165
166
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 164

def default_settings
  @default_settings
end

#descriptionString

Id Definition Class
210 TransactionRequestClass
211 PaymentBatchDetailClass
212 ExceptionDetailClass
213 ProcessorSettlementDetailClass
214 ProcessorEventsDetailClass
215 FundingDetailClass
216 AgingDetailClass
217 ChargebackAndRetrievalDetailClass
218 DepositDetailClass
219 FeeDetailClass
220 InvoiceSummaryClass
221 PayerAuthDetailClass
222 ConversionDetailClass
225 BillableTransactionsDetailClass
270 JPTransactionDetailClass
271 ServiceFeeDetailClass
310 GatewayTransactionRequestClass
400 DecisionManagerEventDetailClass
401 DecisionManagerDetailClass
410 FeeSummaryClass
420 TaxCalculationClass
520 POSTerminalExceptionClass
620 SubscriptionDetailClass
630 StandardBillingDataPackageClass
706 StandardMonthlyFeeClass

Returns:

  • (String)


134
135
136
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 134

def description
  @description
end

#report_definition_idInteger

Id Definition Class
210 TransactionRequestClass
211 PaymentBatchDetailClass
212 ExceptionDetailClass
213 ProcessorSettlementDetailClass
214 ProcessorEventsDetailClass
215 FundingDetailClass
216 AgingDetailClass
217 ChargebackAndRetrievalDetailClass
218 DepositDetailClass
219 FeeDetailClass
220 InvoiceSummaryClass
221 PayerAuthDetailClass
222 ConversionDetailClass
225 BillableTransactionsDetailClass
270 JPTransactionDetailClass
271 ServiceFeeDetailClass
310 GatewayTransactionRequestClass
400 DecisionManagerEventDetailClass
401 DecisionManagerDetailClass
410 FeeSummaryClass
420 TaxCalculationClass
520 POSTerminalExceptionClass
620 SubscriptionDetailClass
630 StandardBillingDataPackageClass
706 StandardMonthlyFeeClass

Returns:

  • (Integer)


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

def report_definition_id
  @report_definition_id
end

#report_defintion_nameString

Id Definition Class
210 TransactionRequestClass
211 PaymentBatchDetailClass
212 ExceptionDetailClass
213 ProcessorSettlementDetailClass
214 ProcessorEventsDetailClass
215 FundingDetailClass
216 AgingDetailClass
217 ChargebackAndRetrievalDetailClass
218 DepositDetailClass
219 FeeDetailClass
220 InvoiceSummaryClass
221 PayerAuthDetailClass
222 ConversionDetailClass
225 BillableTransactionsDetailClass
270 JPTransactionDetailClass
271 ServiceFeeDetailClass
310 GatewayTransactionRequestClass
400 DecisionManagerEventDetailClass
401 DecisionManagerDetailClass
410 FeeSummaryClass
420 TaxCalculationClass
520 POSTerminalExceptionClass
620 SubscriptionDetailClass
630 StandardBillingDataPackageClass
706 StandardMonthlyFeeClass

Returns:

  • (String)


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

def report_defintion_name
  @report_defintion_name
end

#subscription_typeString

'The subscription type for which report definition is required. By default the type will be CUSTOM.' Valid Values:

  • CLASSIC
  • CUSTOM
  • STANDARD

Returns:

  • (String)


173
174
175
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 173

def subscription_type
  @subscription_type
end

#supported_formatsArray[String]

Id Definition Class
210 TransactionRequestClass
211 PaymentBatchDetailClass
212 ExceptionDetailClass
213 ProcessorSettlementDetailClass
214 ProcessorEventsDetailClass
215 FundingDetailClass
216 AgingDetailClass
217 ChargebackAndRetrievalDetailClass
218 DepositDetailClass
219 FeeDetailClass
220 InvoiceSummaryClass
221 PayerAuthDetailClass
222 ConversionDetailClass
225 BillableTransactionsDetailClass
270 JPTransactionDetailClass
271 ServiceFeeDetailClass
310 GatewayTransactionRequestClass
400 DecisionManagerEventDetailClass
401 DecisionManagerDetailClass
410 FeeSummaryClass
420 TaxCalculationClass
520 POSTerminalExceptionClass
620 SubscriptionDetailClass
630 StandardBillingDataPackageClass
706 StandardMonthlyFeeClass

Returns:

  • (Array[String])


104
105
106
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 104

def supported_formats
  @supported_formats
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



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

def self.from_element(root)
  type = XmlUtilities.from_element(root, 'type', String)
  report_definition_id = XmlUtilities.from_element(root,
                                                   'reportDefinitionId',
                                                   Integer)
  report_defintion_name = XmlUtilities.from_element(root,
                                                    'reportDefintionName',
                                                    String)
  supported_formats = XmlUtilities.from_element_to_array(root,
                                                         'supportedFormats',
                                                         String)
  description = XmlUtilities.from_element(root, 'description', String)
  default_settings = XmlUtilities.from_element(
    root, 'reportDefinitionDefaultSettings',
    ReportDefinitionDefaultSettings
  )
  subscription_type = XmlUtilities.from_element(root, 'subscriptionType',
                                                String)

  new(type: type,
      report_definition_id: report_definition_id,
      report_defintion_name: report_defintion_name,
      supported_formats: supported_formats,
      description: description,
      default_settings: default_settings,
      subscription_type: subscription_type,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



224
225
226
227
228
229
230
231
232
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
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 224

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : SKIP
  report_definition_id =
    hash.key?('reportDefinitionId') ? hash['reportDefinitionId'] : SKIP
  report_defintion_name =
    hash.key?('reportDefintionName') ? hash['reportDefintionName'] : SKIP
  supported_formats =
    hash.key?('supportedFormats') ? hash['supportedFormats'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  default_settings = ReportDefinitionDefaultSettings.from_hash(hash['defaultSettings']) if
    hash['defaultSettings']
  subscription_type =
    hash.key?('subscriptionType') ? hash['subscriptionType'] : 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.
  ReportDefinition.new(type: type,
                       report_definition_id: report_definition_id,
                       report_defintion_name: report_defintion_name,
                       supported_formats: supported_formats,
                       description: description,
                       default_settings: default_settings,
                       subscription_type: subscription_type,
                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



176
177
178
179
180
181
182
183
184
185
186
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 176

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'type'
  @_hash['report_definition_id'] = 'reportDefinitionId'
  @_hash['report_defintion_name'] = 'reportDefintionName'
  @_hash['supported_formats'] = 'supportedFormats'
  @_hash['description'] = 'description'
  @_hash['default_settings'] = 'defaultSettings'
  @_hash['subscription_type'] = 'subscriptionType'
  @_hash
end

.nullablesObject

An array for nullable fields



202
203
204
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 202

def self.nullables
  []
end

.optionalsObject

An array for optional fields



189
190
191
192
193
194
195
196
197
198
199
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 189

def self.optionals
  %w[
    type
    report_definition_id
    report_defintion_name
    supported_formats
    description
    default_settings
    subscription_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



321
322
323
324
325
326
327
328
329
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 321

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type.inspect}, report_definition_id:"\
  " #{@report_definition_id.inspect}, report_defintion_name:"\
  " #{@report_defintion_name.inspect}, supported_formats: #{@supported_formats.inspect},"\
  " description: #{@description.inspect}, default_settings: #{@default_settings.inspect},"\
  " subscription_type: #{@subscription_type.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



311
312
313
314
315
316
317
318
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 311

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type}, report_definition_id: #{@report_definition_id},"\
  " report_defintion_name: #{@report_defintion_name}, supported_formats:"\
  " #{@supported_formats}, description: #{@description}, default_settings:"\
  " #{@default_settings}, subscription_type: #{@subscription_type}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/cyber_source_merged_spec/models/report_definition.rb', line 288

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

  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'reportDefinitionId',
                                 report_definition_id)
  XmlUtilities.add_as_subelement(doc, root, 'reportDefintionName',
                                 report_defintion_name)
  XmlUtilities.add_array_as_subelement(doc, root, 'supportedFormats',
                                       supported_formats)
  XmlUtilities.add_as_subelement(doc, root, 'description', description)
  XmlUtilities.add_as_subelement(doc, root,
                                 'reportDefinitionDefaultSettings',
                                 default_settings)
  XmlUtilities.add_as_subelement(doc, root, 'subscriptionType',
                                 subscription_type)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end