Class: GetAuditLogsResponseTrailsItemDataUser

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



6980
6981
6982
6983
6984
6985
6986
6987
6988
# File 'lib/schemas.rb', line 6980

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    email:                                              d["email"],
    id:                                                 d["id"],
    get_audit_logs_response_trails_item_data_user_name: d["name"],
    username:                                           d["username"],
  )
end

.from_json!(json) ⇒ Object



6990
6991
6992
# File 'lib/schemas.rb', line 6990

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



6994
6995
6996
6997
6998
6999
7000
7001
# File 'lib/schemas.rb', line 6994

def to_dynamic
  {
    "email"    => email,
    "id"       => id,
    "name"     => get_audit_logs_response_trails_item_data_user_name,
    "username" => username,
  }
end

#to_json(options = nil) ⇒ Object



7003
7004
7005
# File 'lib/schemas.rb', line 7003

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end