Class: GetMonitorsResponseMonitorsItem

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



13036
13037
13038
13039
13040
13041
13042
13043
13044
# File 'lib/schemas.rb', line 13036

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id:                                       d["id"],
    get_monitors_response_monitors_item_name: d["name"],
    owner:                                    d["owner"],
    uid:                                      d["uid"],
  )
end

.from_json!(json) ⇒ Object



13046
13047
13048
# File 'lib/schemas.rb', line 13046

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

Instance Method Details

#to_dynamicObject



13050
13051
13052
13053
13054
13055
13056
13057
# File 'lib/schemas.rb', line 13050

def to_dynamic
  {
    "id"    => id,
    "name"  => get_monitors_response_monitors_item_name,
    "owner" => owner,
    "uid"   => uid,
  }
end

#to_json(options = nil) ⇒ Object



13059
13060
13061
# File 'lib/schemas.rb', line 13059

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