Class: Nfe::InboundSettings
- Inherits:
-
Data
- Object
- Data
- Nfe::InboundSettings
- Defined in:
- lib/nfe/resources/dto/inbound_settings.rb,
sig/nfe/resources/dto/inbound_settings.rbs
Overview
Immutable value object for the inbound auto-fetch settings returned by the
CT-e / inbound NF-e endpoints on api.nfse.io
(+/v2/companies/#id/inbound/(transportation|product)invoices+).
Hand-written (the consulta-cte-v2 generated tree does not expose a clean
settings shape) so the public surface stays small and snake_case.
InboundSettings.from_api maps the API camelCase keys onto the snake_case members, drops
unknown keys, and is nil-tolerant (+from_api(nil)+ returns nil). The raw
payload is preserved in details so callers can read fields the SDK does
not surface yet.
Instance Attribute Summary collapse
-
#automatic_manifesting ⇒ Object
readonly
Returns the value of attribute automatic_manifesting.
-
#created_on ⇒ String?
readonly
Returns the value of attribute created_on.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#environment_sefaz ⇒ String?
readonly
Returns the value of attribute environment_sefaz.
-
#id ⇒ String?
readonly
Returns the value of attribute id.
-
#modified_on ⇒ String?
readonly
Returns the value of attribute modified_on.
-
#start_from_date ⇒ String?
readonly
Returns the value of attribute start_from_date.
-
#start_from_nsu ⇒ Object
readonly
Returns the value of attribute start_from_nsu.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#webhook_version ⇒ Object
readonly
Returns the value of attribute webhook_version.
Class Method Summary collapse
-
.from_api(payload) ⇒ Nfe::InboundSettings?
Build a InboundSettings from an API payload.
- .new ⇒ instance
Instance Method Summary collapse
-
#initialize ⇒ InboundSettings
constructor
A new instance of InboundSettings.
Constructor Details
#initialize ⇒ InboundSettings
Returns a new instance of InboundSettings.
18 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 18
def initialize: (id: String?, status: untyped, start_from_nsu: untyped, start_from_date: String?, environment_sefaz: String?, automatic_manifesting: untyped, webhook_version: untyped, created_on: String?, modified_on: String?, details: untyped) -> void
|
Instance Attribute Details
#automatic_manifesting ⇒ Object (readonly)
Returns the value of attribute automatic_manifesting.
8 9 10 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 8 def automatic_manifesting @automatic_manifesting end |
#created_on ⇒ String? (readonly)
Returns the value of attribute created_on.
10 11 12 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 10 def created_on @created_on end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
12 13 14 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 12 def details @details end |
#environment_sefaz ⇒ String? (readonly)
Returns the value of attribute environment_sefaz.
7 8 9 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 7 def environment_sefaz @environment_sefaz end |
#id ⇒ String? (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 3 def id @id end |
#modified_on ⇒ String? (readonly)
Returns the value of attribute modified_on.
11 12 13 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 11 def modified_on @modified_on end |
#start_from_date ⇒ String? (readonly)
Returns the value of attribute start_from_date.
6 7 8 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 6 def start_from_date @start_from_date end |
#start_from_nsu ⇒ Object (readonly)
Returns the value of attribute start_from_nsu.
5 6 7 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 5 def start_from_nsu @start_from_nsu end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 4 def status @status end |
#webhook_version ⇒ Object (readonly)
Returns the value of attribute webhook_version.
9 10 11 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 9 def webhook_version @webhook_version end |
Class Method Details
.from_api(payload) ⇒ Nfe::InboundSettings?
Build a Nfe::InboundSettings from an API payload.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/nfe/resources/dto/inbound_settings.rb', line 30 def self.from_api(payload) return nil if payload.nil? new( id: payload["id"], status: payload["status"], start_from_nsu: payload["startFromNsu"], start_from_date: payload["startFromDate"], environment_sefaz: payload["environmentSefaz"] || payload["environmentSEFAZ"], automatic_manifesting: payload["automaticManifesting"], webhook_version: payload["webhookVersion"], created_on: payload["createdOn"], modified_on: payload["modifiedOn"], details: payload ) end |
.new ⇒ instance
16 |
# File 'sig/nfe/resources/dto/inbound_settings.rbs', line 16
def self.new: (id: String?, status: untyped, start_from_nsu: untyped, start_from_date: String?, environment_sefaz: String?, automatic_manifesting: untyped, webhook_version: untyped, created_on: String?, modified_on: String?, details: untyped) -> instance
|