smplkit 2.0.12 → 2.0.13

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/api/flag_sources_api.rb +4 -4
  3. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/api/flags_api.rb +28 -28
  4. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/api/functions_api.rb +2 -2
  5. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/api/usage_api.rb +2 -2
  6. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag.rb +40 -10
  7. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_item.rb +34 -9
  8. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_request.rb +2 -0
  9. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_response.rb +2 -0
  10. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_environment.rb +4 -0
  11. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_list_response.rb +1 -0
  12. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_request.rb +165 -0
  13. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_resource.rb +1 -0
  14. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_response.rb +1 -0
  15. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_rule.rb +3 -0
  16. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_source.rb +65 -13
  17. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_source_list_response.rb +1 -0
  18. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_source_resource.rb +1 -0
  19. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_value.rb +2 -0
  20. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/manual_review_item.rb +5 -0
  21. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/remove_references_attributes.rb +4 -0
  22. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/remove_references_request.rb +3 -0
  23. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/remove_references_result_envelope.rb +1 -0
  24. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/remove_references_result_resource.rb +1 -0
  25. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/usage_attributes.rb +4 -0
  26. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/usage_list_response.rb +1 -0
  27. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/usage_resource.rb +1 -0
  28. data/lib/smplkit/_generated/flags/lib/smplkit_flags_client.rb +1 -0
  29. data/lib/smplkit/_generated/flags/spec/api/flag_sources_api_spec.rb +2 -2
  30. data/lib/smplkit/_generated/flags/spec/api/flags_api_spec.rb +7 -7
  31. data/lib/smplkit/_generated/flags/spec/api/functions_api_spec.rb +1 -1
  32. data/lib/smplkit/_generated/flags/spec/api/usage_api_spec.rb +1 -1
  33. data/lib/smplkit/_generated/flags/spec/models/flag_bulk_item_spec.rb +4 -0
  34. data/lib/smplkit/_generated/flags/spec/models/flag_request_spec.rb +36 -0
  35. data/lib/smplkit/_generated/flags/spec/models/flag_source_spec.rb +13 -3
  36. data/lib/smplkit/_generated/flags/spec/models/flag_spec.rb +4 -0
  37. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bc05d3192320fd1b2c4abee57b805383aa0dffb8b7d2a0a61c479ac18763d85
4
- data.tar.gz: b9d40fb705d46129a8f4cf32350c3d82c2f6fdc430c20d36be1ca030e3130e0f
3
+ metadata.gz: a13c17482f6490edfe110ef2d8b196839e80a2cb51c1e5f2fbd9db1fa4dcc0c2
4
+ data.tar.gz: 30616e5d717587b16c3ba62bfc7ddf2ffe5ec36fa5517191bbad54c7d0645432
5
5
  SHA512:
6
- metadata.gz: 04d4ca3bd2849d284179c60406c76f725d8056b2434da699c87625d95f9fc80e5b24bf4810a60977a3296b1483e56010851fc3648047ec7ae975536b3eab38a8
7
- data.tar.gz: 637480b2da969e94dc1f87260539b546253a908499369b3f1f16685f1adabaa3d22c8d3e95d53d453a0adbb99947d4146e3e2506dda790229b5d3b9f2a5bf3fe
6
+ metadata.gz: ced9a4d2af5b33f5ac3bb2be41c204f1ba1a43dc99d3bcedeccedc9c80dbebc5c5dd072964211320c14032682a89178328405232b9f421bf232b548f50705803
7
+ data.tar.gz: 3f8c1dbb987307370be1b09db8e2c486217ecea0666cc9f7387bcf5cdac7d3b5fdf88218e4c0dfe74312094254acef38fcffc651f8c9df33811cef1aceb7888d
@@ -20,7 +20,7 @@ module SmplkitGeneratedClient::Flags
20
20
  @api_client = api_client
21
21
  end
22
22
  # List All Flag Sources
23
- # List all flag sources across all flags. Optionally filter by environment or service.
23
+ # List service/environment observations across all flags for this account. Filter by `environment` or `service` (or both) to narrow the result.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [String] :filter_environment
26
26
  # @option opts [String] :filter_service
@@ -31,7 +31,7 @@ module SmplkitGeneratedClient::Flags
31
31
  end
32
32
 
33
33
  # List All Flag Sources
34
- # List all flag sources across all flags. Optionally filter by environment or service.
34
+ # List service/environment observations across all flags for this account. Filter by `environment` or `service` (or both) to narrow the result.
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @option opts [String] :filter_environment
37
37
  # @option opts [String] :filter_service
@@ -83,7 +83,7 @@ module SmplkitGeneratedClient::Flags
83
83
  end
84
84
 
85
85
  # List Flag Sources
86
- # List all sources (service/environment observations) for a specific flag.
86
+ # List the service/environment observations recorded for a single flag.
87
87
  # @param id [String]
88
88
  # @param [Hash] opts the optional parameters
89
89
  # @return [FlagSourceListResponse]
@@ -93,7 +93,7 @@ module SmplkitGeneratedClient::Flags
93
93
  end
94
94
 
95
95
  # List Flag Sources
96
- # List all sources (service/environment observations) for a specific flag.
96
+ # List the service/environment observations recorded for a single flag.
97
97
  # @param id [String]
98
98
  # @param [Hash] opts the optional parameters
99
99
  # @return [Array<(FlagSourceListResponse, Integer, Hash)>] FlagSourceListResponse data, response status code and response headers
@@ -20,7 +20,7 @@ module SmplkitGeneratedClient::Flags
20
20
  @api_client = api_client
21
21
  end
22
22
  # Bulk Register Flags
23
- # Register flags discovered by an SDK. Creates new flags or updates source observations on existing ones.
23
+ # Register flags discovered by an SDK. Creates a new flag for each unreported key and refreshes the service/environment source observation on each already-known key.
24
24
  # @param flag_bulk_request [FlagBulkRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [FlagBulkResponse]
@@ -30,7 +30,7 @@ module SmplkitGeneratedClient::Flags
30
30
  end
31
31
 
32
32
  # Bulk Register Flags
33
- # Register flags discovered by an SDK. Creates new flags or updates source observations on existing ones.
33
+ # Register flags discovered by an SDK. Creates a new flag for each unreported key and refreshes the service/environment source observation on each already-known key.
34
34
  # @param flag_bulk_request [FlagBulkRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(FlagBulkResponse, Integer, Hash)>] FlagBulkResponse data, response status code and response headers
@@ -88,27 +88,27 @@ module SmplkitGeneratedClient::Flags
88
88
  end
89
89
 
90
90
  # Create Flag
91
- # Create a new feature flag. The caller provides the id (key) in the request body.
92
- # @param flag_response [FlagResponse]
91
+ # Create a new feature flag. The caller provides the id (the flag key) in the request body.
92
+ # @param flag_request [FlagRequest]
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @return [FlagResponse]
95
- def create_flag(flag_response, opts = {})
96
- data, _status_code, _headers = create_flag_with_http_info(flag_response, opts)
95
+ def create_flag(flag_request, opts = {})
96
+ data, _status_code, _headers = create_flag_with_http_info(flag_request, opts)
97
97
  data
98
98
  end
99
99
 
100
100
  # Create Flag
101
- # Create a new feature flag. The caller provides the id (key) in the request body.
102
- # @param flag_response [FlagResponse]
101
+ # Create a new feature flag. The caller provides the id (the flag key) in the request body.
102
+ # @param flag_request [FlagRequest]
103
103
  # @param [Hash] opts the optional parameters
104
104
  # @return [Array<(FlagResponse, Integer, Hash)>] FlagResponse data, response status code and response headers
105
- def create_flag_with_http_info(flag_response, opts = {})
105
+ def create_flag_with_http_info(flag_request, opts = {})
106
106
  if @api_client.config.debugging
107
107
  @api_client.config.logger.debug 'Calling API: FlagsApi.create_flag ...'
108
108
  end
109
- # verify the required parameter 'flag_response' is set
110
- if @api_client.config.client_side_validation && flag_response.nil?
111
- fail ArgumentError, "Missing the required parameter 'flag_response' when calling FlagsApi.create_flag"
109
+ # verify the required parameter 'flag_request' is set
110
+ if @api_client.config.client_side_validation && flag_request.nil?
111
+ fail ArgumentError, "Missing the required parameter 'flag_request' when calling FlagsApi.create_flag"
112
112
  end
113
113
  # resource path
114
114
  local_var_path = '/api/v1/flags'
@@ -130,7 +130,7 @@ module SmplkitGeneratedClient::Flags
130
130
  form_params = opts[:form_params] || {}
131
131
 
132
132
  # http body (model)
133
- post_body = opts[:debug_body] || @api_client.object_to_http_body(flag_response)
133
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(flag_request)
134
134
 
135
135
  # return_type
136
136
  return_type = opts[:debug_return_type] || 'FlagResponse'
@@ -217,7 +217,7 @@ module SmplkitGeneratedClient::Flags
217
217
  end
218
218
 
219
219
  # Get Flag
220
- # Return a feature flag by its key.
220
+ # Retrieve a feature flag by its key.
221
221
  # @param id [String]
222
222
  # @param [Hash] opts the optional parameters
223
223
  # @return [FlagResponse]
@@ -227,7 +227,7 @@ module SmplkitGeneratedClient::Flags
227
227
  end
228
228
 
229
229
  # Get Flag
230
- # Return a feature flag by its key.
230
+ # Retrieve a feature flag by its key.
231
231
  # @param id [String]
232
232
  # @param [Hash] opts the optional parameters
233
233
  # @return [Array<(FlagResponse, Integer, Hash)>] FlagResponse data, response status code and response headers
@@ -280,7 +280,7 @@ module SmplkitGeneratedClient::Flags
280
280
  end
281
281
 
282
282
  # List Flags
283
- # List all feature flags for the authenticated account.
283
+ # List feature flags for this account.
284
284
  # @param [Hash] opts the optional parameters
285
285
  # @option opts [String] :filter_type
286
286
  # @option opts [Boolean] :filter_managed
@@ -293,7 +293,7 @@ module SmplkitGeneratedClient::Flags
293
293
  end
294
294
 
295
295
  # List Flags
296
- # List all feature flags for the authenticated account.
296
+ # List feature flags for this account.
297
297
  # @param [Hash] opts the optional parameters
298
298
  # @option opts [String] :filter_type
299
299
  # @option opts [Boolean] :filter_managed
@@ -349,23 +349,23 @@ module SmplkitGeneratedClient::Flags
349
349
  end
350
350
 
351
351
  # Update Flag
352
- # Replace a feature flag entirely.
352
+ # Replace a feature flag entirely. Every writable field is overwritten.
353
353
  # @param id [String]
354
- # @param flag_response [FlagResponse]
354
+ # @param flag_request [FlagRequest]
355
355
  # @param [Hash] opts the optional parameters
356
356
  # @return [FlagResponse]
357
- def update_flag(id, flag_response, opts = {})
358
- data, _status_code, _headers = update_flag_with_http_info(id, flag_response, opts)
357
+ def update_flag(id, flag_request, opts = {})
358
+ data, _status_code, _headers = update_flag_with_http_info(id, flag_request, opts)
359
359
  data
360
360
  end
361
361
 
362
362
  # Update Flag
363
- # Replace a feature flag entirely.
363
+ # Replace a feature flag entirely. Every writable field is overwritten.
364
364
  # @param id [String]
365
- # @param flag_response [FlagResponse]
365
+ # @param flag_request [FlagRequest]
366
366
  # @param [Hash] opts the optional parameters
367
367
  # @return [Array<(FlagResponse, Integer, Hash)>] FlagResponse data, response status code and response headers
368
- def update_flag_with_http_info(id, flag_response, opts = {})
368
+ def update_flag_with_http_info(id, flag_request, opts = {})
369
369
  if @api_client.config.debugging
370
370
  @api_client.config.logger.debug 'Calling API: FlagsApi.update_flag ...'
371
371
  end
@@ -373,9 +373,9 @@ module SmplkitGeneratedClient::Flags
373
373
  if @api_client.config.client_side_validation && id.nil?
374
374
  fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.update_flag"
375
375
  end
376
- # verify the required parameter 'flag_response' is set
377
- if @api_client.config.client_side_validation && flag_response.nil?
378
- fail ArgumentError, "Missing the required parameter 'flag_response' when calling FlagsApi.update_flag"
376
+ # verify the required parameter 'flag_request' is set
377
+ if @api_client.config.client_side_validation && flag_request.nil?
378
+ fail ArgumentError, "Missing the required parameter 'flag_request' when calling FlagsApi.update_flag"
379
379
  end
380
380
  # resource path
381
381
  local_var_path = '/api/v1/flags/{id}'.sub('{id}', CGI.escape(id.to_s))
@@ -397,7 +397,7 @@ module SmplkitGeneratedClient::Flags
397
397
  form_params = opts[:form_params] || {}
398
398
 
399
399
  # http body (model)
400
- post_body = opts[:debug_body] || @api_client.object_to_http_body(flag_response)
400
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(flag_request)
401
401
 
402
402
  # return_type
403
403
  return_type = opts[:debug_return_type] || 'FlagResponse'
@@ -20,7 +20,7 @@ module SmplkitGeneratedClient::Flags
20
20
  @api_client = api_client
21
21
  end
22
22
  # Execute Remove References
23
- # Bulk-remove context references from flag rules. Traverses every flag in the account, removes rules that reference the specified context, and emits a single flags_changed event when done.
23
+ # Remove every rule that references a specific context across every flag. Provide exactly one of `context` (matches a single instance, formatted as `{type}:{key}`) or `context_type` (matches any attribute of that context type). Rules whose reference sits inside an AND expression are not removed automatically; they are returned in `rules_needing_manual_review` for the caller to handle.
24
24
  # @param remove_references_request [RemoveReferencesRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [RemoveReferencesResultEnvelope]
@@ -30,7 +30,7 @@ module SmplkitGeneratedClient::Flags
30
30
  end
31
31
 
32
32
  # Execute Remove References
33
- # Bulk-remove context references from flag rules. Traverses every flag in the account, removes rules that reference the specified context, and emits a single flags_changed event when done.
33
+ # Remove every rule that references a specific context across every flag. Provide exactly one of &#x60;context&#x60; (matches a single instance, formatted as &#x60;{type}:{key}&#x60;) or &#x60;context_type&#x60; (matches any attribute of that context type). Rules whose reference sits inside an AND expression are not removed automatically; they are returned in &#x60;rules_needing_manual_review&#x60; for the caller to handle.
34
34
  # @param remove_references_request [RemoveReferencesRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(RemoveReferencesResultEnvelope, Integer, Hash)>] RemoveReferencesResultEnvelope data, response status code and response headers
@@ -20,7 +20,7 @@ module SmplkitGeneratedClient::Flags
20
20
  @api_client = api_client
21
21
  end
22
22
  # List Flags Usage
23
- # Return current resource usage counts for the authenticated account.
23
+ # Report current-period usage counters for this account.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [String] :filter_period
26
26
  # @return [UsageListResponse]
@@ -30,7 +30,7 @@ module SmplkitGeneratedClient::Flags
30
30
  end
31
31
 
32
32
  # List Flags Usage
33
- # Return current resource usage counts for the authenticated account.
33
+ # Report current-period usage counters for this account.
34
34
  # @param [Hash] opts the optional parameters
35
35
  # @option opts [String] :filter_period
36
36
  # @return [Array<(UsageListResponse, Integer, Hash)>] UsageListResponse data, response status code and response headers
@@ -14,31 +14,59 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # A feature flag whose value is resolved at runtime from environment rules and a default. A flag has a value type (`BOOLEAN`, `STRING`, `NUMERIC`, or `JSON`) and either a fixed set of allowed values (constrained) or accepts any value matching the type (unconstrained). Each environment can enable or disable the flag, set its own default, and define targeting rules that override the default for specific evaluation contexts.
17
18
  class Flag < ApiModelBase
18
- # Human-readable display name
19
+ # Human-readable display name for the flag.
19
20
  attr_accessor :name
20
21
 
22
+ # Human-readable description of the flag's purpose.
21
23
  attr_accessor :description
22
24
 
23
- # Value type: STRING, BOOLEAN, NUMERIC, or JSON
25
+ # Value type of the flag. Accepted case-insensitively. Changing the type cascades to `values`, `default`, and every environment's rules and default.
24
26
  attr_accessor :type
25
27
 
26
28
  attr_accessor :default
27
29
 
28
- # Ordered set of allowed values (constrained), or null (unconstrained)
30
+ # Ordered set of allowed values for a constrained flag, or `null` for an unconstrained flag. `BOOLEAN` flags, if constrained, must declare exactly two values.
29
31
  attr_accessor :values
30
32
 
33
+ # Per-environment configuration keyed by environment name (`production`, `staging`, etc.). Environments not listed fall back to the flag's global `default`.
31
34
  attr_accessor :environments
32
35
 
33
- # True if admin-managed, false if auto-discovered
36
+ # `true` when the flag was created through the API, `false` when it was auto-discovered from a bulk-register call. Auto-discovered flags can be edited and converted to managed by setting this to `true`.
34
37
  attr_accessor :managed
35
38
 
39
+ # SDK-reported observations of this flag, grouped by service and environment. Populated automatically by the bulk-register endpoint.
36
40
  attr_accessor :sources
37
41
 
42
+ # When the flag was created.
38
43
  attr_accessor :created_at
39
44
 
45
+ # When the flag was last modified.
40
46
  attr_accessor :updated_at
41
47
 
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
42
70
  # Attribute mapping from ruby-style variable name to JSON key.
43
71
  def self.attribute_map
44
72
  {
@@ -75,7 +103,7 @@ module SmplkitGeneratedClient::Flags
75
103
  :'values' => :'Array<FlagValue>',
76
104
  :'environments' => :'Hash<String, FlagEnvironment>',
77
105
  :'managed' => :'Boolean',
78
- :'sources' => :'Array<Hash<String, Object>>',
106
+ :'sources' => :'Array<FlagSource>',
79
107
  :'created_at' => :'Time',
80
108
  :'updated_at' => :'Time'
81
109
  }
@@ -185,6 +213,8 @@ module SmplkitGeneratedClient::Flags
185
213
  warn '[DEPRECATED] the `valid?` method is obsolete'
186
214
  return false if @name.nil?
187
215
  return false if @type.nil?
216
+ type_validator = EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
217
+ return false unless type_validator.valid?(@type)
188
218
  true
189
219
  end
190
220
 
@@ -198,13 +228,13 @@ module SmplkitGeneratedClient::Flags
198
228
  @name = name
199
229
  end
200
230
 
201
- # Custom attribute writer method with validation
202
- # @param [Object] type Value to be assigned
231
+ # Custom attribute writer method checking allowed values (enum).
232
+ # @param [Object] type Object to be assigned
203
233
  def type=(type)
204
- if type.nil?
205
- fail ArgumentError, 'type cannot be nil'
234
+ validator = EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
235
+ unless validator.valid?(type)
236
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
206
237
  end
207
-
208
238
  @type = type
209
239
  end
210
240
 
@@ -14,21 +14,44 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # One flag declaration reported by an SDK during bulk registration.
17
18
  class FlagBulkItem < ApiModelBase
18
- # Flag key as declared in code
19
+ # Flag key as declared in code. URL-safe and stable for the lifetime of the flag.
19
20
  attr_accessor :id
20
21
 
21
- # Flag type: BOOLEAN, STRING, NUMERIC, or JSON
22
+ # Value type the SDK declared for the flag. Accepted case-insensitively.
22
23
  attr_accessor :type
23
24
 
24
25
  attr_accessor :default
25
26
 
26
- # Service that declared this flag
27
+ # Service reporting the declaration. Defaults to `unknown`.
27
28
  attr_accessor :service
28
29
 
29
- # Environment where observed
30
+ # Environment reporting the declaration. Defaults to `unknown`.
30
31
  attr_accessor :environment
31
32
 
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
32
55
  # Attribute mapping from ruby-style variable name to JSON key.
33
56
  def self.attribute_map
34
57
  {
@@ -135,6 +158,8 @@ module SmplkitGeneratedClient::Flags
135
158
  warn '[DEPRECATED] the `valid?` method is obsolete'
136
159
  return false if @id.nil?
137
160
  return false if @type.nil?
161
+ type_validator = EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
162
+ return false unless type_validator.valid?(@type)
138
163
  true
139
164
  end
140
165
 
@@ -148,13 +173,13 @@ module SmplkitGeneratedClient::Flags
148
173
  @id = id
149
174
  end
150
175
 
151
- # Custom attribute writer method with validation
152
- # @param [Object] type Value to be assigned
176
+ # Custom attribute writer method checking allowed values (enum).
177
+ # @param [Object] type Object to be assigned
153
178
  def type=(type)
154
- if type.nil?
155
- fail ArgumentError, 'type cannot be nil'
179
+ validator = EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
180
+ unless validator.valid?(type)
181
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
156
182
  end
157
-
158
183
  @type = type
159
184
  end
160
185
 
@@ -14,7 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # Inputs to the bulk-register-flags action.
17
18
  class FlagBulkRequest < ApiModelBase
19
+ # Flags reported by the SDK in this batch.
18
20
  attr_accessor :flags
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,7 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # Result of a bulk-register-flags action.
17
18
  class FlagBulkResponse < ApiModelBase
19
+ # Number of items in the batch that were registered or refreshed.
18
20
  attr_accessor :registered
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,11 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # Per-environment evaluation configuration for a flag.
17
18
  class FlagEnvironment < ApiModelBase
19
+ # Whether the flag is active in this environment. When `false`, evaluation skips rules and returns the flag's global `default`.
18
20
  attr_accessor :enabled
19
21
 
22
+ # Environment-level default returned when no rule fires. If `null`, evaluation falls back to the flag's global `default`.
20
23
  attr_accessor :default
21
24
 
25
+ # Targeting rules evaluated top-down. The first rule whose logic returns truthy provides the result.
22
26
  attr_accessor :rules
23
27
 
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API collection response envelope for flags.
17
18
  class FlagListResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #smplkit Flags API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::Flags
17
+ # JSON:API request envelope for creating or updating a flag.
18
+ class FlagRequest < ApiModelBase
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'FlagResource'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Flags::FlagRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Flags::FlagRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'data')
68
+ self.data = attributes[:'data']
69
+ else
70
+ self.data = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @data.nil?
80
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @data.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] data Value to be assigned
96
+ def data=(data)
97
+ if data.nil?
98
+ fail ArgumentError, 'data cannot be nil'
99
+ end
100
+
101
+ @data = data
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ data == o.data
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [data].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API resource envelope for a flag. `id` is the flag key. For create requests, `id` is required and is chosen by the caller. For update requests, `id` may be omitted (the server reads the key from the URL) or supplied to rename the flag.
17
18
  class FlagResource < ApiModelBase
18
19
  attr_accessor :id
19
20
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API single-resource response envelope for a flag.
17
18
  class FlagResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -14,9 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # A targeting rule that overrides the default within an environment.
17
18
  class FlagRule < ApiModelBase
19
+ # Human-readable description of the rule.
18
20
  attr_accessor :description
19
21
 
22
+ # JSON Logic expression evaluated against the evaluation context. The rule fires when the expression is truthy.
20
23
  attr_accessor :logic
21
24
 
22
25
  attr_accessor :value
@@ -14,29 +14,62 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # A record of an SDK observing a feature flag from a particular service and environment. The flags service auto-registers a source the first time an SDK reports a flag from a given service/environment pair and refreshes `last_seen` on every subsequent report. Each source captures the value type and default value the SDK declared in source code at that location, which makes it possible to detect when service code has drifted from the flag's authoritative configuration.
17
18
  class FlagSource < ApiModelBase
19
+ # Service that declared the flag.
18
20
  attr_accessor :service
19
21
 
22
+ # Environment in which the service declared the flag.
20
23
  attr_accessor :environment
21
24
 
25
+ # Value type the SDK reported when registering the flag from this service/environment. May differ from the flag's authoritative `type` if the service is running stale code.
26
+ attr_accessor :declared_type
27
+
28
+ attr_accessor :declared_default
29
+
30
+ # When this source was first observed.
22
31
  attr_accessor :first_observed
23
32
 
33
+ # Most recent time the SDK re-registered this source.
24
34
  attr_accessor :last_seen
25
35
 
26
- attr_accessor :data
27
-
36
+ # When the source record was created.
28
37
  attr_accessor :created_at
29
38
 
39
+ # When the source record was last modified.
30
40
  attr_accessor :updated_at
31
41
 
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
32
64
  # Attribute mapping from ruby-style variable name to JSON key.
33
65
  def self.attribute_map
34
66
  {
35
67
  :'service' => :'service',
36
68
  :'environment' => :'environment',
69
+ :'declared_type' => :'declared_type',
70
+ :'declared_default' => :'declared_default',
37
71
  :'first_observed' => :'first_observed',
38
72
  :'last_seen' => :'last_seen',
39
- :'data' => :'data',
40
73
  :'created_at' => :'created_at',
41
74
  :'updated_at' => :'updated_at'
42
75
  }
@@ -57,9 +90,10 @@ module SmplkitGeneratedClient::Flags
57
90
  {
58
91
  :'service' => :'String',
59
92
  :'environment' => :'String',
93
+ :'declared_type' => :'String',
94
+ :'declared_default' => :'Object',
60
95
  :'first_observed' => :'Time',
61
96
  :'last_seen' => :'Time',
62
- :'data' => :'Hash<String, Object>',
63
97
  :'created_at' => :'Time',
64
98
  :'updated_at' => :'Time'
65
99
  }
@@ -68,9 +102,12 @@ module SmplkitGeneratedClient::Flags
68
102
  # List of attributes with nullable: true
69
103
  def self.openapi_nullable
70
104
  Set.new([
105
+ :'service',
106
+ :'environment',
107
+ :'declared_type',
108
+ :'declared_default',
71
109
  :'first_observed',
72
110
  :'last_seen',
73
- :'data',
74
111
  :'created_at',
75
112
  :'updated_at'
76
113
  ])
@@ -100,6 +137,14 @@ module SmplkitGeneratedClient::Flags
100
137
  self.environment = attributes[:'environment']
101
138
  end
102
139
 
140
+ if attributes.key?(:'declared_type')
141
+ self.declared_type = attributes[:'declared_type']
142
+ end
143
+
144
+ if attributes.key?(:'declared_default')
145
+ self.declared_default = attributes[:'declared_default']
146
+ end
147
+
103
148
  if attributes.key?(:'first_observed')
104
149
  self.first_observed = attributes[:'first_observed']
105
150
  end
@@ -108,12 +153,6 @@ module SmplkitGeneratedClient::Flags
108
153
  self.last_seen = attributes[:'last_seen']
109
154
  end
110
155
 
111
- if attributes.key?(:'data')
112
- if (value = attributes[:'data']).is_a?(Hash)
113
- self.data = value
114
- end
115
- end
116
-
117
156
  if attributes.key?(:'created_at')
118
157
  self.created_at = attributes[:'created_at']
119
158
  end
@@ -135,9 +174,21 @@ module SmplkitGeneratedClient::Flags
135
174
  # @return true if the model is valid
136
175
  def valid?
137
176
  warn '[DEPRECATED] the `valid?` method is obsolete'
177
+ declared_type_validator = EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
178
+ return false unless declared_type_validator.valid?(@declared_type)
138
179
  true
139
180
  end
140
181
 
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] declared_type Object to be assigned
184
+ def declared_type=(declared_type)
185
+ validator = EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
186
+ unless validator.valid?(declared_type)
187
+ fail ArgumentError, "invalid value for \"declared_type\", must be one of #{validator.allowable_values}."
188
+ end
189
+ @declared_type = declared_type
190
+ end
191
+
141
192
  # Checks equality by comparing each attribute.
142
193
  # @param [Object] Object to be compared
143
194
  def ==(o)
@@ -145,9 +196,10 @@ module SmplkitGeneratedClient::Flags
145
196
  self.class == o.class &&
146
197
  service == o.service &&
147
198
  environment == o.environment &&
199
+ declared_type == o.declared_type &&
200
+ declared_default == o.declared_default &&
148
201
  first_observed == o.first_observed &&
149
202
  last_seen == o.last_seen &&
150
- data == o.data &&
151
203
  created_at == o.created_at &&
152
204
  updated_at == o.updated_at
153
205
  end
@@ -161,7 +213,7 @@ module SmplkitGeneratedClient::Flags
161
213
  # Calculates hash code according to all attributes.
162
214
  # @return [Integer] Hash code
163
215
  def hash
164
- [service, environment, first_observed, last_seen, data, created_at, updated_at].hash
216
+ [service, environment, declared_type, declared_default, first_observed, last_seen, created_at, updated_at].hash
165
217
  end
166
218
 
167
219
  # Builds the object from hash
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API collection response envelope for flag sources.
17
18
  class FlagSourceListResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API resource envelope for a flag source. `id` is the source record's UUID. Sources are not created or modified directly — the flags service registers and refreshes them in response to SDK bulk-register requests.
17
18
  class FlagSourceResource < ApiModelBase
18
19
  attr_accessor :id
19
20
 
@@ -14,7 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # A named value in a constrained flag's value set.
17
18
  class FlagValue < ApiModelBase
19
+ # Human-readable label for the value.
18
20
  attr_accessor :name
19
21
 
20
22
  attr_accessor :value
@@ -14,13 +14,18 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # A flag rule that could not be safely modified by the bulk remove-references action.
17
18
  class ManualReviewItem < ApiModelBase
19
+ # Key of the flag containing the rule.
18
20
  attr_accessor :flag
19
21
 
22
+ # Environment containing the rule.
20
23
  attr_accessor :environment
21
24
 
25
+ # Position of the rule within the environment's `rules` array.
22
26
  attr_accessor :rule_index
23
27
 
28
+ # Why the rule needs manual review.
24
29
  attr_accessor :reason
25
30
 
26
31
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,11 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # Counts and follow-ups returned by the remove-references action.
17
18
  class RemoveReferencesAttributes < ApiModelBase
19
+ # Keys of flags whose rules were modified.
18
20
  attr_accessor :flags_modified
19
21
 
22
+ # Total number of rules removed across all flags.
20
23
  attr_accessor :rules_removed
21
24
 
25
+ # Rules that referenced the context but could not be removed automatically (typically because the reference is inside an `and` expression where removal would broaden the rule).
22
26
  attr_accessor :rules_needing_manual_review
23
27
 
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,9 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # Inputs to the remove-references action. Exactly one of `context` or `context_type` must be provided.
17
18
  class RemoveReferencesRequest < ApiModelBase
19
+ # Identifier of the context instance to remove references to, formatted as `{type}:{key}` (e.g. `customer:c-123`).
18
20
  attr_accessor :context
19
21
 
22
+ # Context type to remove all references to (any attribute of this type).
20
23
  attr_accessor :context_type
21
24
 
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API single-resource response envelope for the remove-references action.
17
18
  class RemoveReferencesResultEnvelope < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API resource envelope for the remove-references result.
17
18
  class RemoveReferencesResultResource < ApiModelBase
18
19
  attr_accessor :type
19
20
 
@@ -14,11 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # Usage counter for a single metered limit.
17
18
  class UsageAttributes < ApiModelBase
19
+ # Identifier of the metered limit, e.g. `flags.items`.
18
20
  attr_accessor :limit_key
19
21
 
22
+ # Period the counter covers. `current` is the only supported value.
20
23
  attr_accessor :period
21
24
 
25
+ # Count for the period.
22
26
  attr_accessor :value
23
27
 
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API collection response envelope for usage counters.
17
18
  class UsageListResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
+ # JSON:API resource envelope for a usage counter.
17
18
  class UsageResource < ApiModelBase
18
19
  attr_accessor :id
19
20
 
@@ -24,6 +24,7 @@ require 'smplkit_flags_client/models/flag_bulk_request'
24
24
  require 'smplkit_flags_client/models/flag_bulk_response'
25
25
  require 'smplkit_flags_client/models/flag_environment'
26
26
  require 'smplkit_flags_client/models/flag_list_response'
27
+ require 'smplkit_flags_client/models/flag_request'
27
28
  require 'smplkit_flags_client/models/flag_resource'
28
29
  require 'smplkit_flags_client/models/flag_response'
29
30
  require 'smplkit_flags_client/models/flag_rule'
@@ -34,7 +34,7 @@ describe 'FlagSourcesApi' do
34
34
 
35
35
  # unit tests for list_all_flag_sources
36
36
  # List All Flag Sources
37
- # List all flag sources across all flags. Optionally filter by environment or service.
37
+ # List service/environment observations across all flags for this account. Filter by &#x60;environment&#x60; or &#x60;service&#x60; (or both) to narrow the result.
38
38
  # @param [Hash] opts the optional parameters
39
39
  # @option opts [String] :filter_environment
40
40
  # @option opts [String] :filter_service
@@ -47,7 +47,7 @@ describe 'FlagSourcesApi' do
47
47
 
48
48
  # unit tests for list_flag_sources
49
49
  # List Flag Sources
50
- # List all sources (service/environment observations) for a specific flag.
50
+ # List the service/environment observations recorded for a single flag.
51
51
  # @param id
52
52
  # @param [Hash] opts the optional parameters
53
53
  # @return [FlagSourceListResponse]
@@ -34,7 +34,7 @@ describe 'FlagsApi' do
34
34
 
35
35
  # unit tests for bulk_register_flags
36
36
  # Bulk Register Flags
37
- # Register flags discovered by an SDK. Creates new flags or updates source observations on existing ones.
37
+ # Register flags discovered by an SDK. Creates a new flag for each unreported key and refreshes the service/environment source observation on each already-known key.
38
38
  # @param flag_bulk_request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [FlagBulkResponse]
@@ -46,8 +46,8 @@ describe 'FlagsApi' do
46
46
 
47
47
  # unit tests for create_flag
48
48
  # Create Flag
49
- # Create a new feature flag. The caller provides the id (key) in the request body.
50
- # @param flag_response
49
+ # Create a new feature flag. The caller provides the id (the flag key) in the request body.
50
+ # @param flag_request
51
51
  # @param [Hash] opts the optional parameters
52
52
  # @return [FlagResponse]
53
53
  describe 'create_flag test' do
@@ -70,7 +70,7 @@ describe 'FlagsApi' do
70
70
 
71
71
  # unit tests for get_flag
72
72
  # Get Flag
73
- # Return a feature flag by its key.
73
+ # Retrieve a feature flag by its key.
74
74
  # @param id
75
75
  # @param [Hash] opts the optional parameters
76
76
  # @return [FlagResponse]
@@ -82,7 +82,7 @@ describe 'FlagsApi' do
82
82
 
83
83
  # unit tests for list_flags
84
84
  # List Flags
85
- # List all feature flags for the authenticated account.
85
+ # List feature flags for this account.
86
86
  # @param [Hash] opts the optional parameters
87
87
  # @option opts [String] :filter_type
88
88
  # @option opts [Boolean] :filter_managed
@@ -97,9 +97,9 @@ describe 'FlagsApi' do
97
97
 
98
98
  # unit tests for update_flag
99
99
  # Update Flag
100
- # Replace a feature flag entirely.
100
+ # Replace a feature flag entirely. Every writable field is overwritten.
101
101
  # @param id
102
- # @param flag_response
102
+ # @param flag_request
103
103
  # @param [Hash] opts the optional parameters
104
104
  # @return [FlagResponse]
105
105
  describe 'update_flag test' do
@@ -34,7 +34,7 @@ describe 'FunctionsApi' do
34
34
 
35
35
  # unit tests for remove_references
36
36
  # Execute Remove References
37
- # Bulk-remove context references from flag rules. Traverses every flag in the account, removes rules that reference the specified context, and emits a single flags_changed event when done.
37
+ # Remove every rule that references a specific context across every flag. Provide exactly one of &#x60;context&#x60; (matches a single instance, formatted as &#x60;{type}:{key}&#x60;) or &#x60;context_type&#x60; (matches any attribute of that context type). Rules whose reference sits inside an AND expression are not removed automatically; they are returned in &#x60;rules_needing_manual_review&#x60; for the caller to handle.
38
38
  # @param remove_references_request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [RemoveReferencesResultEnvelope]
@@ -34,7 +34,7 @@ describe 'UsageApi' do
34
34
 
35
35
  # unit tests for list_flags_usage
36
36
  # List Flags Usage
37
- # Return current resource usage counts for the authenticated account.
37
+ # Report current-period usage counters for this account.
38
38
  # @param [Hash] opts the optional parameters
39
39
  # @option opts [String] :filter_period
40
40
  # @return [UsageListResponse]
@@ -36,6 +36,10 @@ describe SmplkitGeneratedClient::Flags::FlagBulkItem do
36
36
  describe 'test attribute "type"' do
37
37
  it 'should work' do
38
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.type = value }.not_to raise_error
42
+ # end
39
43
  end
40
44
  end
41
45
 
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #smplkit Flags API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::Flags::FlagRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::Flags::FlagRequest do
21
+ #let(:instance) { SmplkitGeneratedClient::Flags::FlagRequest.new }
22
+
23
+ describe 'test an instance of FlagRequest' do
24
+ it 'should create an instance of FlagRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::Flags::FlagRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "data"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -39,19 +39,29 @@ describe SmplkitGeneratedClient::Flags::FlagSource do
39
39
  end
40
40
  end
41
41
 
42
- describe 'test attribute "first_observed"' do
42
+ describe 'test attribute "declared_type"' do
43
43
  it 'should work' do
44
44
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
46
+ # validator.allowable_values.each do |value|
47
+ # expect { instance.declared_type = value }.not_to raise_error
48
+ # end
45
49
  end
46
50
  end
47
51
 
48
- describe 'test attribute "last_seen"' do
52
+ describe 'test attribute "declared_default"' do
49
53
  it 'should work' do
50
54
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
55
  end
52
56
  end
53
57
 
54
- describe 'test attribute "data"' do
58
+ describe 'test attribute "first_observed"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "last_seen"' do
55
65
  it 'should work' do
56
66
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
67
  end
@@ -42,6 +42,10 @@ describe SmplkitGeneratedClient::Flags::Flag do
42
42
  describe 'test attribute "type"' do
43
43
  it 'should work' do
44
44
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BOOLEAN", "STRING", "NUMERIC", "JSON"])
46
+ # validator.allowable_values.each do |value|
47
+ # expect { instance.type = value }.not_to raise_error
48
+ # end
45
49
  end
46
50
  end
47
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smplkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.12
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC
@@ -515,6 +515,7 @@ files:
515
515
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_response.rb
516
516
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_environment.rb
517
517
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_list_response.rb
518
+ - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_request.rb
518
519
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_resource.rb
519
520
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_response.rb
520
521
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_rule.rb
@@ -540,6 +541,7 @@ files:
540
541
  - lib/smplkit/_generated/flags/spec/models/flag_bulk_response_spec.rb
541
542
  - lib/smplkit/_generated/flags/spec/models/flag_environment_spec.rb
542
543
  - lib/smplkit/_generated/flags/spec/models/flag_list_response_spec.rb
544
+ - lib/smplkit/_generated/flags/spec/models/flag_request_spec.rb
543
545
  - lib/smplkit/_generated/flags/spec/models/flag_resource_spec.rb
544
546
  - lib/smplkit/_generated/flags/spec/models/flag_response_spec.rb
545
547
  - lib/smplkit/_generated/flags/spec/models/flag_rule_spec.rb