Class: MistApi::AuditLog
- Defined in:
- lib/mist_api/models/audit_log.rb
Overview
AuditLog Model.
Instance Attribute Summary collapse
-
#admin_id ⇒ UUID | String
ID of the administrator.
-
#admin_name ⇒ String
ID of the administrator.
-
#after ⇒ Object
Field values after the change.
-
#before ⇒ Object
Field values prior to the change.
-
#for_site ⇒ TrueClass | FalseClass
Field values prior to the change.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#message ⇒ String
Unique ID of the object instance in the Mist Organization.
-
#org_id ⇒ UUID | 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.
Instance Method Summary collapse
-
#initialize(admin_id = nil, admin_name = nil, id = nil, message = nil, org_id = nil, site_id = nil, timestamp = nil, after = SKIP, before = SKIP, for_site = SKIP) ⇒ AuditLog
constructor
A new instance of AuditLog.
-
#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(admin_id = nil, admin_name = nil, id = nil, message = nil, org_id = nil, site_id = nil, timestamp = nil, after = SKIP, before = SKIP, for_site = SKIP) ⇒ AuditLog
Returns a new instance of AuditLog.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/mist_api/models/audit_log.rb', line 82 def initialize(admin_id = nil, admin_name = nil, id = nil, = nil, org_id = nil, site_id = nil, = nil, after = SKIP, before = SKIP, for_site = SKIP) @admin_id = admin_id @admin_name = admin_name @after = after unless after == SKIP @before = before unless before == SKIP @for_site = for_site unless for_site == SKIP @id = id @message = @org_id = org_id @site_id = site_id @timestamp = end |
Instance Attribute Details
#admin_id ⇒ UUID | String
ID of the administrator
14 15 16 |
# File 'lib/mist_api/models/audit_log.rb', line 14 def admin_id @admin_id end |
#admin_name ⇒ String
ID of the administrator
18 19 20 |
# File 'lib/mist_api/models/audit_log.rb', line 18 def admin_name @admin_name end |
#after ⇒ Object
Field values after the change
22 23 24 |
# File 'lib/mist_api/models/audit_log.rb', line 22 def after @after end |
#before ⇒ Object
Field values prior to the change
26 27 28 |
# File 'lib/mist_api/models/audit_log.rb', line 26 def before @before end |
#for_site ⇒ TrueClass | FalseClass
Field values prior to the change
30 31 32 |
# File 'lib/mist_api/models/audit_log.rb', line 30 def for_site @for_site end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
34 35 36 |
# File 'lib/mist_api/models/audit_log.rb', line 34 def id @id end |
#message ⇒ String
Unique ID of the object instance in the Mist Organization
38 39 40 |
# File 'lib/mist_api/models/audit_log.rb', line 38 def @message end |
#org_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
42 43 44 |
# File 'lib/mist_api/models/audit_log.rb', line 42 def org_id @org_id end |
#site_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
46 47 48 |
# File 'lib/mist_api/models/audit_log.rb', line 46 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
50 51 52 |
# File 'lib/mist_api/models/audit_log.rb', line 50 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/mist_api/models/audit_log.rb', line 98 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. admin_id = hash.key?('admin_id') ? hash['admin_id'] : nil admin_name = hash.key?('admin_name') ? hash['admin_name'] : nil id = hash.key?('id') ? hash['id'] : nil = hash.key?('message') ? hash['message'] : nil org_id = hash.key?('org_id') ? hash['org_id'] : nil site_id = hash.key?('site_id') ? hash['site_id'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil after = hash.key?('after') ? hash['after'] : SKIP before = hash.key?('before') ? hash['before'] : SKIP for_site = hash.key?('for_site') ? hash['for_site'] : SKIP # Create object from extracted values. AuditLog.new(admin_id, admin_name, id, , org_id, site_id, , after, before, for_site) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mist_api/models/audit_log.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['admin_id'] = 'admin_id' @_hash['admin_name'] = 'admin_name' @_hash['after'] = 'after' @_hash['before'] = 'before' @_hash['for_site'] = 'for_site' @_hash['id'] = 'id' @_hash['message'] = 'message' @_hash['org_id'] = 'org_id' @_hash['site_id'] = 'site_id' @_hash['timestamp'] = 'timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
78 79 80 |
# File 'lib/mist_api/models/audit_log.rb', line 78 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 |
# File 'lib/mist_api/models/audit_log.rb', line 69 def self.optionals %w[ after before for_site ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
135 136 137 138 139 140 141 |
# File 'lib/mist_api/models/audit_log.rb', line 135 def inspect class_name = self.class.name.split('::').last "<#{class_name} admin_id: #{@admin_id.inspect}, admin_name: #{@admin_name.inspect}, after:"\ " #{@after.inspect}, before: #{@before.inspect}, for_site: #{@for_site.inspect}, id:"\ " #{@id.inspect}, message: #{@message.inspect}, org_id: #{@org_id.inspect}, site_id:"\ " #{@site_id.inspect}, timestamp: #{@timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
127 128 129 130 131 132 |
# File 'lib/mist_api/models/audit_log.rb', line 127 def to_s class_name = self.class.name.split('::').last "<#{class_name} admin_id: #{@admin_id}, admin_name: #{@admin_name}, after: #{@after},"\ " before: #{@before}, for_site: #{@for_site}, id: #{@id}, message: #{@message}, org_id:"\ " #{@org_id}, site_id: #{@site_id}, timestamp: #{@timestamp}>" end |