Class: Pago::V2026_04::Models::BenefitCustom
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
A benefit of type custom.
Use it to grant any kind of benefit that doesn't fit in the other types.
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", type: "type", description: "description", selectable: "selectable", deletable: "deletable", is_deleted: "is_deleted", organization_id: "organization_id", metadata: "metadata", visibility: "visibility", properties: "properties", visibility_configurable: "visibility_configurable" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "type", "description", "selectable", "deletable", "is_deleted", "organization_id", "metadata", "visibility", "properties", "visibility_configurable"].freeze
Instance Attribute Summary collapse
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#deletable ⇒ Boolean
readonly
Whether the benefit is deletable.
-
#description ⇒ String
readonly
The description of the benefit.
-
#id ⇒ String
readonly
The ID of the benefit.
-
#is_deleted ⇒ Boolean
readonly
Whether the benefit is deleted.
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#organization_id ⇒ String
readonly
The ID of the organization owning the benefit.
- #properties ⇒ Models::BenefitCustomProperties readonly
-
#selectable ⇒ Boolean
readonly
Whether the benefit is selectable when creating a product.
- #type ⇒ String readonly
- #visibility ⇒ String readonly
- #visibility_configurable ⇒ Boolean readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, metadata:, visibility:, properties:, visibility_configurable:) ⇒ BenefitCustom
constructor
A new instance of BenefitCustom.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, metadata:, visibility:, properties:, visibility_configurable:) ⇒ BenefitCustom
Returns a new instance of BenefitCustom.
2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 |
# File 'lib/pago/v2026_04/models.rb', line 2042 def initialize( id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, metadata:, visibility:, properties:, visibility_configurable: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:type, type) assign(:description, description) assign(:selectable, selectable) assign(:deletable, deletable) assign(:is_deleted, is_deleted) assign(:organization_id, organization_id) assign(:metadata, ) assign(:visibility, visibility) assign(:properties, properties) assign(:visibility_configurable, visibility_configurable) end |
Instance Attribute Details
#created_at ⇒ String (readonly)
Creation timestamp of the object.
2001 2002 2003 |
# File 'lib/pago/v2026_04/models.rb', line 2001 def created_at @created_at end |
#deletable ⇒ Boolean (readonly)
Whether the benefit is deletable.
2020 2021 2022 |
# File 'lib/pago/v2026_04/models.rb', line 2020 def deletable @deletable end |
#description ⇒ String (readonly)
The description of the benefit.
2012 2013 2014 |
# File 'lib/pago/v2026_04/models.rb', line 2012 def description @description end |
#id ⇒ String (readonly)
The ID of the benefit.
1997 1998 1999 |
# File 'lib/pago/v2026_04/models.rb', line 1997 def id @id end |
#is_deleted ⇒ Boolean (readonly)
Whether the benefit is deleted.
2024 2025 2026 |
# File 'lib/pago/v2026_04/models.rb', line 2024 def is_deleted @is_deleted end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
2031 2032 2033 |
# File 'lib/pago/v2026_04/models.rb', line 2031 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
2005 2006 2007 |
# File 'lib/pago/v2026_04/models.rb', line 2005 def modified_at @modified_at end |
#organization_id ⇒ String (readonly)
The ID of the organization owning the benefit.
2028 2029 2030 |
# File 'lib/pago/v2026_04/models.rb', line 2028 def organization_id @organization_id end |
#properties ⇒ Models::BenefitCustomProperties (readonly)
2037 2038 2039 |
# File 'lib/pago/v2026_04/models.rb', line 2037 def properties @properties end |
#selectable ⇒ Boolean (readonly)
Whether the benefit is selectable when creating a product.
2016 2017 2018 |
# File 'lib/pago/v2026_04/models.rb', line 2016 def selectable @selectable end |
#type ⇒ String (readonly)
2008 2009 2010 |
# File 'lib/pago/v2026_04/models.rb', line 2008 def type @type end |
#visibility ⇒ String (readonly)
2034 2035 2036 |
# File 'lib/pago/v2026_04/models.rb', line 2034 def visibility @visibility end |
#visibility_configurable ⇒ Boolean (readonly)
2040 2041 2042 |
# File 'lib/pago/v2026_04/models.rb', line 2040 def visibility_configurable @visibility_configurable end |
Class Method Details
.from_json(data) ⇒ BenefitCustom?
2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 |
# File 'lib/pago/v2026_04/models.rb', line 2075 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), type: (data.key?("type") ? data["type"] : ::Pago::UNSET), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), selectable: (data.key?("selectable") ? data["selectable"] : ::Pago::UNSET), deletable: (data.key?("deletable") ? data["deletable"] : ::Pago::UNSET), is_deleted: (data.key?("is_deleted") ? data["is_deleted"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), visibility: (data.key?("visibility") ? data["visibility"] : ::Pago::UNSET), properties: (data.key?("properties") ? Models::BenefitCustomProperties.from_json(data["properties"]) : ::Pago::UNSET), visibility_configurable: (data.key?("visibility_configurable") ? data["visibility_configurable"] : ::Pago::UNSET) ), data ) end |