Class: MistApi::WebhookPingEvent
- Defined in:
- lib/mist_api/models/webhook_ping_event.rb
Overview
WebhookPingEvent Model.
Instance Attribute Summary collapse
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#name ⇒ String
Unique ID of the object instance in the Mist Organization.
-
#site_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#timestamp ⇒ Float
Epoch (seconds).
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(id = nil, name = nil, site_id = nil, timestamp = nil) ⇒ WebhookPingEvent
constructor
A new instance of WebhookPingEvent.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(id = nil, name = nil, site_id = nil, timestamp = nil) ⇒ WebhookPingEvent
Returns a new instance of WebhookPingEvent.
48 49 50 51 52 53 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 48 def initialize(id = nil, name = nil, site_id = nil, = nil) @id = id @name = name @site_id = site_id @timestamp = end |
Instance Attribute Details
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
14 15 16 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 14 def id @id end |
#name ⇒ String
Unique ID of the object instance in the Mist Organization
18 19 20 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 18 def name @name end |
#site_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
22 23 24 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 22 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
26 27 28 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 26 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil name = hash.key?('name') ? hash['name'] : nil site_id = hash.key?('site_id') ? hash['site_id'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil # Create object from extracted values. WebhookPingEvent.new(id, name, site_id, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['site_id'] = 'site_id' @_hash['timestamp'] = 'timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 39 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 74 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.site_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value., ->(val) { val.instance_of? Float }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['site_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['timestamp'], ->(val) { val.instance_of? Float }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, site_id: #{@site_id.inspect},"\ " timestamp: #{@timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 |
# File 'lib/mist_api/models/webhook_ping_event.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, name: #{@name}, site_id: #{@site_id}, timestamp:"\ " #{@timestamp}>" end |