Class: NewStoreApi::RoutingInsightsActivity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::RoutingInsightsActivity
- Defined in:
- lib/new_store_api/models/routing_insights_activity.rb
Overview
RoutingInsightsActivity Model.
Instance Attribute Summary collapse
-
#correlation ⇒ RoutingInsightsCorrelation
Information regarding which entities were affected by this event.
-
#summary ⇒ String
Information regarding the event type.
-
#timestamp ⇒ DateTime
Information regarding the event type.
-
#type ⇒ String
Event type.
-
#value ⇒ Object
Event type.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(correlation = nil, summary = nil, timestamp = nil, type = nil, value = nil) ⇒ RoutingInsightsActivity
constructor
A new instance of RoutingInsightsActivity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_timestamp ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the 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(correlation = nil, summary = nil, timestamp = nil, type = nil, value = nil) ⇒ RoutingInsightsActivity
Returns a new instance of RoutingInsightsActivity.
54 55 56 57 58 59 60 61 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 54 def initialize(correlation = nil, summary = nil, = nil, type = nil, value = nil) @correlation = correlation @summary = summary @timestamp = @type = type @value = value end |
Instance Attribute Details
#correlation ⇒ RoutingInsightsCorrelation
Information regarding which entities were affected by this event
15 16 17 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 15 def correlation @correlation end |
#summary ⇒ String
Information regarding the event type
19 20 21 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 19 def summary @summary end |
#timestamp ⇒ DateTime
Information regarding the event type
23 24 25 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 23 def @timestamp end |
#type ⇒ String
Event type
27 28 29 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 27 def type @type end |
#value ⇒ Object
Event type
31 32 33 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 31 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. correlation = RoutingInsightsCorrelation.from_hash(hash['correlation']) if hash['correlation'] summary = hash.key?('summary') ? hash['summary'] : nil = if hash.key?('timestamp') (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp']) end type = hash.key?('type') ? hash['type'] : nil value = hash.key?('value') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:RoutingInsightsActivityValue), hash['value'] ) : nil # Create object from extracted values. RoutingInsightsActivity.new(correlation, summary, , type, value) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['correlation'] = 'correlation' @_hash['summary'] = 'summary' @_hash['timestamp'] = 'timestamp' @_hash['type'] = 'type' @_hash['value'] = 'value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 45 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 93 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.correlation, ->(val) { RoutingInsightsCorrelation.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value.summary, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value., ->(val) { val.instance_of? DateTime }) and APIHelper.valid_type?(value.type, ->(val) { val.instance_of? String }) and UnionTypeLookUp.get(:RoutingInsightsActivityValue) .validate(value.value) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['correlation'], ->(val) { RoutingInsightsCorrelation.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value['summary'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['timestamp'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['type'], ->(val) { val.instance_of? String }) and UnionTypeLookUp.get(:RoutingInsightsActivityValue) .validate(value['value']) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
135 136 137 138 139 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 135 def inspect class_name = self.class.name.split('::').last "<#{class_name} correlation: #{@correlation.inspect}, summary: #{@summary.inspect},"\ " timestamp: #{@timestamp.inspect}, type: #{@type.inspect}, value: #{@value.inspect}>" end |
#to_custom_timestamp ⇒ Object
87 88 89 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 87 def DateTimeHelper.to_rfc3339() end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
128 129 130 131 132 |
# File 'lib/new_store_api/models/routing_insights_activity.rb', line 128 def to_s class_name = self.class.name.split('::').last "<#{class_name} correlation: #{@correlation}, summary: #{@summary}, timestamp:"\ " #{@timestamp}, type: #{@type}, value: #{@value}>" end |