stigg 0.1.0.pre.beta.59 → 0.1.0.pre.beta.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/stigg/models/v1/credits/reservation_release_response.rb +1 -0
  5. data/lib/stigg/models/v1/customer_check_entitlement_response.rb +1 -0
  6. data/lib/stigg/models/v1/customer_retrieve_entitlements_response.rb +1 -0
  7. data/lib/stigg/models/v1/events/beta/customer_retrieve_governance_params.rb +23 -14
  8. data/lib/stigg/models/v1/events/beta/customer_retrieve_governance_response.rb +9 -1
  9. data/lib/stigg/models/v1/subscription_provision_response.rb +1 -0
  10. data/lib/stigg/models/v1_beta/customers/assignment_upsert_params.rb +2 -1
  11. data/lib/stigg/models/v1_beta/customers/entitlement_check_response.rb +1 -0
  12. data/lib/stigg/models/v1_beta/customers/governance_list_params.rb +180 -0
  13. data/lib/stigg/models/v1_beta/customers/governance_list_response.rb +138 -0
  14. data/lib/stigg/resources/v1/events/beta/customers.rb +8 -5
  15. data/lib/stigg/resources/v1_beta/customers/governance.rb +100 -0
  16. data/lib/stigg/resources/v1_beta/customers.rb +4 -0
  17. data/lib/stigg/version.rb +1 -1
  18. data/lib/stigg.rb +3 -0
  19. data/rbi/stigg/models/v1/credits/reservation_release_response.rbi +5 -0
  20. data/rbi/stigg/models/v1/customer_check_entitlement_response.rbi +5 -0
  21. data/rbi/stigg/models/v1/customer_retrieve_entitlements_response.rbi +5 -0
  22. data/rbi/stigg/models/v1/events/beta/customer_retrieve_governance_params.rbi +31 -18
  23. data/rbi/stigg/models/v1/events/beta/customer_retrieve_governance_response.rbi +18 -3
  24. data/rbi/stigg/models/v1/subscription_provision_response.rbi +5 -0
  25. data/rbi/stigg/models/v1_beta/customers/assignment_upsert_params.rbi +4 -2
  26. data/rbi/stigg/models/v1_beta/customers/entitlement_check_response.rbi +5 -0
  27. data/rbi/stigg/models/v1_beta/customers/governance_list_params.rbi +378 -0
  28. data/rbi/stigg/models/v1_beta/customers/governance_list_response.rbi +176 -0
  29. data/rbi/stigg/resources/v1/events/beta/customers.rbi +13 -7
  30. data/rbi/stigg/resources/v1_beta/customers/governance.rbi +95 -0
  31. data/rbi/stigg/resources/v1_beta/customers.rbi +3 -0
  32. data/sig/stigg/models/v1/credits/reservation_release_response.rbs +2 -1
  33. data/sig/stigg/models/v1/customer_check_entitlement_response.rbs +2 -1
  34. data/sig/stigg/models/v1/customer_retrieve_entitlements_response.rbs +2 -1
  35. data/sig/stigg/models/v1/events/beta/customer_retrieve_governance_params.rbs +7 -0
  36. data/sig/stigg/models/v1/events/beta/customer_retrieve_governance_response.rbs +5 -3
  37. data/sig/stigg/models/v1/subscription_provision_response.rbs +2 -1
  38. data/sig/stigg/models/v1_beta/customers/entitlement_check_response.rbs +2 -1
  39. data/sig/stigg/models/v1_beta/customers/governance_list_params.rbs +171 -0
  40. data/sig/stigg/models/v1_beta/customers/governance_list_response.rbs +88 -0
  41. data/sig/stigg/resources/v1/events/beta/customers.rbs +1 -0
  42. data/sig/stigg/resources/v1_beta/customers/governance.rbs +29 -0
  43. data/sig/stigg/resources/v1_beta/customers.rbs +2 -0
  44. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b110182dabf0144099cb775786f7cbd2c23130d8f7cbf652dc23bdeb7b91aa8e
4
- data.tar.gz: baab0f7102a3d40e12a398e22bf0b745c295d359455857541fff9a0457c0bb97
3
+ metadata.gz: f4df7ce34a642b404fc2611ff28b9f890a05ee5bf3c429cd2a7f20f4941559e8
4
+ data.tar.gz: 642be85db9effde32debffe25dbd4662b8182bf8eb00d3056e0e1a44c225af5b
5
5
  SHA512:
6
- metadata.gz: 9a274dfef112b685dad6a6fcd69a966a446defcdfe554d5ce12d3f5b4e831a92a33ce6165307bd1920a640a446bf991dad0abad6f3c57266ed29342ce2016ead
7
- data.tar.gz: 67f5d938b25e4aa07a3ce4ada5e8bfde9789c3a639dbf116ebf1e860281693d60a4ef8794327b20dc846c6a23f31acc083568da11be5d9c6610791531379470c
6
+ metadata.gz: cf248127d326fba3fc53e55b12dc66353d1a7fcb6a433a5ee4a11884ac3880f2ef30027089b93fd03bcfffa8d093cc94d4b97795c7182da369f638552c58bf60
7
+ data.tar.gz: b22a07fc1cfff5757ee17c667e16640a6285bd65094595c40543a29b08db5ae9f46afe80a4d8d9f7d3c9ec02766fb2a964362f02a8f1d3283ddb70075f1cfb89
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.0-beta.60](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.59...v0.1.0-beta.60) (2026-10-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **STIGG-10529:** governance query as paginated v1Beta.customers.governance.list ([2fc1286](https://github.com/stiggio/stigg-ruby/commit/2fc128611f63f6d1f9796f809ce0e544e3180a2b))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * sync OpenAPI spec from stigg-api ([52f3751](https://github.com/stiggio/stigg-ruby/commit/52f37510727f8e194121d9a25653604b5fc5effd))
14
+ * sync OpenAPI spec from stigg-api ([a9f365b](https://github.com/stiggio/stigg-ruby/commit/a9f365b4575f6fcf1533b41ab8fa6ce7cb4a6572))
15
+ * sync OpenAPI spec from stigg-api ([02707c8](https://github.com/stiggio/stigg-ruby/commit/02707c8c8d471921155cfcc15e5ab95088fa32c3))
16
+ * sync OpenAPI spec from stigg-api ([38173fc](https://github.com/stiggio/stigg-ruby/commit/38173fc2c35268bfcd3e85cc0520a542cc567b3f))
17
+
18
+
19
+ ### Chores
20
+
21
+ * normalize version.rb to gem prerelease format for stlc codegen ([9071057](https://github.com/stiggio/stigg-ruby/commit/9071057684924855f38983cc91fca3f9095af8fc))
22
+
3
23
  ## [0.1.0-beta.59](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.58...v0.1.0-beta.59) (2026-10-22)
4
24
 
5
25
 
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "stigg", "~> 0.1.0.pre.beta.58"
27
+ gem "stigg", "~> 0.1.0.pre.beta.59"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -152,6 +152,7 @@ module Stigg
152
152
 
153
153
  ACTIVE = :ACTIVE
154
154
  RELEASED = :RELEASED
155
+ EXPIRED = :EXPIRED
155
156
 
156
157
  # @!method self.values
157
158
  # @return [Array<Symbol>]
@@ -485,6 +485,7 @@ module Stigg
485
485
 
486
486
  ACTIVE = :ACTIVE
487
487
  RELEASED = :RELEASED
488
+ EXPIRED = :EXPIRED
488
489
 
489
490
  # @!method self.values
490
491
  # @return [Array<Symbol>]
@@ -527,6 +527,7 @@ module Stigg
527
527
 
528
528
  ACTIVE = :ACTIVE
529
529
  RELEASED = :RELEASED
530
+ EXPIRED = :EXPIRED
530
531
 
531
532
  # @!method self.values
532
533
  # @return [Array<Symbol>]
@@ -16,14 +16,22 @@ module Stigg
16
16
  required :id, String
17
17
 
18
18
  # @!attribute after
19
- # Return items that come after this cursor
19
+ # Opaque cursor from a page’s `next`; returns the page after it. Mutually
20
+ # exclusive with `before`.
20
21
  #
21
22
  # @return [String, nil]
22
23
  optional :after, String
23
24
 
25
+ # @!attribute before
26
+ # Opaque cursor from a page’s `prev`; returns the page before it. Mutually
27
+ # exclusive with `after`.
28
+ #
29
+ # @return [String, nil]
30
+ optional :before, String
31
+
24
32
  # @!attribute currency_ids
25
- # Currency ids to include, repeated per value (e.g. `?currencyIds=credits`). Omit
26
- # both featureIds and currencyIds for tree mode.
33
+ # Currency ids to include, comma-separated (e.g. `?currencyIds=credits`), up
34
+ # to 100. Omit both featureIds and currencyIds for tree mode.
27
35
  #
28
36
  # @return [Array<String>, nil]
29
37
  optional :currency_ids, Stigg::Internal::Type::ArrayOf[String]
@@ -36,17 +44,16 @@ module Stigg
36
44
  optional :entity_id_search, String
37
45
 
38
46
  # @!attribute entity_type_ids
39
- # Filter to one or more entity types, repeated per value (e.g.
40
- # `?entityTypeIds=team&entityTypeIds=user`).
47
+ # Filter to one or more entity types, comma-separated (e.g.
48
+ # `?entityTypeIds=team,user`), up to 100.
41
49
  #
42
50
  # @return [Array<String>, nil]
43
51
  optional :entity_type_ids, Stigg::Internal::Type::ArrayOf[String]
44
52
 
45
53
  # @!attribute feature_ids
46
- # Feature ids to include, repeated per value (e.g.
47
- # `?featureIds=ai-tokens&featureIds=seats`). Omit both featureIds and currencyIds
48
- # for tree mode — every node in the hierarchy with no usage configuration
49
- # attached.
54
+ # Feature ids to include, comma-separated (e.g. `?featureIds=ai-tokens,seats`), up
55
+ # to 100. Omit both featureIds and currencyIds for tree mode — every node in the
56
+ # hierarchy with no usage configuration attached.
50
57
  #
51
58
  # @return [Array<String>, nil]
52
59
  optional :feature_ids, Stigg::Internal::Type::ArrayOf[String]
@@ -94,22 +101,24 @@ module Stigg
94
101
  # @return [String, nil]
95
102
  optional :x_environment_id, String
96
103
 
97
- # @!method initialize(id:, after: nil, currency_ids: nil, entity_id_search: nil, entity_type_ids: nil, feature_ids: nil, limit: nil, min_utilization: nil, order: nil, scope: nil, sort_by: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
104
+ # @!method initialize(id:, after: nil, before: nil, currency_ids: nil, entity_id_search: nil, entity_type_ids: nil, feature_ids: nil, limit: nil, min_utilization: nil, order: nil, scope: nil, sort_by: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
98
105
  # Some parameter documentations has been truncated, see
99
106
  # {Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceParams} for more
100
107
  # details.
101
108
  #
102
109
  # @param id [String]
103
110
  #
104
- # @param after [String] Return items that come after this cursor
111
+ # @param after [String] Opaque cursor from a page’s `next`; returns the page after it. Mutually exclusiv
112
+ #
113
+ # @param before [String] Opaque cursor from a page’s `prev`; returns the page before it. Mutually exclusi
105
114
  #
106
- # @param currency_ids [Array<String>] Currency ids to include, repeated per value (e.g. `?currencyIds=credits`). Omit
115
+ # @param currency_ids [Array<String>] Currency ids to include, comma-separated (e.g. `?currencyIds=credits`), up to 10
107
116
  #
108
117
  # @param entity_id_search [String] Case-insensitive substring match on the entity id or its display name (`%`/`_` m
109
118
  #
110
- # @param entity_type_ids [Array<String>] Filter to one or more entity types, repeated per value (e.g. `?entityTypeIds=tea
119
+ # @param entity_type_ids [Array<String>] Filter to one or more entity types, comma-separated (e.g. `?entityTypeIds=team,u
111
120
  #
112
- # @param feature_ids [Array<String>] Feature ids to include, repeated per value (e.g. `?featureIds=ai-tokens&featureI
121
+ # @param feature_ids [Array<String>] Feature ids to include, comma-separated (e.g. `?featureIds=ai-tokens,seats`), up
113
122
  #
114
123
  # @param limit [Integer] Maximum number of items to return
115
124
  #
@@ -164,12 +164,20 @@ module Stigg
164
164
  # @return [String, nil]
165
165
  required :next_, String, api_name: :next, nil?: true
166
166
 
167
- # @!method initialize(next_:)
167
+ # @!attribute prev
168
+ # Cursor for fetching the previous page of results, or null if at the beginning
169
+ #
170
+ # @return [String, nil]
171
+ required :prev, String, nil?: true
172
+
173
+ # @!method initialize(next_:, prev:)
168
174
  # Some parameter documentations has been truncated, see
169
175
  # {Stigg::Models::V1::Events::Beta::CustomerRetrieveGovernanceResponse::Pagination}
170
176
  # for more details.
171
177
  #
172
178
  # @param next_ [String, nil] Cursor for fetching the next page of results, or null if no additional pages exi
179
+ #
180
+ # @param prev [String, nil] Cursor for fetching the previous page of results, or null if at the beginning
173
181
  end
174
182
  end
175
183
  end
@@ -571,6 +571,7 @@ module Stigg
571
571
 
572
572
  ACTIVE = :ACTIVE
573
573
  RELEASED = :RELEASED
574
+ EXPIRED = :EXPIRED
574
575
 
575
576
  # @!method self.values
576
577
  # @return [Array<Symbol>]
@@ -72,7 +72,8 @@ module Stigg
72
72
  # @!attribute parent_id
73
73
  # Parent entity ID in the hierarchy. Omit to leave the current parent untouched (a
74
74
  # new node defaults to a root); `null` detaches to a root; an ID sets or changes
75
- # the parent. Reparenting an existing node is leaf-only.
75
+ # the parent. Reparenting or detaching an existing node is leaf-only; place a
76
+ # parent before its children, or in the same batch.
76
77
  #
77
78
  # @return [String, nil]
78
79
  optional :parent_id, String, api_name: :parentId, nil?: true
@@ -629,6 +629,7 @@ module Stigg
629
629
 
630
630
  ACTIVE = :ACTIVE
631
631
  RELEASED = :RELEASED
632
+ EXPIRED = :EXPIRED
632
633
 
633
634
  # @!method self.values
634
635
  # @return [Array<Symbol>]
@@ -0,0 +1,180 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1Beta
6
+ module Customers
7
+ # @see Stigg::Resources::V1Beta::Customers::Governance#list
8
+ class GovernanceListParams < Stigg::Internal::Type::BaseModel
9
+ extend Stigg::Internal::Type::RequestParameters::Converter
10
+ include Stigg::Internal::Type::RequestParameters
11
+
12
+ # @!attribute id
13
+ #
14
+ # @return [String]
15
+ required :id, String
16
+
17
+ # @!attribute after
18
+ # Opaque cursor from a page’s `next`; returns the page after it. Mutually
19
+ # exclusive with `before`.
20
+ #
21
+ # @return [String, nil]
22
+ optional :after, String
23
+
24
+ # @!attribute before
25
+ # Opaque cursor from a page’s `prev`; returns the page before it. Mutually
26
+ # exclusive with `after`.
27
+ #
28
+ # @return [String, nil]
29
+ optional :before, String
30
+
31
+ # @!attribute currency_ids
32
+ # Currency ids to include, comma-separated (e.g. `?currencyIds=credits`), up
33
+ # to 100. Omit both featureIds and currencyIds for tree mode.
34
+ #
35
+ # @return [Array<String>, nil]
36
+ optional :currency_ids, Stigg::Internal::Type::ArrayOf[String]
37
+
38
+ # @!attribute entity_id_search
39
+ # Case-insensitive substring match on the entity id or its display name (`%`/`_`
40
+ # matched literally).
41
+ #
42
+ # @return [String, nil]
43
+ optional :entity_id_search, String
44
+
45
+ # @!attribute entity_type_ids
46
+ # Filter to one or more entity types, comma-separated (e.g.
47
+ # `?entityTypeIds=team,user`), up to 100.
48
+ #
49
+ # @return [Array<String>, nil]
50
+ optional :entity_type_ids, Stigg::Internal::Type::ArrayOf[String]
51
+
52
+ # @!attribute feature_ids
53
+ # Feature ids to include, comma-separated (e.g. `?featureIds=ai-tokens,seats`), up
54
+ # to 100. Omit both featureIds and currencyIds for tree mode — every node in the
55
+ # hierarchy with no usage configuration attached.
56
+ #
57
+ # @return [Array<String>, nil]
58
+ optional :feature_ids, Stigg::Internal::Type::ArrayOf[String]
59
+
60
+ # @!attribute limit
61
+ # Maximum number of items to return
62
+ #
63
+ # @return [Integer, nil]
64
+ optional :limit, Integer
65
+
66
+ # @!attribute min_utilization
67
+ # Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for at/over
68
+ # limit).
69
+ #
70
+ # @return [Float, nil]
71
+ optional :min_utilization, Float
72
+
73
+ # @!attribute order
74
+ # Sort direction: `asc` or `desc` (default `desc`).
75
+ #
76
+ # @return [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::Order, nil]
77
+ optional :order, enum: -> { Stigg::V1Beta::Customers::GovernanceListParams::Order }
78
+
79
+ # @!attribute scope
80
+ # Filter by configuration scope: `all` (default), `nodeWide` (`[]` only), or
81
+ # `scoped` (non-empty only).
82
+ #
83
+ # @return [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::Scope, nil]
84
+ optional :scope, enum: -> { Stigg::V1Beta::Customers::GovernanceListParams::Scope }
85
+
86
+ # @!attribute sort_by
87
+ # Sort key: `utilization` (default, cross-capability-safe), `currentUsage`,
88
+ # `usageLimit`, `scopeSize`, `id`, or `createdAt`.
89
+ #
90
+ # @return [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::SortBy, nil]
91
+ optional :sort_by, enum: -> { Stigg::V1Beta::Customers::GovernanceListParams::SortBy }
92
+
93
+ # @!attribute x_account_id
94
+ #
95
+ # @return [String, nil]
96
+ optional :x_account_id, String
97
+
98
+ # @!attribute x_environment_id
99
+ #
100
+ # @return [String, nil]
101
+ optional :x_environment_id, String
102
+
103
+ # @!method initialize(id:, after: nil, before: nil, currency_ids: nil, entity_id_search: nil, entity_type_ids: nil, feature_ids: nil, limit: nil, min_utilization: nil, order: nil, scope: nil, sort_by: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
104
+ # Some parameter documentations has been truncated, see
105
+ # {Stigg::Models::V1Beta::Customers::GovernanceListParams} for more details.
106
+ #
107
+ # @param id [String]
108
+ #
109
+ # @param after [String] Opaque cursor from a page’s `next`; returns the page after it. Mutually exclusiv
110
+ #
111
+ # @param before [String] Opaque cursor from a page’s `prev`; returns the page before it. Mutually exclusi
112
+ #
113
+ # @param currency_ids [Array<String>] Currency ids to include, comma-separated (e.g. `?currencyIds=credits`), up to 10
114
+ #
115
+ # @param entity_id_search [String] Case-insensitive substring match on the entity id or its display name (`%`/`_` m
116
+ #
117
+ # @param entity_type_ids [Array<String>] Filter to one or more entity types, comma-separated (e.g. `?entityTypeIds=team,u
118
+ #
119
+ # @param feature_ids [Array<String>] Feature ids to include, comma-separated (e.g. `?featureIds=ai-tokens,seats`), up
120
+ #
121
+ # @param limit [Integer] Maximum number of items to return
122
+ #
123
+ # @param min_utilization [Float] Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for at/over limit
124
+ #
125
+ # @param order [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::Order] Sort direction: `asc` or `desc` (default `desc`).
126
+ #
127
+ # @param scope [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::Scope] Filter by configuration scope: `all` (default), `nodeWide` (`[]` only), or `scop
128
+ #
129
+ # @param sort_by [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::SortBy] Sort key: `utilization` (default, cross-capability-safe), `currentUsage`, `usage
130
+ #
131
+ # @param x_account_id [String]
132
+ #
133
+ # @param x_environment_id [String]
134
+ #
135
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
136
+
137
+ # Sort direction: `asc` or `desc` (default `desc`).
138
+ module Order
139
+ extend Stigg::Internal::Type::Enum
140
+
141
+ ASC = :asc
142
+ DESC = :desc
143
+
144
+ # @!method self.values
145
+ # @return [Array<Symbol>]
146
+ end
147
+
148
+ # Filter by configuration scope: `all` (default), `nodeWide` (`[]` only), or
149
+ # `scoped` (non-empty only).
150
+ module Scope
151
+ extend Stigg::Internal::Type::Enum
152
+
153
+ ALL = :all
154
+ NODE_WIDE = :nodeWide
155
+ SCOPED = :scoped
156
+
157
+ # @!method self.values
158
+ # @return [Array<Symbol>]
159
+ end
160
+
161
+ # Sort key: `utilization` (default, cross-capability-safe), `currentUsage`,
162
+ # `usageLimit`, `scopeSize`, `id`, or `createdAt`.
163
+ module SortBy
164
+ extend Stigg::Internal::Type::Enum
165
+
166
+ UTILIZATION = :utilization
167
+ CURRENT_USAGE = :currentUsage
168
+ USAGE_LIMIT = :usageLimit
169
+ SCOPE_SIZE = :scopeSize
170
+ ID = :id
171
+ CREATED_AT = :createdAt
172
+
173
+ # @!method self.values
174
+ # @return [Array<Symbol>]
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end
180
+ end
@@ -0,0 +1,138 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1Beta
6
+ module Customers
7
+ # @see Stigg::Resources::V1Beta::Customers::Governance#list
8
+ class GovernanceListResponse < Stigg::Internal::Type::BaseModel
9
+ # @!attribute cadence
10
+ # Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`,
11
+ # `PT1M`; `null` when the node has no usage configuration.
12
+ #
13
+ # @return [String, nil]
14
+ required :cadence, String, nil?: true
15
+
16
+ # @!attribute current_usage
17
+ # Usage consumed in the current cadence period (may lag the live counter by a
18
+ # short interval).
19
+ #
20
+ # @return [Float, nil]
21
+ required :current_usage, Float, api_name: :currentUsage, nil?: true
22
+
23
+ # @!attribute display_name
24
+ # Human-readable name of the entity, or null when none is set (display the entity
25
+ # id instead).
26
+ #
27
+ # @return [String, nil]
28
+ required :display_name, String, api_name: :displayName, nil?: true
29
+
30
+ # @!attribute entity_id
31
+ # External id of the entity at this node.
32
+ #
33
+ # @return [String]
34
+ required :entity_id, String, api_name: :entityId
35
+
36
+ # @!attribute entity_type_id
37
+ # External id of the entity type (e.g. `team`, `user`).
38
+ #
39
+ # @return [String]
40
+ required :entity_type_id, String, api_name: :entityTypeId
41
+
42
+ # @!attribute parent_id
43
+ # External id of the parent entity in the tree. `null` means the entity is either
44
+ # a root or not yet placed in the hierarchy — placement rides on an assignment, so
45
+ # an entity with no limits set has no parent yet. Both render at the top level;
46
+ # use it to rebuild the tree.
47
+ #
48
+ # @return [String, nil]
49
+ required :parent_id, String, api_name: :parentId, nil?: true
50
+
51
+ # @!attribute scope_entity_ids
52
+ # The configuration scope (entity ids). Empty is the node-wide configuration; a
53
+ # non-empty set is a dimension-scoped sub-configuration.
54
+ #
55
+ # @return [Array<String>]
56
+ required :scope_entity_ids, Stigg::Internal::Type::ArrayOf[String], api_name: :scopeEntityIds
57
+
58
+ # @!attribute usage_limit
59
+ # Hard usage limit for this node per cadence period.
60
+ #
61
+ # @return [Float, nil]
62
+ required :usage_limit, Float, api_name: :usageLimit, nil?: true
63
+
64
+ # @!attribute usage_period_end
65
+ # Exclusive end of the cadence period in progress now — when usage resets. `null`
66
+ # when the node has no usage configuration, or when a stored cadence cannot be
67
+ # parsed.
68
+ #
69
+ # @return [Time, nil]
70
+ required :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true
71
+
72
+ # @!attribute usage_period_start
73
+ # Start of the cadence period in progress now, derived from the cadence and the
74
+ # assignment anchor — it stays correct across a rollover. `null` when the node has
75
+ # no usage configuration, or when a stored cadence cannot be parsed.
76
+ #
77
+ # @return [Time, nil]
78
+ required :usage_period_start, Time, api_name: :usagePeriodStart, nil?: true
79
+
80
+ # @!attribute utilization
81
+ # `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The
82
+ # cross-capability-safe sort key.
83
+ #
84
+ # @return [Float, nil]
85
+ required :utilization, Float, nil?: true
86
+
87
+ # @!attribute currency_id
88
+ # The metered currency ID (present when the configured capability is a credit
89
+ # currency).
90
+ #
91
+ # @return [String, nil]
92
+ optional :currency_id, String, api_name: :currencyId
93
+
94
+ # @!attribute feature_id
95
+ # The metered feature ID (present when the configured capability is a feature).
96
+ #
97
+ # @return [String, nil]
98
+ optional :feature_id, String, api_name: :featureId
99
+
100
+ # @!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)
101
+ # Some parameter documentations has been truncated, see
102
+ # {Stigg::Models::V1Beta::Customers::GovernanceListResponse} for more details.
103
+ #
104
+ # A node of the governance hierarchy tree with its usage configuration (limit,
105
+ # cadence, scope) and current usage. Usage is read from a periodically-refreshed
106
+ # read model and may lag the live counter by a short interval; it never gates
107
+ # access.
108
+ #
109
+ # @param cadence [String, nil] Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`, `PT
110
+ #
111
+ # @param current_usage [Float, nil] Usage consumed in the current cadence period (may lag the live counter by a shor
112
+ #
113
+ # @param display_name [String, nil] Human-readable name of the entity, or null when none is set (display the entity
114
+ #
115
+ # @param entity_id [String] External id of the entity at this node.
116
+ #
117
+ # @param entity_type_id [String] External id of the entity type (e.g. `team`, `user`).
118
+ #
119
+ # @param parent_id [String, nil] External id of the parent entity in the tree. `null` means the entity is either
120
+ #
121
+ # @param scope_entity_ids [Array<String>] The configuration scope (entity ids). Empty is the node-wide configuration; a no
122
+ #
123
+ # @param usage_limit [Float, nil] Hard usage limit for this node per cadence period.
124
+ #
125
+ # @param usage_period_end [Time, nil] Exclusive end of the cadence period in progress now — when usage resets. `null`
126
+ #
127
+ # @param usage_period_start [Time, nil] Start of the cadence period in progress now, derived from the cadence and the as
128
+ #
129
+ # @param utilization [Float, nil] `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The cros
130
+ #
131
+ # @param currency_id [String] The metered currency ID (present when the configured capability is a credit curr
132
+ #
133
+ # @param feature_id [String] The metered feature ID (present when the configured capability is a feature).
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
@@ -16,19 +16,21 @@ module Stigg
16
16
  # tree can be rebuilt client-side. Usage is read from a periodically-refreshed
17
17
  # read model and never gates access.
18
18
  #
19
- # @overload retrieve_governance(id, after: nil, currency_ids: nil, entity_id_search: nil, entity_type_ids: nil, feature_ids: nil, limit: nil, min_utilization: nil, order: nil, scope: nil, sort_by: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
19
+ # @overload retrieve_governance(id, after: nil, before: nil, currency_ids: nil, entity_id_search: nil, entity_type_ids: nil, feature_ids: nil, limit: nil, min_utilization: nil, order: nil, scope: nil, sort_by: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
20
20
  #
21
21
  # @param id [String] Path param: The customer ID.
22
22
  #
23
- # @param after [String] Query param: Return items that come after this cursor
23
+ # @param after [String] Query param: Opaque cursor from a page’s `next`; returns the page after it. Mutu
24
24
  #
25
- # @param currency_ids [Array<String>] Query param: Currency ids to include, repeated per value (e.g. `?currencyIds=cre
25
+ # @param before [String] Query param: Opaque cursor from a page’s `prev`; returns the page before it. Mut
26
+ #
27
+ # @param currency_ids [Array<String>] Query param: Currency ids to include, comma-separated (e.g. `?currencyIds=credit
26
28
  #
27
29
  # @param entity_id_search [String] Query param: Case-insensitive substring match on the entity id or its display na
28
30
  #
29
- # @param entity_type_ids [Array<String>] Query param: Filter to one or more entity types, repeated per value (e.g. `?enti
31
+ # @param entity_type_ids [Array<String>] Query param: Filter to one or more entity types, comma-separated (e.g. `?entityT
30
32
  #
31
- # @param feature_ids [Array<String>] Query param: Feature ids to include, repeated per value (e.g. `?featureIds=ai-to
33
+ # @param feature_ids [Array<String>] Query param: Feature ids to include, comma-separated (e.g. `?featureIds=ai-token
32
34
  #
33
35
  # @param limit [Integer] Query param: Maximum number of items to return
34
36
  #
@@ -53,6 +55,7 @@ module Stigg
53
55
  query_params =
54
56
  [
55
57
  :after,
58
+ :before,
56
59
  :currency_ids,
57
60
  :entity_id_search,
58
61
  :entity_type_ids,
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Resources
5
+ class V1Beta
6
+ class Customers
7
+ class Governance
8
+ # Some parameter documentations has been truncated, see
9
+ # {Stigg::Models::V1Beta::Customers::GovernanceListParams} for more details.
10
+ #
11
+ # Queries the customer's governance hierarchy tree, returning a cursor-paginated
12
+ # list of nodes with their usage configuration (limit, cadence, scope) and current
13
+ # usage, sortable and filterable by usage. Each node carries `parentId` so the
14
+ # tree can be rebuilt client-side. Usage is read from a periodically-refreshed
15
+ # read model and never gates access.
16
+ #
17
+ # @overload list(id, after: nil, before: nil, currency_ids: nil, entity_id_search: nil, entity_type_ids: nil, feature_ids: nil, limit: nil, min_utilization: nil, order: nil, scope: nil, sort_by: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
18
+ #
19
+ # @param id [String] Path param: The customer ID.
20
+ #
21
+ # @param after [String] Query param: Opaque cursor from a page’s `next`; returns the page after it. Mutu
22
+ #
23
+ # @param before [String] Query param: Opaque cursor from a page’s `prev`; returns the page before it. Mut
24
+ #
25
+ # @param currency_ids [Array<String>] Query param: Currency ids to include, comma-separated (e.g. `?currencyIds=credit
26
+ #
27
+ # @param entity_id_search [String] Query param: Case-insensitive substring match on the entity id or its display na
28
+ #
29
+ # @param entity_type_ids [Array<String>] Query param: Filter to one or more entity types, comma-separated (e.g. `?entityT
30
+ #
31
+ # @param feature_ids [Array<String>] Query param: Feature ids to include, comma-separated (e.g. `?featureIds=ai-token
32
+ #
33
+ # @param limit [Integer] Query param: Maximum number of items to return
34
+ #
35
+ # @param min_utilization [Float] Query param: Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for
36
+ #
37
+ # @param order [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::Order] Query param: Sort direction: `asc` or `desc` (default `desc`).
38
+ #
39
+ # @param scope [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::Scope] Query param: Filter by configuration scope: `all` (default), `nodeWide` (`[]` on
40
+ #
41
+ # @param sort_by [Symbol, Stigg::Models::V1Beta::Customers::GovernanceListParams::SortBy] Query param: Sort key: `utilization` (default, cross-capability-safe), `currentU
42
+ #
43
+ # @param x_account_id [String] Header param: Account ID — optional when authenticating with a user JWT (Bearer
44
+ #
45
+ # @param x_environment_id [String] Header param: Environment ID — required when authenticating with a user JWT (Bea
46
+ #
47
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
48
+ #
49
+ # @return [Stigg::Internal::MyCursorIDPage<Stigg::Models::V1Beta::Customers::GovernanceListResponse>]
50
+ #
51
+ # @see Stigg::Models::V1Beta::Customers::GovernanceListParams
52
+ def list(id, params = {})
53
+ query_params =
54
+ [
55
+ :after,
56
+ :before,
57
+ :currency_ids,
58
+ :entity_id_search,
59
+ :entity_type_ids,
60
+ :feature_ids,
61
+ :limit,
62
+ :min_utilization,
63
+ :order,
64
+ :scope,
65
+ :sort_by
66
+ ]
67
+ parsed, options = Stigg::V1Beta::Customers::GovernanceListParams.dump_request(params)
68
+ query = Stigg::Internal::Util.encode_query_params(parsed.slice(*query_params))
69
+ @client.request(
70
+ method: :get,
71
+ path: ["api/v1-beta/customers/%1$s/governance", id],
72
+ query: query.transform_keys(
73
+ currency_ids: "currencyIds",
74
+ entity_id_search: "entityIdSearch",
75
+ entity_type_ids: "entityTypeIds",
76
+ feature_ids: "featureIds",
77
+ min_utilization: "minUtilization",
78
+ sort_by: "sortBy"
79
+ ),
80
+ headers: parsed.except(*query_params).transform_keys(
81
+ x_account_id: "x-account-id",
82
+ x_environment_id: "x-environment-id"
83
+ ),
84
+ page: Stigg::Internal::MyCursorIDPage,
85
+ model: Stigg::Models::V1Beta::Customers::GovernanceListResponse,
86
+ options: options
87
+ )
88
+ end
89
+
90
+ # @api private
91
+ #
92
+ # @param client [Stigg::Client]
93
+ def initialize(client:)
94
+ @client = client
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end