Class: ShellDataReportingApIs::EIDDocument
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::EIDDocument
- Defined in:
- lib/shell_data_reporting_ap_is/models/eid_document.rb
Overview
EIDDocument Model.
Instance Attribute Summary collapse
-
#account_group_id ⇒ String
Account Group Id.
-
#account_group_name ⇒ String
Account group name.
-
#document_date ⇒ String
Document date.
-
#document_format ⇒ String
Document format (CHORUS, DIFI etc.).
-
#document_id ⇒ Integer
Technical identifier for the EID file.
-
#document_name ⇒ String
Document file name.
-
#document_status ⇒ String
Document status.
-
#document_type ⇒ String
Document type.
-
#file_size ⇒ Integer
Document size.
-
#number_of_invoices ⇒ Integer
Number of invoices.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(document_id = SKIP, account_group_id = SKIP, account_group_name = SKIP, document_type = SKIP, document_format = SKIP, document_date = SKIP, number_of_invoices = SKIP, file_size = SKIP, document_status = SKIP, document_name = SKIP) ⇒ EIDDocument
constructor
A new instance of EIDDocument.
Methods inherited from BaseModel
Constructor Details
#initialize(document_id = SKIP, account_group_id = SKIP, account_group_name = SKIP, document_type = SKIP, document_format = SKIP, document_date = SKIP, number_of_invoices = SKIP, file_size = SKIP, document_status = SKIP, document_name = SKIP) ⇒ EIDDocument
Returns a new instance of EIDDocument.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 110 def initialize(document_id = SKIP, account_group_id = SKIP, account_group_name = SKIP, document_type = SKIP, document_format = SKIP, document_date = SKIP, number_of_invoices = SKIP, file_size = SKIP, document_status = SKIP, document_name = SKIP) @document_id = document_id unless document_id == SKIP @account_group_id = account_group_id unless account_group_id == SKIP @account_group_name = account_group_name unless account_group_name == SKIP @document_type = document_type unless document_type == SKIP @document_format = document_format unless document_format == SKIP @document_date = document_date unless document_date == SKIP @number_of_invoices = number_of_invoices unless number_of_invoices == SKIP @file_size = file_size unless file_size == SKIP @document_status = document_status unless document_status == SKIP @document_name = document_name unless document_name == SKIP end |
Instance Attribute Details
#account_group_id ⇒ String
Account Group Id
19 20 21 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 19 def account_group_id @account_group_id end |
#account_group_name ⇒ String
Account group name
23 24 25 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 23 def account_group_name @account_group_name end |
#document_date ⇒ String
Document date. Example: 20170101
39 40 41 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 39 def document_date @document_date end |
#document_format ⇒ String
Document format (CHORUS, DIFI etc.)
34 35 36 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 34 def document_format @document_format end |
#document_id ⇒ Integer
Technical identifier for the EID file. Should not be stored in database as it is not guaranteed to stay unchanged over time.
15 16 17 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 15 def document_id @document_id end |
#document_name ⇒ String
Document file name.
60 61 62 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 60 def document_name @document_name end |
#document_status ⇒ String
Document status. Possible values: • NEW • VIEWED • DOWNLOADED • RESTORED
56 57 58 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 56 def document_status @document_status end |
#document_type ⇒ String
Document type. Possible values: • NAT (National) • INT (International)
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 30 def document_type @document_type end |
#file_size ⇒ Integer
Document size
47 48 49 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 47 def file_size @file_size end |
#number_of_invoices ⇒ Integer
Number of invoices
43 44 45 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 43 def number_of_invoices @number_of_invoices end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 128 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. document_id = hash.key?('DocumentId') ? hash['DocumentId'] : SKIP account_group_id = hash.key?('AccountGroupId') ? hash['AccountGroupId'] : SKIP account_group_name = hash.key?('AccountGroupName') ? hash['AccountGroupName'] : SKIP document_type = hash.key?('DocumentType') ? hash['DocumentType'] : SKIP document_format = hash.key?('DocumentFormat') ? hash['DocumentFormat'] : SKIP document_date = hash.key?('DocumentDate') ? hash['DocumentDate'] : SKIP number_of_invoices = hash.key?('NumberOfInvoices') ? hash['NumberOfInvoices'] : SKIP file_size = hash.key?('FileSize') ? hash['FileSize'] : SKIP document_status = hash.key?('DocumentStatus') ? hash['DocumentStatus'] : SKIP document_name = hash.key?('DocumentName') ? hash['DocumentName'] : SKIP # Create object from extracted values. EIDDocument.new(document_id, account_group_id, account_group_name, document_type, document_format, document_date, number_of_invoices, file_size, document_status, document_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 63 def self.names @_hash = {} if @_hash.nil? @_hash['document_id'] = 'DocumentId' @_hash['account_group_id'] = 'AccountGroupId' @_hash['account_group_name'] = 'AccountGroupName' @_hash['document_type'] = 'DocumentType' @_hash['document_format'] = 'DocumentFormat' @_hash['document_date'] = 'DocumentDate' @_hash['number_of_invoices'] = 'NumberOfInvoices' @_hash['file_size'] = 'FileSize' @_hash['document_status'] = 'DocumentStatus' @_hash['document_name'] = 'DocumentName' @_hash end |
.nullables ⇒ Object
An array for nullable fields
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 95 def self.nullables %w[ document_id account_group_id account_group_name document_type document_format document_date number_of_invoices file_size document_status document_name ] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/shell_data_reporting_ap_is/models/eid_document.rb', line 79 def self.optionals %w[ document_id account_group_id account_group_name document_type document_format document_date number_of_invoices file_size document_status document_name ] end |