Class: PostCollectionsCollectionIDRequestsResponseData

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



21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
# File 'lib/schemas.rb', line 21020

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    collection:                                                 d["collection"],
    created_at:                                                 d["createdAt"],
    folder:                                                     d["folder"],
    id:                                                         d["id"],
    last_updated_by:                                            d["lastUpdatedBy"],
    post_collections_collection_id_requests_response_data_name: d["name"],
    owner:                                                      d["owner"],
    responses:                                                  d["responses"],
    responses_order:                                            d["responses_order"],
    updated_at:                                                 d["updatedAt"],
  )
end

.from_json!(json) ⇒ Object



21036
21037
21038
# File 'lib/schemas.rb', line 21036

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

Instance Method Details

#to_dynamicObject



21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
# File 'lib/schemas.rb', line 21040

def to_dynamic
  {
    "collection"      => collection,
    "createdAt"       => created_at,
    "folder"          => folder,
    "id"              => id,
    "lastUpdatedBy"   => last_updated_by,
    "name"            => post_collections_collection_id_requests_response_data_name,
    "owner"           => owner,
    "responses"       => responses,
    "responses_order" => responses_order,
    "updatedAt"       => updated_at,
  }
end

#to_json(options = nil) ⇒ Object



21055
21056
21057
# File 'lib/schemas.rb', line 21055

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