Class: ShellDataReportingApIs::FeeSummaryResponse

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

Overview

FeeSummaryResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(fee_items_summary = SKIP, request_id = SKIP, error = SKIP) ⇒ FeeSummaryResponse

Returns a new instance of FeeSummaryResponse.



53
54
55
56
57
# File 'lib/shell_data_reporting_ap_is/models/fee_summary_response.rb', line 53

def initialize(fee_items_summary = SKIP, request_id = SKIP, error = SKIP)
  @fee_items_summary = fee_items_summary unless fee_items_summary == SKIP
  @request_id = request_id unless request_id == SKIP
  @error = error unless error == SKIP
end

Instance Attribute Details

#errorErrorStatus

A unique request id in GUID format. The value is written to the Shell API Platform audit log for end to end traceability of a request. If a value is not provided by an API client, then a GUID is automatically populated by the Shell API Platform and returned in the API response.

Returns:



28
29
30
# File 'lib/shell_data_reporting_ap_is/models/fee_summary_response.rb', line 28

def error
  @error
end

#fee_items_summaryArray[FeeItemSummaryAllOf0]

TODO: Write general description for this method

Returns:



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

def fee_items_summary
  @fee_items_summary
end

#request_idString

A unique request id in GUID format. The value is written to the Shell API Platform audit log for end to end traceability of a request. If a value is not provided by an API client, then a GUID is automatically populated by the Shell API Platform and returned in the API response.

Returns:

  • (String)


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

def request_id
  @request_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/shell_data_reporting_ap_is/models/fee_summary_response.rb', line 60

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  fee_items_summary = nil
  unless hash['FeeItemsSummary'].nil?
    fee_items_summary = []
    hash['FeeItemsSummary'].each do |structure|
      fee_items_summary << (FeeItemSummaryAllOf0.from_hash(structure) if structure)
    end
  end

  fee_items_summary = SKIP unless hash.key?('FeeItemsSummary')
  request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
  error = ErrorStatus.from_hash(hash['Error']) if hash['Error']

  # Create object from extracted values.
  FeeSummaryResponse.new(fee_items_summary,
                         request_id,
                         error)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
# File 'lib/shell_data_reporting_ap_is/models/fee_summary_response.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['fee_items_summary'] = 'FeeItemsSummary'
  @_hash['request_id'] = 'RequestId'
  @_hash['error'] = 'Error'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/shell_data_reporting_ap_is/models/fee_summary_response.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    fee_items_summary
    request_id
    error
  ]
end