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

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
# 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 entity_id
  #   External id of the entity at this node.
  #
  #   @return [String]
  required :entity_id, String, api_name: :entityId

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

  # @!attribute parent_id
  #   External id of the parent entity in the tree; `null` for a root. 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 — when usage resets; `null` once the period
  #   has rolled over.
  #
  #   @return [Time, nil]
  required :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true

  # @!attribute usage_period_start
  #   Start of the cadence period the usage snapshot belongs to; `null` once the
  #   period has rolled over.
  #
  #   @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 refId (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 refId (present when the configured capability is a feature).
  #
  #   @return [String, nil]
  optional :feature_id, String, api_name: :featureId

  # @!method initialize(cadence:, current_usage:, entity_id:, entity_type:, 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 entity_id [String] External id of the entity at this node.
  #
  #   @param entity_type [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` for a root. Use it to rebui
  #
  #   @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 — when usage resets; `null` once the period
  #
  #   @param usage_period_start [Time, nil] Start of the cadence period the usage snapshot belongs to; `null` once the perio
  #
  #   @param utilization [Float, nil] `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The cros
  #
  #   @param currency_id [String] The metered currency refId (present when the configured capability is a credit c
  #
  #   @param feature_id [String] The metered feature refId (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.

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 refId (present when the configured capability is a credit currency).

Returns:

  • (String, nil)


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

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

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

#entity_idString

External id of the entity at this node.

Returns:

  • (String)


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

required :entity_id, String, api_name: :entityId

#entity_typeString

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

Returns:

  • (String)


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

required :entity_type, String, api_name: :entityType

#feature_idString?

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

Returns:

  • (String, nil)


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

optional :feature_id, String, api_name: :featureId

#parent_idString?

External id of the parent entity in the tree; ‘null` for a root. Use it to rebuild the tree.

Returns:

  • (String, nil)


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

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.

Returns:

  • (Array<String>)


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

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

#usage_limitFloat?

Hard usage limit for this node per cadence period.

Returns:

  • (Float, nil)


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

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

#usage_period_endTime?

Exclusive end of the cadence period — when usage resets; ‘null` once the period has rolled over.

Returns:

  • (Time, nil)


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

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

#usage_period_startTime?

Start of the cadence period the usage snapshot belongs to; ‘null` once the period has rolled over.

Returns:

  • (Time, nil)


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

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.

Returns:

  • (Float, nil)


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

required :utilization, Float, nil?: true