Class: GetTagsSlugEntitiesResponseDataEntitiesItem

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



16277
16278
16279
16280
16281
16282
16283
# File 'lib/schemas.rb', line 16277

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    entity_id:   d["entityId"],
    entity_type: d["entityType"],
  )
end

.from_json!(json) ⇒ Object



16285
16286
16287
# File 'lib/schemas.rb', line 16285

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

Instance Method Details

#to_dynamicObject



16289
16290
16291
16292
16293
16294
# File 'lib/schemas.rb', line 16289

def to_dynamic
  {
    "entityId"   => entity_id,
    "entityType" => entity_type,
  }
end

#to_json(options = nil) ⇒ Object



16296
16297
16298
# File 'lib/schemas.rb', line 16296

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