Class: ShellDataReportingApIs::InvoiceDistributionMethod

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb

Overview

InvoiceDistributionMethod Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(is_primary = true, frequency_type = SKIP, distribution_method = SKIP, output_type = SKIP) ⇒ InvoiceDistributionMethod

Returns a new instance of InvoiceDistributionMethod.



71
72
73
74
75
76
77
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 71

def initialize(is_primary = true, frequency_type = SKIP,
               distribution_method = SKIP, output_type = SKIP)
  @is_primary = is_primary unless is_primary == SKIP
  @frequency_type = frequency_type unless frequency_type == SKIP
  @distribution_method = distribution_method unless distribution_method == SKIP
  @output_type = output_type unless output_type == SKIP
end

Instance Attribute Details

#distribution_methodString

Invoice Distribution Method (Id-Description) E.g.: 1-e-mail 2-Fax 3-Courier to Customer 4-Courier to Client 5-Print 6-FTP 7-SMS

Returns:

  • (String)


36
37
38
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 36

def distribution_method
  @distribution_method
end

#frequency_typeString

Frequency type unit Id & description E.g.: 1- Daily 2-Weekly 3-Monthly 4-Invoicing 6-Calendar quarter

Returns:

  • (String)


24
25
26
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 24

def frequency_type
  @frequency_type
end

#is_primaryTrueClass | FalseClass

If True then this distribution method is the default distribution method.

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 14

def is_primary
  @is_primary
end

#output_typeString

Invoice output type (Id - Description)

Returns:

  • (String)


40
41
42
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 40

def output_type
  @output_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 80

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_primary = hash['IsPrimary'] ||= true
  frequency_type = hash.key?('FrequencyType') ? hash['FrequencyType'] : SKIP
  distribution_method =
    hash.key?('DistributionMethod') ? hash['DistributionMethod'] : SKIP
  output_type = hash.key?('OutputType') ? hash['OutputType'] : SKIP

  # Create object from extracted values.
  InvoiceDistributionMethod.new(is_primary,
                                frequency_type,
                                distribution_method,
                                output_type)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_primary'] = 'IsPrimary'
  @_hash['frequency_type'] = 'FrequencyType'
  @_hash['distribution_method'] = 'DistributionMethod'
  @_hash['output_type'] = 'OutputType'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
66
67
68
69
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 63

def self.nullables
  %w[
    frequency_type
    distribution_method
    output_type
  ]
end

.optionalsObject

An array for optional fields



53
54
55
56
57
58
59
60
# File 'lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb', line 53

def self.optionals
  %w[
    is_primary
    frequency_type
    distribution_method
    output_type
  ]
end