Class: Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb,
sig/stigg/models/v1/events/beta/customer_retrieve_governance_response.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(data:, pagination:) ⇒ Object

Paginated list of governance tree nodes, each with its usage configuration and current usage.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 29

class Data < Stigg::Internal::Type::BaseModel
  # @!attribute cadence
  #   Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`,
  #   `PT1M`; `null` when the node has no usage configuration.
  #
  #   @return [String, nil]
  required :cadence, String, nil?: true

  # @!attribute current_usage
  #   Usage consumed in the current cadence period (may lag the live counter by a
  #   short interval).
  #
  #   @return [Float, nil]
  required :current_usage, Float, api_name: :currentUsage, nil?: true

  # @!attribute display_name
  #   Human-readable name of the entity, or null when none is set (display the entity
  #   id instead).
  #
  #   @return [String, nil]
  required :display_name, String, api_name: :displayName, nil?: true

  # @!attribute entity_id
  #   External id of the entity at this node.
  #
  #   @return [String]
  required :entity_id, String, api_name: :entityId

  # @!attribute entity_type_id
  #   External id of the entity type (e.g. `team`, `user`).
  #
  #   @return [String]
  required :entity_type_id, String, api_name: :entityTypeId

  # @!attribute parent_id
  #   External id of the parent entity in the tree. `null` means the entity is either
  #   a root or not yet placed in the hierarchy — placement rides on an assignment, so
  #   an entity with no limits set has no parent yet. Both render at the top level;
  #   use it to rebuild the tree.
  #
  #   @return [String, nil]
  required :parent_id, String, api_name: :parentId, nil?: true

  # @!attribute scope_entity_ids
  #   The configuration scope (entity ids). Empty is the node-wide configuration; a
  #   non-empty set is a dimension-scoped sub-configuration.
  #
  #   @return [Array<String>]
  required :scope_entity_ids, Stigg::Internal::Type::ArrayOf[String], api_name: :scopeEntityIds

  # @!attribute usage_limit
  #   Hard usage limit for this node per cadence period.
  #
  #   @return [Float, nil]
  required :usage_limit, Float, api_name: :usageLimit, nil?: true

  # @!attribute usage_period_end
  #   Exclusive end of the cadence period in progress now — when usage resets. `null`
  #   when the node has no usage configuration, or when a stored cadence cannot be
  #   parsed.
  #
  #   @return [Time, nil]
  required :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true

  # @!attribute usage_period_start
  #   Start of the cadence period in progress now, derived from the cadence and the
  #   assignment anchor — it stays correct across a rollover. `null` when the node has
  #   no usage configuration, or when a stored cadence cannot be parsed.
  #
  #   @return [Time, nil]
  required :usage_period_start, Time, api_name: :usagePeriodStart, nil?: true

  # @!attribute utilization
  #   `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The
  #   cross-capability-safe sort key.
  #
  #   @return [Float, nil]
  required :utilization, Float, nil?: true

  # @!attribute currency_id
  #   The metered currency ID (present when the configured capability is a credit
  #   currency).
  #
  #   @return [String, nil]
  optional :currency_id, String, api_name: :currencyId

  # @!attribute feature_id
  #   The metered feature ID (present when the configured capability is a feature).
  #
  #   @return [String, nil]
  optional :feature_id, String, api_name: :featureId

  # @!method initialize(cadence:, current_usage:, display_name:, entity_id:, entity_type_id:, parent_id:, scope_entity_ids:, usage_limit:, usage_period_end:, usage_period_start:, utilization:, currency_id: nil, feature_id: nil)
  #   Some parameter documentations has been truncated, see
  #   {Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data} for
  #   more details.
  #
  #   A node of the governance hierarchy tree with its usage configuration (limit,
  #   cadence, scope) and current usage. Usage is read from a periodically-refreshed
  #   read model and may lag the live counter by a short interval; it never gates
  #   access.
  #
  #   @param cadence [String, nil] Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`, `PT
  #
  #   @param current_usage [Float, nil] Usage consumed in the current cadence period (may lag the live counter by a shor
  #
  #   @param display_name [String, nil] Human-readable name of the entity, or null when none is set (display the entity
  #
  #   @param entity_id [String] External id of the entity at this node.
  #
  #   @param entity_type_id [String] External id of the entity type (e.g. `team`, `user`).
  #
  #   @param parent_id [String, nil] External id of the parent entity in the tree. `null` means the entity is either
  #
  #   @param scope_entity_ids [Array<String>] The configuration scope (entity ids). Empty is the node-wide configuration; a no
  #
  #   @param usage_limit [Float, nil] Hard usage limit for this node per cadence period.
  #
  #   @param usage_period_end [Time, nil] Exclusive end of the cadence period in progress now — when usage resets. `null`
  #
  #   @param usage_period_start [Time, nil] Start of the cadence period in progress now, derived from the cadence and the as
  #
  #   @param utilization [Float, nil] `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The cros
  #
  #   @param currency_id [String] The metered currency ID (present when the configured capability is a credit curr
  #
  #   @param feature_id [String] The metered feature ID (present when the configured capability is a feature).
end

Instance Attribute Details

#cadenceString?

Usage-reset cadence as an ISO-8601 single-unit duration, e.g. P1M, P30D, PT1M; null when the node has no usage configuration.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


35
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 35

required :cadence, String, nil?: true

#currency_idString?

The metered currency ID (present when the configured capability is a credit currency).

Parameters:

  • (String)

Returns:

  • (String, nil)


113
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 113

optional :currency_id, String, api_name: :currencyId

#current_usageFloat?

Usage consumed in the current cadence period (may lag the live counter by a short interval).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


42
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 42

required :current_usage, Float, api_name: :currentUsage, nil?: true

#display_nameString?

Human-readable name of the entity, or null when none is set (display the entity id instead).

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


49
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 49

required :display_name, String, api_name: :displayName, nil?: true

#entity_idString

External id of the entity at this node.

Parameters:

  • value (String)

Returns:

  • (String)


55
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 55

required :entity_id, String, api_name: :entityId

#entity_type_idString

External id of the entity type (e.g. team, user).

Parameters:

  • value (String)

Returns:

  • (String)


61
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 61

required :entity_type_id, String, api_name: :entityTypeId

#feature_idString?

The metered feature ID (present when the configured capability is a feature).

Parameters:

  • (String)

Returns:

  • (String, nil)


119
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 119

optional :feature_id, String, api_name: :featureId

#parent_idString?

External id of the parent entity in the tree. null means the entity is either a root or not yet placed in the hierarchy — placement rides on an assignment, so an entity with no limits set has no parent yet. Both render at the top level; use it to rebuild the tree.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


70
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 70

required :parent_id, String, api_name: :parentId, nil?: true

#scope_entity_idsArray<String>

The configuration scope (entity ids). Empty is the node-wide configuration; a non-empty set is a dimension-scoped sub-configuration.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


77
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 77

required :scope_entity_ids, Stigg::Internal::Type::ArrayOf[String], api_name: :scopeEntityIds

#usage_limitFloat?

Hard usage limit for this node per cadence period.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


83
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 83

required :usage_limit, Float, api_name: :usageLimit, nil?: true

#usage_period_endTime?

Exclusive end of the cadence period in progress now — when usage resets. null when the node has no usage configuration, or when a stored cadence cannot be parsed.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


91
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 91

required :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true

#usage_period_startTime?

Start of the cadence period in progress now, derived from the cadence and the assignment anchor — it stays correct across a rollover. null when the node has no usage configuration, or when a stored cadence cannot be parsed.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


99
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 99

required :usage_period_start, Time, api_name: :usagePeriodStart, nil?: true

#utilizationFloat?

currentUsage / usageLimit (1 when usageLimit is 0 — always at limit). The cross-capability-safe sort key.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


106
# File 'lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb', line 106

required :utilization, Float, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


91
# File 'sig/stigg/models/v1/events/beta/customer_retrieve_governance_response.rbs', line 91

def to_hash: -> {