Class: Pago::V2026_04::Models::CustomFieldCheckbox

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 checkbox.

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:) ⇒ CustomFieldCheckbox

Returns a new instance of CustomFieldCheckbox.

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::CustomFieldCheckboxProperties)


13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
# File 'lib/pago/v2026_04/models.rb', line 13193

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)


13162
13163
13164
# File 'lib/pago/v2026_04/models.rb', line 13162

def created_at
  @created_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


13170
13171
13172
# File 'lib/pago/v2026_04/models.rb', line 13170

def id
  @id
end

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

Returns:

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


13173
13174
13175
# File 'lib/pago/v2026_04/models.rb', line 13173

def 
  @metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


13166
13167
13168
# File 'lib/pago/v2026_04/models.rb', line 13166

def modified_at
  @modified_at
end

#nameString (readonly)

Name of the custom field.

Returns:

  • (String)


13184
13185
13186
# File 'lib/pago/v2026_04/models.rb', line 13184

def name
  @name
end

#organization_idString (readonly)

The ID of the organization owning the custom field.

Returns:

  • (String)


13188
13189
13190
# File 'lib/pago/v2026_04/models.rb', line 13188

def organization_id
  @organization_id
end

#propertiesModels::CustomFieldCheckboxProperties (readonly)



13191
13192
13193
# File 'lib/pago/v2026_04/models.rb', line 13191

def properties
  @properties
end

#slugString (readonly)

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

Returns:

  • (String)


13180
13181
13182
# File 'lib/pago/v2026_04/models.rb', line 13180

def slug
  @slug
end

#typeString (readonly)

Returns:

  • (String)


13176
13177
13178
# File 'lib/pago/v2026_04/models.rb', line 13176

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomFieldCheckbox?

Parameters:

  • data (Hash, String, nil)

Returns:



13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
# File 'lib/pago/v2026_04/models.rb', line 13218

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::CustomFieldCheckboxProperties.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end