Class: CyberSourceMergedSpec::ReportingV3RetrievalSummariesGet200Response
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::ReportingV3RetrievalSummariesGet200Response
- Defined in:
- lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb
Overview
ReportingV3RetrievalSummariesGet200Response Model.
Instance Attribute Summary collapse
-
#end_time ⇒ String
Report Start Date.
-
#organization_id ⇒ String
Organization Id.
-
#retrieval_summaries ⇒ Array[RetrievalSummary]
List of Summary values.
-
#start_time ⇒ DateTime
Report Start Date.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.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(organization_id: SKIP, start_time: SKIP, end_time: SKIP, retrieval_summaries: SKIP, additional_properties: nil) ⇒ ReportingV3RetrievalSummariesGet200Response
constructor
A new instance of ReportingV3RetrievalSummariesGet200Response.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_start_time ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(organization_id: SKIP, start_time: SKIP, end_time: SKIP, retrieval_summaries: SKIP, additional_properties: nil) ⇒ ReportingV3RetrievalSummariesGet200Response
Returns a new instance of ReportingV3RetrievalSummariesGet200Response.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 54 def initialize(organization_id: SKIP, start_time: SKIP, end_time: SKIP, retrieval_summaries: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @organization_id = organization_id unless organization_id == SKIP @start_time = start_time unless start_time == SKIP @end_time = end_time unless end_time == SKIP @retrieval_summaries = retrieval_summaries unless retrieval_summaries == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#end_time ⇒ String
Report Start Date
23 24 25 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 23 def end_time @end_time end |
#organization_id ⇒ String
Organization Id
15 16 17 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 15 def organization_id @organization_id end |
#retrieval_summaries ⇒ Array[RetrievalSummary]
List of Summary values
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 27 def retrieval_summaries @retrieval_summaries end |
#start_time ⇒ DateTime
Report Start Date
19 20 21 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 19 def start_time @start_time end |
Class Method Details
.from_element(root) ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 109 def self.from_element(root) organization_id = XmlUtilities.from_attribute(root, 'MerchantId', String) start_time = XmlUtilities.from_attribute(root, 'ReportStartDate', String, datetime_format: 'rfc3339') end_time = XmlUtilities.from_attribute(root, 'ReportEndDate', String) retrieval_summaries = XmlUtilities.from_element_to_array(root, 'Request', RetrievalSummary) new(organization_id: organization_id, start_time: start_time, end_time: end_time, retrieval_summaries: retrieval_summaries, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. organization_id = hash.key?('organizationId') ? hash['organizationId'] : SKIP start_time = if hash.key?('startTime') (DateTimeHelper.from_rfc3339(hash['startTime']) if hash['startTime']) else SKIP end end_time = hash.key?('endTime') ? hash['endTime'] : SKIP # Parameter is an array, so we need to iterate through it retrieval_summaries = nil unless hash['retrievalSummaries'].nil? retrieval_summaries = [] hash['retrievalSummaries'].each do |structure| retrieval_summaries << (RetrievalSummary.from_hash(structure) if structure) end end retrieval_summaries = SKIP unless hash.key?('retrievalSummaries') # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ReportingV3RetrievalSummariesGet200Response.new(organization_id: organization_id, start_time: start_time, end_time: end_time, retrieval_summaries: retrieval_summaries, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['organization_id'] = 'organizationId' @_hash['start_time'] = 'startTime' @_hash['end_time'] = 'endTime' @_hash['retrieval_summaries'] = 'retrievalSummaries' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 40 def self.optionals %w[ organization_id start_time end_time retrieval_summaries ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
148 149 150 151 152 153 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 148 def inspect class_name = self.class.name.split('::').last "<#{class_name} organization_id: #{@organization_id.inspect}, start_time:"\ " #{@start_time.inspect}, end_time: #{@end_time.inspect}, retrieval_summaries:"\ " #{@retrieval_summaries.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_start_time ⇒ Object
105 106 107 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 105 def to_custom_start_time DateTimeHelper.to_rfc3339(start_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
140 141 142 143 144 145 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 140 def to_s class_name = self.class.name.split('::').last "<#{class_name} organization_id: #{@organization_id}, start_time: #{@start_time}, end_time:"\ " #{@end_time}, retrieval_summaries: #{@retrieval_summaries}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/cyber_source_merged_spec/models/reporting_v3_retrieval_summaries_get200_response.rb', line 124 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_attribute(root, 'MerchantId', organization_id) XmlUtilities.add_as_attribute(root, 'ReportStartDate', start_time, datetime_format: 'rfc3339') XmlUtilities.add_as_attribute(root, 'ReportEndDate', end_time) XmlUtilities.add_array_as_subelement(doc, root, 'Request', retrieval_summaries) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |