smplkit 3.0.58 → 3.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b64f42f5d582cd0c7f7324596c83a6e71d5888142f366fb5533067f7fa87a8c
4
- data.tar.gz: a85bc5f2e007729666d0ba94030a4bdeffbedc19e345827a59666c1b9a188474
3
+ metadata.gz: '06975d5368d200b5bb4b41bd75a0bcfe2e73719134384a996e1d1329139f5e43'
4
+ data.tar.gz: a3009fbe825b7504452ed98c620e9dc86011cd127a7be32168130456898960ef
5
5
  SHA512:
6
- metadata.gz: 041420f0b59f0afd194c667b8a9571ebda634d4f4aaeeba96ac9eec0abc37fa61eb6f257766bfd8c5ff44657ad1df5b7425e24448eb646606c10243fb5112cb3
7
- data.tar.gz: 79e8e193b6f25fd0fe1a402ae5e6acb39c18e3d89f3ebcba155750d2b1065f6ca3750427926523335477a461192826d89c024cedaedf96ae75e9e623131d7cac
6
+ metadata.gz: a606827a20f3a7e00a34d0ae73cf38803355809a0b2cc0896fa7bbfa7e7489da35ae67973de05433aecd094d5dee307e4ae0e306d4019b3117013d9fa46a8641
7
+ data.tar.gz: e935a07f39bf40bd0c68ebe7cc668d0476b3a0c8212a6a47185ebf2585626be84ae66211a6bc742f5437a5e1742f4abb3c82e5adc8d608f5f61ce715b1be8170
@@ -28,6 +28,12 @@ module SmplkitGeneratedClient::Audit
28
28
  # HTTP response status that indicates a successful delivery. Either a specific status code (e.g. `200`, `204`) or a status class (`1xx`, `2xx`, `3xx`, `4xx`, `5xx`).
29
29
  attr_accessor :success_status
30
30
 
31
+ # Whether to verify the destination server's TLS certificate against trusted certificate authorities. Defaults to `true` and should be left on for any production destination. Set to `false` only for development or short-lived testing against a destination that presents an untrusted certificate (e.g. a Splunk Cloud trial stack on `:8088` serving its default self-signed certificate). When `false`, deliveries proceed without certificate verification — they are vulnerable to man-in-the-middle attacks. For long-lived self-signed setups, pin the issuing CA via `ca_cert` instead of disabling verification entirely.
32
+ attr_accessor :tls_verify
33
+
34
+ # Optional PEM-encoded certificate (or bundle) used to verify the destination server's TLS certificate, in addition to the system trust store. Use this to pin a private or self-signed CA (e.g. Splunk's default `SplunkCommonCA`) without disabling verification entirely via `tls_verify`. Must contain one or more `-----BEGIN CERTIFICATE-----` blocks. Ignored when `tls_verify` is `false`.
35
+ attr_accessor :ca_cert
36
+
31
37
  class EnumAttributeValidator
32
38
  attr_reader :datatype
33
39
  attr_reader :allowable_values
@@ -56,7 +62,9 @@ module SmplkitGeneratedClient::Audit
56
62
  :'method' => :'method',
57
63
  :'url' => :'url',
58
64
  :'headers' => :'headers',
59
- :'success_status' => :'success_status'
65
+ :'success_status' => :'success_status',
66
+ :'tls_verify' => :'tls_verify',
67
+ :'ca_cert' => :'ca_cert'
60
68
  }
61
69
  end
62
70
 
@@ -76,13 +84,16 @@ module SmplkitGeneratedClient::Audit
76
84
  :'method' => :'String',
77
85
  :'url' => :'String',
78
86
  :'headers' => :'Array<HttpHeader>',
79
- :'success_status' => :'String'
87
+ :'success_status' => :'String',
88
+ :'tls_verify' => :'Boolean',
89
+ :'ca_cert' => :'String'
80
90
  }
81
91
  end
82
92
 
83
93
  # List of attributes with nullable: true
84
94
  def self.openapi_nullable
85
95
  Set.new([
96
+ :'ca_cert'
86
97
  ])
87
98
  end
88
99
 
@@ -125,6 +136,16 @@ module SmplkitGeneratedClient::Audit
125
136
  else
126
137
  self.success_status = '2xx'
127
138
  end
139
+
140
+ if attributes.key?(:'tls_verify')
141
+ self.tls_verify = attributes[:'tls_verify']
142
+ else
143
+ self.tls_verify = true
144
+ end
145
+
146
+ if attributes.key?(:'ca_cert')
147
+ self.ca_cert = attributes[:'ca_cert']
148
+ end
128
149
  end
129
150
 
130
151
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -148,6 +169,10 @@ module SmplkitGeneratedClient::Audit
148
169
  invalid_properties.push('invalid value for "success_status", the character length must be smaller than or equal to 3.')
149
170
  end
150
171
 
172
+ if !@ca_cert.nil? && @ca_cert.to_s.length > 65536
173
+ invalid_properties.push('invalid value for "ca_cert", the character length must be smaller than or equal to 65536.')
174
+ end
175
+
151
176
  invalid_properties
152
177
  end
153
178
 
@@ -161,6 +186,7 @@ module SmplkitGeneratedClient::Audit
161
186
  return false if @url.to_s.length > 2048
162
187
  return false if @url.to_s.length < 1
163
188
  return false if !@success_status.nil? && @success_status.to_s.length > 3
189
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length > 65536
164
190
  true
165
191
  end
166
192
 
@@ -206,6 +232,16 @@ module SmplkitGeneratedClient::Audit
206
232
  @success_status = success_status
207
233
  end
208
234
 
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] ca_cert Value to be assigned
237
+ def ca_cert=(ca_cert)
238
+ if !ca_cert.nil? && ca_cert.to_s.length > 65536
239
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be smaller than or equal to 65536.'
240
+ end
241
+
242
+ @ca_cert = ca_cert
243
+ end
244
+
209
245
  # Checks equality by comparing each attribute.
210
246
  # @param [Object] Object to be compared
211
247
  def ==(o)
@@ -214,7 +250,9 @@ module SmplkitGeneratedClient::Audit
214
250
  method == o.method &&
215
251
  url == o.url &&
216
252
  headers == o.headers &&
217
- success_status == o.success_status
253
+ success_status == o.success_status &&
254
+ tls_verify == o.tls_verify &&
255
+ ca_cert == o.ca_cert
218
256
  end
219
257
 
220
258
  # @see the `==` method
@@ -226,7 +264,7 @@ module SmplkitGeneratedClient::Audit
226
264
  # Calculates hash code according to all attributes.
227
265
  # @return [Integer] Hash code
228
266
  def hash
229
- [method, url, headers, success_status].hash
267
+ [method, url, headers, success_status, tls_verify, ca_cert].hash
230
268
  end
231
269
 
232
270
  # Builds the object from hash
@@ -31,6 +31,12 @@ module SmplkitGeneratedClient::Audit
31
31
  # Per-request timeout in milliseconds. Capped at 30 seconds.
32
32
  attr_accessor :timeout_ms
33
33
 
34
+ # Whether to verify the destination server's TLS certificate. Mirrors the parent forwarder field of the same name — see its description for security guidance. Defaults to `true`.
35
+ attr_accessor :tls_verify
36
+
37
+ # Optional PEM-encoded certificate (or bundle) used to verify the destination server's TLS certificate. Mirrors the parent forwarder field. Must contain one or more `-----BEGIN CERTIFICATE-----` blocks.
38
+ attr_accessor :ca_cert
39
+
34
40
  # Request body sent to the destination. When omitted, an empty body is sent (suitable for connectivity probes). When set, the body is sent verbatim — pair with an appropriate `Content-Type` entry in `headers` so the destination interprets it correctly. Limit 1 MiB.
35
41
  attr_accessor :body
36
42
 
@@ -64,6 +70,8 @@ module SmplkitGeneratedClient::Audit
64
70
  :'headers' => :'headers',
65
71
  :'success_status' => :'success_status',
66
72
  :'timeout_ms' => :'timeout_ms',
73
+ :'tls_verify' => :'tls_verify',
74
+ :'ca_cert' => :'ca_cert',
67
75
  :'body' => :'body'
68
76
  }
69
77
  end
@@ -86,6 +94,8 @@ module SmplkitGeneratedClient::Audit
86
94
  :'headers' => :'Array<HttpHeader>',
87
95
  :'success_status' => :'String',
88
96
  :'timeout_ms' => :'Integer',
97
+ :'tls_verify' => :'Boolean',
98
+ :'ca_cert' => :'String',
89
99
  :'body' => :'String'
90
100
  }
91
101
  end
@@ -94,6 +104,7 @@ module SmplkitGeneratedClient::Audit
94
104
  def self.openapi_nullable
95
105
  Set.new([
96
106
  :'timeout_ms',
107
+ :'ca_cert',
97
108
  :'body'
98
109
  ])
99
110
  end
@@ -142,6 +153,16 @@ module SmplkitGeneratedClient::Audit
142
153
  self.timeout_ms = attributes[:'timeout_ms']
143
154
  end
144
155
 
156
+ if attributes.key?(:'tls_verify')
157
+ self.tls_verify = attributes[:'tls_verify']
158
+ else
159
+ self.tls_verify = true
160
+ end
161
+
162
+ if attributes.key?(:'ca_cert')
163
+ self.ca_cert = attributes[:'ca_cert']
164
+ end
165
+
145
166
  if attributes.key?(:'body')
146
167
  self.body = attributes[:'body']
147
168
  end
@@ -176,6 +197,10 @@ module SmplkitGeneratedClient::Audit
176
197
  invalid_properties.push('invalid value for "timeout_ms", must be greater than or equal to 1.')
177
198
  end
178
199
 
200
+ if !@ca_cert.nil? && @ca_cert.to_s.length > 65536
201
+ invalid_properties.push('invalid value for "ca_cert", the character length must be smaller than or equal to 65536.')
202
+ end
203
+
179
204
  if !@body.nil? && @body.to_s.length > 1048576
180
205
  invalid_properties.push('invalid value for "body", the character length must be smaller than or equal to 1048576.')
181
206
  end
@@ -195,6 +220,7 @@ module SmplkitGeneratedClient::Audit
195
220
  return false if !@success_status.nil? && @success_status.to_s.length > 3
196
221
  return false if !@timeout_ms.nil? && @timeout_ms > 30000
197
222
  return false if !@timeout_ms.nil? && @timeout_ms < 1
223
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length > 65536
198
224
  return false if !@body.nil? && @body.to_s.length > 1048576
199
225
  true
200
226
  end
@@ -255,6 +281,16 @@ module SmplkitGeneratedClient::Audit
255
281
  @timeout_ms = timeout_ms
256
282
  end
257
283
 
284
+ # Custom attribute writer method with validation
285
+ # @param [Object] ca_cert Value to be assigned
286
+ def ca_cert=(ca_cert)
287
+ if !ca_cert.nil? && ca_cert.to_s.length > 65536
288
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be smaller than or equal to 65536.'
289
+ end
290
+
291
+ @ca_cert = ca_cert
292
+ end
293
+
258
294
  # Custom attribute writer method with validation
259
295
  # @param [Object] body Value to be assigned
260
296
  def body=(body)
@@ -275,6 +311,8 @@ module SmplkitGeneratedClient::Audit
275
311
  headers == o.headers &&
276
312
  success_status == o.success_status &&
277
313
  timeout_ms == o.timeout_ms &&
314
+ tls_verify == o.tls_verify &&
315
+ ca_cert == o.ca_cert &&
278
316
  body == o.body
279
317
  end
280
318
 
@@ -287,7 +325,7 @@ module SmplkitGeneratedClient::Audit
287
325
  # Calculates hash code according to all attributes.
288
326
  # @return [Integer] Hash code
289
327
  def hash
290
- [method, url, headers, success_status, timeout_ms, body].hash
328
+ [method, url, headers, success_status, timeout_ms, tls_verify, ca_cert, body].hash
291
329
  end
292
330
 
293
331
  # Builds the object from hash
@@ -55,4 +55,16 @@ describe SmplkitGeneratedClient::Audit::HttpConfiguration do
55
55
  end
56
56
  end
57
57
 
58
+ describe 'test attribute "tls_verify"' 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 "ca_cert"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
67
+ end
68
+ end
69
+
58
70
  end
@@ -61,6 +61,18 @@ describe SmplkitGeneratedClient::Audit::TestForwarderRequest do
61
61
  end
62
62
  end
63
63
 
64
+ describe 'test attribute "tls_verify"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "ca_cert"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
73
+ end
74
+ end
75
+
64
76
  describe 'test attribute "body"' do
65
77
  it 'should work' do
66
78
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -89,26 +89,26 @@ module SmplkitGeneratedClient::Flags
89
89
 
90
90
  # Create Flag
91
91
  # Create a new feature flag. The caller provides the id (the flag key) in the request body.
92
- # @param flag_request [FlagRequest]
92
+ # @param flag_create_request [FlagCreateRequest]
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @return [FlagResponse]
95
- def create_flag(flag_request, opts = {})
96
- data, _status_code, _headers = create_flag_with_http_info(flag_request, opts)
95
+ def create_flag(flag_create_request, opts = {})
96
+ data, _status_code, _headers = create_flag_with_http_info(flag_create_request, opts)
97
97
  data
98
98
  end
99
99
 
100
100
  # Create Flag
101
101
  # Create a new feature flag. The caller provides the id (the flag key) in the request body.
102
- # @param flag_request [FlagRequest]
102
+ # @param flag_create_request [FlagCreateRequest]
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_request, opts = {})
105
+ def create_flag_with_http_info(flag_create_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_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"
109
+ # verify the required parameter 'flag_create_request' is set
110
+ if @api_client.config.client_side_validation && flag_create_request.nil?
111
+ fail ArgumentError, "Missing the required parameter 'flag_create_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_request)
133
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(flag_create_request)
134
134
 
135
135
  # return_type
136
136
  return_type = opts[:debug_return_type] || 'FlagResponse'
@@ -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 a flag. Distinct from :class:`FlagRequest` because create requires caller-supplied ``data.id`` while update does not.
18
+ class FlagCreateRequest < 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' => :'FlagCreateResource'
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::FlagCreateRequest` 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::FlagCreateRequest`. 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
@@ -0,0 +1,242 @@
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 resource envelope for creating a flag (id required).
18
+ class FlagCreateResource < ApiModelBase
19
+ # Client-supplied resource id.
20
+ attr_accessor :id
21
+
22
+ attr_accessor :type
23
+
24
+ attr_accessor :attributes
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'id' => :'id',
52
+ :'type' => :'type',
53
+ :'attributes' => :'attributes'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'type' => :'String',
72
+ :'attributes' => :'Flag'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Flags::FlagCreateResource` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Flags::FlagCreateResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ else
101
+ self.id = nil
102
+ end
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'attributes')
111
+ self.attributes = attributes[:'attributes']
112
+ else
113
+ self.attributes = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @id.nil?
123
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
124
+ end
125
+
126
+ if @type.nil?
127
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
128
+ end
129
+
130
+ if @attributes.nil?
131
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @id.nil?
142
+ return false if @type.nil?
143
+ type_validator = EnumAttributeValidator.new('String', ["flag"])
144
+ return false unless type_validator.valid?(@type)
145
+ return false if @attributes.nil?
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] id Value to be assigned
151
+ def id=(id)
152
+ if id.nil?
153
+ fail ArgumentError, 'id cannot be nil'
154
+ end
155
+
156
+ @id = id
157
+ end
158
+
159
+ # Custom attribute writer method checking allowed values (enum).
160
+ # @param [Object] type Object to be assigned
161
+ def type=(type)
162
+ validator = EnumAttributeValidator.new('String', ["flag"])
163
+ unless validator.valid?(type)
164
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
165
+ end
166
+ @type = type
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] attributes Value to be assigned
171
+ def attributes=(attributes)
172
+ if attributes.nil?
173
+ fail ArgumentError, 'attributes cannot be nil'
174
+ end
175
+
176
+ @attributes = attributes
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ id == o.id &&
185
+ type == o.type &&
186
+ attributes == o.attributes
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [id, type, attributes].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Flags
17
- # JSON:API request envelope for creating or updating a flag.
17
+ # JSON:API request envelope for updating a flag.
18
18
  class FlagRequest < ApiModelBase
19
19
  attr_accessor :data
20
20
 
@@ -22,6 +22,8 @@ require 'smplkit_flags_client/models/flag'
22
22
  require 'smplkit_flags_client/models/flag_bulk_item'
23
23
  require 'smplkit_flags_client/models/flag_bulk_request'
24
24
  require 'smplkit_flags_client/models/flag_bulk_response'
25
+ require 'smplkit_flags_client/models/flag_create_request'
26
+ require 'smplkit_flags_client/models/flag_create_resource'
25
27
  require 'smplkit_flags_client/models/flag_environment'
26
28
  require 'smplkit_flags_client/models/flag_list_response'
27
29
  require 'smplkit_flags_client/models/flag_request'
@@ -47,7 +47,7 @@ describe 'FlagsApi' do
47
47
  # unit tests for create_flag
48
48
  # Create Flag
49
49
  # Create a new feature flag. The caller provides the id (the flag key) in the request body.
50
- # @param flag_request
50
+ # @param flag_create_request
51
51
  # @param [Hash] opts the optional parameters
52
52
  # @return [FlagResponse]
53
53
  describe 'create_flag test' do
@@ -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::FlagCreateRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::Flags::FlagCreateRequest do
21
+ #let(:instance) { SmplkitGeneratedClient::Flags::FlagCreateRequest.new }
22
+
23
+ describe 'test an instance of FlagCreateRequest' do
24
+ it 'should create an instance of FlagCreateRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::Flags::FlagCreateRequest)
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
@@ -0,0 +1,52 @@
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::FlagCreateResource
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::Flags::FlagCreateResource do
21
+ #let(:instance) { SmplkitGeneratedClient::Flags::FlagCreateResource.new }
22
+
23
+ describe 'test an instance of FlagCreateResource' do
24
+ it 'should create an instance of FlagCreateResource' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::Flags::FlagCreateResource)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "id"' 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
+ describe 'test attribute "type"' 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', ["flag"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.type = value }.not_to raise_error
42
+ # end
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "attributes"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
52
+ end
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: 3.0.58
4
+ version: 3.0.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC
@@ -615,6 +615,8 @@ files:
615
615
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_item.rb
616
616
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_request.rb
617
617
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_bulk_response.rb
618
+ - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_create_request.rb
619
+ - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_create_resource.rb
618
620
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_environment.rb
619
621
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_list_response.rb
620
622
  - lib/smplkit/_generated/flags/lib/smplkit_flags_client/models/flag_request.rb
@@ -643,6 +645,8 @@ files:
643
645
  - lib/smplkit/_generated/flags/spec/models/flag_bulk_item_spec.rb
644
646
  - lib/smplkit/_generated/flags/spec/models/flag_bulk_request_spec.rb
645
647
  - lib/smplkit/_generated/flags/spec/models/flag_bulk_response_spec.rb
648
+ - lib/smplkit/_generated/flags/spec/models/flag_create_request_spec.rb
649
+ - lib/smplkit/_generated/flags/spec/models/flag_create_resource_spec.rb
646
650
  - lib/smplkit/_generated/flags/spec/models/flag_environment_spec.rb
647
651
  - lib/smplkit/_generated/flags/spec/models/flag_list_response_spec.rb
648
652
  - lib/smplkit/_generated/flags/spec/models/flag_request_spec.rb