Class: ComplyanceSDK::PurchaseInvoice::PurchaseInvoiceGovernmentStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/complyance_sdk/purchase_invoice/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_id:, country:, environment:, success:, error_code:, error_message:, timestamp:, status:) ⇒ PurchaseInvoiceGovernmentStatus

Returns a new instance of PurchaseInvoiceGovernmentStatus.



38
39
40
41
42
43
44
45
46
47
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 38

def initialize(document_id:, country:, environment:, success:, error_code:, error_message:, timestamp:, status:)
  @document_id = document_id
  @country = country
  @environment = environment
  @success = success
  @error_code = error_code
  @error_message = error_message
  @timestamp = timestamp
  @status = status
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def country
  @country
end

#document_idObject (readonly)

Returns the value of attribute document_id.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def document_id
  @document_id
end

#environmentObject (readonly)

Returns the value of attribute environment.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def environment
  @environment
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def error_message
  @error_message
end

#statusObject (readonly)

Returns the value of attribute status.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def status
  @status
end

#successObject (readonly)

Returns the value of attribute success.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def success
  @success
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



36
37
38
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 36

def timestamp
  @timestamp
end

Class Method Details

.from_h(data) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 49

def self.from_h(data)
  return nil unless data.is_a?(Hash)

  new(
    document_id: ModelHelpers.value_for(data, :documentId),
    country: ModelHelpers.value_for(data, :country),
    environment: ModelHelpers.value_for(data, :environment),
    success: ModelHelpers.value_for(data, :success),
    error_code: ModelHelpers.value_for(data, :errorCode),
    error_message: ModelHelpers.value_for(data, :errorMessage),
    timestamp: ModelHelpers.value_for(data, :timestamp),
    status: ModelHelpers.value_for(data, :status)
  )
end