Class: Pago::V2026_04::Models::CustomFieldDate

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema for a custom field of type date.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  metadata: "metadata",
  type: "type",
  slug: "slug",
  name: "name",
  organization_id: "organization_id",
  properties: "properties"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "metadata", "type", "slug", "name", "organization_id", "properties"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(created_at:, modified_at:, id:, metadata:, type:, slug:, name:, organization_id:, properties:) ⇒ CustomFieldDate

Returns a new instance of CustomFieldDate.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • metadata: (Hash[String, untyped])
  • type: (String)
  • slug: (String)
  • name: (String)
  • organization_id: (String)
  • properties: (Models::CustomFieldDateProperties)


13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
# File 'lib/pago/v2026_04/models.rb', line 13744

def initialize(
  created_at:,
  modified_at:,
  id:,
  metadata:,
  type:,
  slug:,
  name:,
  organization_id:,
  properties:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:metadata, )
  assign(:type, type)
  assign(:slug, slug)
  assign(:name, name)
  assign(:organization_id, organization_id)
  assign(:properties, properties)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


13713
13714
13715
# File 'lib/pago/v2026_04/models.rb', line 13713

def created_at
  @created_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


13721
13722
13723
# File 'lib/pago/v2026_04/models.rb', line 13721

def id
  @id
end

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


13724
13725
13726
# File 'lib/pago/v2026_04/models.rb', line 13724

def 
  @metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


13717
13718
13719
# File 'lib/pago/v2026_04/models.rb', line 13717

def modified_at
  @modified_at
end

#nameString (readonly)

Name of the custom field.

Returns:

  • (String)


13735
13736
13737
# File 'lib/pago/v2026_04/models.rb', line 13735

def name
  @name
end

#organization_idString (readonly)

The ID of the organization owning the custom field.

Returns:

  • (String)


13739
13740
13741
# File 'lib/pago/v2026_04/models.rb', line 13739

def organization_id
  @organization_id
end

#propertiesModels::CustomFieldDateProperties (readonly)



13742
13743
13744
# File 'lib/pago/v2026_04/models.rb', line 13742

def properties
  @properties
end

#slugString (readonly)

Identifier of the custom field. It'll be used as key when storing the value.

Returns:

  • (String)


13731
13732
13733
# File 'lib/pago/v2026_04/models.rb', line 13731

def slug
  @slug
end

#typeString (readonly)

Returns:

  • (String)


13727
13728
13729
# File 'lib/pago/v2026_04/models.rb', line 13727

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomFieldDate?

Parameters:

  • data (Hash, String, nil)

Returns:



13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
# File 'lib/pago/v2026_04/models.rb', line 13769

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      slug: (data.key?("slug") ? data["slug"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::CustomFieldDateProperties.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end