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

Defined Under Namespace

Modules: Cadence

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(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) ⇒ Object

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.

Parameters:

  • cadence (Symbol, Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data::Cadence, nil)

    Usage-reset cadence. Currently only ‘MONTH` is supported.

  • current_usage (Float, nil)

    Usage consumed in the current cadence period (may lag the live counter by a shor

  • entity_id (String)

    External id of the entity at this node.

  • entity_type (String)

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

  • parent_id (String, nil)

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

  • scope_entity_ids (Array<String>)

    The configuration scope (entity ids). Empty is the node-wide configuration; a no

  • usage_limit (Float, nil)

    Hard usage limit for this node per cadence period.

  • usage_period_end (Time, nil)

    Exclusive end of the cadence period — when usage resets; ‘null` once the period

  • usage_period_start (Time, nil)

    Start of the cadence period the usage snapshot belongs to; ‘null` once the perio

  • utilization (Float, nil)

    ‘currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The cros

  • currency_id (String) (defaults to: nil)

    The metered currency refId (present when the configured capability is a credit c

  • feature_id (String) (defaults to: nil)

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



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. Currently only `MONTH` is supported.
  #
  #   @return [Symbol, Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data::Cadence, nil]
  required :cadence,
           enum: -> { Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data::Cadence },
           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 [Symbol, Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data::Cadence, nil] Usage-reset cadence. Currently only `MONTH` is supported.
  #
  #   @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).

  # Usage-reset cadence. Currently only `MONTH` is supported.
  #
  # @see Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data#cadence
  module Cadence
    extend Stigg::Internal::Type::Enum

    MONTH = :MONTH

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#cadenceSymbol, ...

Usage-reset cadence. Currently only ‘MONTH` is supported.



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

required :cadence,
enum: -> { Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Data::Cadence },
nil?: true

#currency_idString?

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

Returns:

  • (String, nil)


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

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)


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

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

#entity_idString

External id of the entity at this node.

Returns:

  • (String)


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

required :entity_id, String, api_name: :entityId

#entity_typeString

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

Returns:

  • (String)


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

required :entity_type, String, api_name: :entityType

#feature_idString?

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

Returns:

  • (String, nil)


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

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)


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

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


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

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)


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

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)


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

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)


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

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)


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

required :utilization, Float, nil?: true