Class: Pago::V2026_04::Models::MetricDashboardCreate
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema for creating a metrics dashboard.
Constant Summary collapse
- JSON_KEYS =
{ name: "name", metrics: "metrics", organization_id: "organization_id" }.freeze
- REQUIRED_KEYS =
["name"].freeze
Instance Attribute Summary collapse
-
#metrics ⇒ Array<String>
readonly
List of metric slugs to display in this dashboard.
-
#name ⇒ String
readonly
Display name for the dashboard.
-
#organization_id ⇒ String?
readonly
The ID of the organization owning this dashboard.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, metrics: ::Pago::UNSET, organization_id: ::Pago::UNSET) ⇒ MetricDashboardCreate
constructor
A new instance of MetricDashboardCreate.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(name:, metrics: ::Pago::UNSET, organization_id: ::Pago::UNSET) ⇒ MetricDashboardCreate
Returns a new instance of MetricDashboardCreate.
29822 29823 29824 29825 29826 29827 29828 29829 29830 29831 |
# File 'lib/pago/v2026_04/models.rb', line 29822 def initialize( name:, metrics: ::Pago::UNSET, organization_id: ::Pago::UNSET ) super() assign(:name, name) assign(:metrics, metrics) assign(:organization_id, organization_id) end |
Instance Attribute Details
#metrics ⇒ Array<String> (readonly)
List of metric slugs to display in this dashboard.
29816 29817 29818 |
# File 'lib/pago/v2026_04/models.rb', line 29816 def metrics @metrics end |
#name ⇒ String (readonly)
Display name for the dashboard.
29812 29813 29814 |
# File 'lib/pago/v2026_04/models.rb', line 29812 def name @name end |
#organization_id ⇒ String? (readonly)
The ID of the organization owning this dashboard. Required unless you use an organization token.
29820 29821 29822 |
# File 'lib/pago/v2026_04/models.rb', line 29820 def organization_id @organization_id end |
Class Method Details
.from_json(data) ⇒ MetricDashboardCreate?
29835 29836 29837 29838 29839 29840 29841 29842 29843 29844 29845 29846 29847 29848 |
# File 'lib/pago/v2026_04/models.rb', line 29835 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( name: (data.key?("name") ? data["name"] : ::Pago::UNSET), metrics: (data.key?("metrics") ? data["metrics"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET) ), data ) end |