Class: ShellDataReportingApIs::InvoiceDownloadReq

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

Overview

InvoiceDownloadReq Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(col_co_code = nil, payer_number = nil, account_number = SKIP, document_reference = SKIP, invoice_or_soa_number = SKIP) ⇒ InvoiceDownloadReq

Returns a new instance of InvoiceDownloadReq.



66
67
68
69
70
71
72
73
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 66

def initialize(col_co_code = nil, payer_number = nil,  = SKIP,
               document_reference = SKIP, invoice_or_soa_number = SKIP)
  @col_co_code = col_co_code
  @payer_number = payer_number
  @account_number =  unless  == SKIP
  @document_reference = document_reference unless document_reference == SKIP
  @invoice_or_soa_number = invoice_or_soa_number unless invoice_or_soa_number == SKIP
end

Instance Attribute Details

#account_numberArray[String]

List of Account Numbers of the invoices. Mandatory for customer users else optional.

Returns:

  • (Array[String])


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 26

def 
  @account_number
end

#col_co_codeInteger

Collecting Company Code of the selected payer. Mandatory

Returns:

  • (Integer)


15
16
17
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 15

def col_co_code
  @col_co_code
end

#document_referenceArray[Integer]

Unique reference ids of invoice document (of zip file). Optional if InvoiceOrSOANumber is passed else Mandatory.

Returns:

  • (Array[Integer])


31
32
33
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 31

def document_reference
  @document_reference
end

#invoice_or_soa_numberString

Invoice or the SOA document reference number issued by Card s Platform.

Returns:

  • (String)


35
36
37
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 35

def invoice_or_soa_number
  @invoice_or_soa_number
end

#payer_numberString

Payer Number of the selected payer. Mandatory Example: GB000000123

Returns:

  • (String)


21
22
23
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 21

def payer_number
  @payer_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : nil
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : nil
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  document_reference =
    hash.key?('DocumentReference') ? hash['DocumentReference'] : SKIP
  invoice_or_soa_number =
    hash.key?('InvoiceOrSOANumber') ? hash['InvoiceOrSOANumber'] : SKIP

  # Create object from extracted values.
  InvoiceDownloadReq.new(col_co_code,
                         payer_number,
                         ,
                         document_reference,
                         invoice_or_soa_number)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['document_reference'] = 'DocumentReference'
  @_hash['invoice_or_soa_number'] = 'InvoiceOrSOANumber'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
61
62
63
64
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 58

def self.nullables
  %w[
    col_co_code
    payer_number
    invoice_or_soa_number
  ]
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
# File 'lib/shell_data_reporting_ap_is/models/invoice_download_req.rb', line 49

def self.optionals
  %w[
    account_number
    document_reference
    invoice_or_soa_number
  ]
end