Class: PostWorkspacesBodyWorkspace

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



27695
27696
27697
27698
27699
27700
27701
27702
# File 'lib/schemas.rb', line 27695

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    description:                         d["description"],
    post_workspaces_body_workspace_name: d.fetch("name"),
    post_workspaces_body_workspace_type: d.fetch("type"),
  )
end

.from_json!(json) ⇒ Object



27704
27705
27706
# File 'lib/schemas.rb', line 27704

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

Instance Method Details

#to_dynamicObject



27708
27709
27710
27711
27712
27713
27714
# File 'lib/schemas.rb', line 27708

def to_dynamic
  {
    "description" => description,
    "name"        => post_workspaces_body_workspace_name,
    "type"        => post_workspaces_body_workspace_type,
  }
end

#to_json(options = nil) ⇒ Object



27716
27717
27718
# File 'lib/schemas.rb', line 27716

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