smplkit 3.0.137 → 3.0.138
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da31b093e455c35df5a2b84389f7373966769a1818c04b46f596878cb03c91c2
|
|
4
|
+
data.tar.gz: c5693b1ad8e458672ff322a22945a388834ef28a661c0675e905ee22fa1e9ecb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4e68882d5c554c683cc611e32705149b629b622e1a8f7b9d89657704a9a2ce903ea052ace457fb9ba68d3d1bd6b74caf99b1297f6c12875b68d61e1171234fb
|
|
7
|
+
data.tar.gz: 616a17123787d16094e6b959c7a3a71c125ae34dba0139a56457578a7d0133ad76449330b9dc6ba86adadf5b7a3be3ab37219ddf81ce33999c26a4573144d5bf
|
|
@@ -19,6 +19,9 @@ module SmplkitGeneratedClient::App
|
|
|
19
19
|
# Human-readable name for the key.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
22
|
+
# Credential class of the key, set at creation and immutable. `PRIVATE` (the default) keys carry full API access and must be kept secret — never expose one in a browser or client application. `PUBLIC` keys are browser-safe, read-only credentials for reading feature flags and configuration from client-side code; they must be scoped to exactly one environment with `permissions: [\"read\"]`. Accepted case-insensitively.
|
|
23
|
+
attr_accessor :kind
|
|
24
|
+
|
|
22
25
|
# Lifecycle state of the key. `ACTIVE` keys may be used to authenticate; `REVOKED` keys are rejected.
|
|
23
26
|
attr_accessor :status
|
|
24
27
|
|
|
@@ -43,10 +46,33 @@ module SmplkitGeneratedClient::App
|
|
|
43
46
|
# When the key was last modified.
|
|
44
47
|
attr_accessor :updated_at
|
|
45
48
|
|
|
49
|
+
class EnumAttributeValidator
|
|
50
|
+
attr_reader :datatype
|
|
51
|
+
attr_reader :allowable_values
|
|
52
|
+
|
|
53
|
+
def initialize(datatype, allowable_values)
|
|
54
|
+
@allowable_values = allowable_values.map do |value|
|
|
55
|
+
case datatype.to_s
|
|
56
|
+
when /Integer/i
|
|
57
|
+
value.to_i
|
|
58
|
+
when /Float/i
|
|
59
|
+
value.to_f
|
|
60
|
+
else
|
|
61
|
+
value
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def valid?(value)
|
|
67
|
+
!value || allowable_values.include?(value)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
46
71
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
72
|
def self.attribute_map
|
|
48
73
|
{
|
|
49
74
|
:'name' => :'name',
|
|
75
|
+
:'kind' => :'kind',
|
|
50
76
|
:'status' => :'status',
|
|
51
77
|
:'key' => :'key',
|
|
52
78
|
:'scopes' => :'scopes',
|
|
@@ -72,6 +98,7 @@ module SmplkitGeneratedClient::App
|
|
|
72
98
|
def self.openapi_types
|
|
73
99
|
{
|
|
74
100
|
:'name' => :'String',
|
|
101
|
+
:'kind' => :'String',
|
|
75
102
|
:'status' => :'String',
|
|
76
103
|
:'key' => :'String',
|
|
77
104
|
:'scopes' => :'Hash<String, Object>',
|
|
@@ -118,6 +145,12 @@ module SmplkitGeneratedClient::App
|
|
|
118
145
|
self.name = nil
|
|
119
146
|
end
|
|
120
147
|
|
|
148
|
+
if attributes.key?(:'kind')
|
|
149
|
+
self.kind = attributes[:'kind']
|
|
150
|
+
else
|
|
151
|
+
self.kind = 'PRIVATE'
|
|
152
|
+
end
|
|
153
|
+
|
|
121
154
|
if attributes.key?(:'status')
|
|
122
155
|
self.status = attributes[:'status']
|
|
123
156
|
end
|
|
@@ -175,6 +208,8 @@ module SmplkitGeneratedClient::App
|
|
|
175
208
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
176
209
|
return false if @name.nil?
|
|
177
210
|
return false if @name.to_s.length > 255
|
|
211
|
+
kind_validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
|
|
212
|
+
return false unless kind_validator.valid?(@kind)
|
|
178
213
|
true
|
|
179
214
|
end
|
|
180
215
|
|
|
@@ -192,12 +227,23 @@ module SmplkitGeneratedClient::App
|
|
|
192
227
|
@name = name
|
|
193
228
|
end
|
|
194
229
|
|
|
230
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
231
|
+
# @param [Object] kind Object to be assigned
|
|
232
|
+
def kind=(kind)
|
|
233
|
+
validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
|
|
234
|
+
unless validator.valid?(kind)
|
|
235
|
+
fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
|
|
236
|
+
end
|
|
237
|
+
@kind = kind
|
|
238
|
+
end
|
|
239
|
+
|
|
195
240
|
# Checks equality by comparing each attribute.
|
|
196
241
|
# @param [Object] Object to be compared
|
|
197
242
|
def ==(o)
|
|
198
243
|
return true if self.equal?(o)
|
|
199
244
|
self.class == o.class &&
|
|
200
245
|
name == o.name &&
|
|
246
|
+
kind == o.kind &&
|
|
201
247
|
status == o.status &&
|
|
202
248
|
key == o.key &&
|
|
203
249
|
scopes == o.scopes &&
|
|
@@ -217,7 +263,7 @@ module SmplkitGeneratedClient::App
|
|
|
217
263
|
# Calculates hash code according to all attributes.
|
|
218
264
|
# @return [Integer] Hash code
|
|
219
265
|
def hash
|
|
220
|
-
[name, status, key, scopes, created_by, expires_at, last_used_at, created_at, updated_at].hash
|
|
266
|
+
[name, kind, status, key, scopes, created_by, expires_at, last_used_at, created_at, updated_at].hash
|
|
221
267
|
end
|
|
222
268
|
|
|
223
269
|
# Builds the object from hash
|
|
@@ -33,6 +33,16 @@ describe SmplkitGeneratedClient::App::ApiKey do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
describe 'test attribute "kind"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
|
|
40
|
+
# validator.allowable_values.each do |value|
|
|
41
|
+
# expect { instance.kind = value }.not_to raise_error
|
|
42
|
+
# end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
36
46
|
describe 'test attribute "status"' do
|
|
37
47
|
it 'should work' do
|
|
38
48
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|