Class: Pago::V2026_04::Models::BenefitGitHubRepositoryUpdate

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

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  metadata: "metadata",
  description: "description",
  type: "type",
  properties: "properties"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["type"].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(metadata: ::Pago::UNSET, description: ::Pago::UNSET, type:, properties: ::Pago::UNSET) ⇒ BenefitGitHubRepositoryUpdate

Returns a new instance of BenefitGitHubRepositoryUpdate.

Parameters:

  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • description: (String, nil) (defaults to: ::Pago::UNSET)
  • type: (String)
  • properties: (Models::BenefitGitHubRepositoryCreateProperties, nil) (defaults to: ::Pago::UNSET)


4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
# File 'lib/pago/v2026_04/models.rb', line 4564

def initialize(
  metadata: ::Pago::UNSET,
  description: ::Pago::UNSET,
  type:,
  properties: ::Pago::UNSET
)
  super()
  assign(:metadata, )
  assign(:description, description)
  assign(:type, type)
  assign(:properties, properties)
end

Instance Attribute Details

#descriptionString? (readonly)

The description of the benefit. Will be displayed on products having this benefit.

Returns:

  • (String, nil)


4556
4557
4558
# File 'lib/pago/v2026_04/models.rb', line 4556

def description
  @description
end

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

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

Returns:

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


4552
4553
4554
# File 'lib/pago/v2026_04/models.rb', line 4552

def 
  @metadata
end

#propertiesModels::BenefitGitHubRepositoryCreateProperties? (readonly)



4562
4563
4564
# File 'lib/pago/v2026_04/models.rb', line 4562

def properties
  @properties
end

#typeString (readonly)

Returns:

  • (String)


4559
4560
4561
# File 'lib/pago/v2026_04/models.rb', line 4559

def type
  @type
end

Class Method Details

.from_json(data) ⇒ BenefitGitHubRepositoryUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
# File 'lib/pago/v2026_04/models.rb', line 4579

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(
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      description: (data.key?("description") ? data["description"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::BenefitGitHubRepositoryCreateProperties.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end