smplkit 1.0.21 → 1.0.22
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 +4 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_http.rb +23 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb +22 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +0 -1
- metadata +1 -3
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/success_status.rb +0 -103
- data/lib/smplkit/_generated/audit/spec/models/success_status_spec.rb +0 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5e0d5932d4d7f60ee888012ba55971ac9ddb7c2416c02a314802016f03c8241
|
|
4
|
+
data.tar.gz: b038f538c31da57a59b295649ff3499577c83cb13d9f50c0d61379946a69f84a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 858dd5c84add861872f6d16b997f310e7d5046f9ade96ee006960838ddd4b82070bd583364aa67429cf0e3be7e53da6ccaea5bb56de81f75bf5477c0a3a62a07
|
|
7
|
+
data.tar.gz: 904792e0739e4d9e9916b3d2cd2305b2bf8bc29279fca461a18329d8b8abd2f1dc55a3eae33392029a17a259b87ec5741d1010b7e8f59cd17118cbd40d5e6626
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
# The destination HTTP request shape stored encrypted on a forwarder. ``success_status`` is either a single
|
|
17
|
+
# The destination HTTP request shape stored encrypted on a forwarder. ``success_status`` is a string: either a single status code (e.g. ``\"200\"``, ``\"204\"``) or a class (e.g. ``\"2xx\"``, ``\"3xx\"``). The string-only contract is intentional — a Pydantic ``int | str`` union confused several SDK code generators (Java in particular wrote the default ``\"2xx\"`` unquoted into a typed enum). String covers both shapes universally with a single wire type.
|
|
18
18
|
class ForwarderHttp < ApiModelBase
|
|
19
19
|
attr_accessor :method
|
|
20
20
|
|
|
@@ -54,7 +54,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
54
54
|
:'url' => :'String',
|
|
55
55
|
:'headers' => :'Array<HttpHeader>',
|
|
56
56
|
:'body' => :'String',
|
|
57
|
-
:'success_status' => :'
|
|
57
|
+
:'success_status' => :'String'
|
|
58
58
|
}
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -105,6 +105,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
105
105
|
|
|
106
106
|
if attributes.key?(:'success_status')
|
|
107
107
|
self.success_status = attributes[:'success_status']
|
|
108
|
+
else
|
|
109
|
+
self.success_status = '2xx'
|
|
108
110
|
end
|
|
109
111
|
end
|
|
110
112
|
|
|
@@ -129,6 +131,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
129
131
|
invalid_properties.push('invalid value for "body", the character length must be smaller than or equal to 65536.')
|
|
130
132
|
end
|
|
131
133
|
|
|
134
|
+
if !@success_status.nil? && @success_status.to_s.length > 3
|
|
135
|
+
invalid_properties.push('invalid value for "success_status", the character length must be smaller than or equal to 3.')
|
|
136
|
+
end
|
|
137
|
+
|
|
132
138
|
invalid_properties
|
|
133
139
|
end
|
|
134
140
|
|
|
@@ -140,6 +146,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
140
146
|
return false if @url.to_s.length > 2048
|
|
141
147
|
return false if @url.to_s.length < 1
|
|
142
148
|
return false if !@body.nil? && @body.to_s.length > 65536
|
|
149
|
+
return false if !@success_status.nil? && @success_status.to_s.length > 3
|
|
143
150
|
true
|
|
144
151
|
end
|
|
145
152
|
|
|
@@ -171,6 +178,20 @@ module SmplkitGeneratedClient::Audit
|
|
|
171
178
|
@body = body
|
|
172
179
|
end
|
|
173
180
|
|
|
181
|
+
# Custom attribute writer method with validation
|
|
182
|
+
# @param [Object] success_status Value to be assigned
|
|
183
|
+
def success_status=(success_status)
|
|
184
|
+
if success_status.nil?
|
|
185
|
+
fail ArgumentError, 'success_status cannot be nil'
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if success_status.to_s.length > 3
|
|
189
|
+
fail ArgumentError, 'invalid value for "success_status", the character length must be smaller than or equal to 3.'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@success_status = success_status
|
|
193
|
+
end
|
|
194
|
+
|
|
174
195
|
# Checks equality by comparing each attribute.
|
|
175
196
|
# @param [Object] Object to be compared
|
|
176
197
|
def ==(o)
|
|
@@ -57,7 +57,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
57
57
|
:'url' => :'String',
|
|
58
58
|
:'headers' => :'Array<HttpHeader>',
|
|
59
59
|
:'body' => :'String',
|
|
60
|
-
:'success_status' => :'
|
|
60
|
+
:'success_status' => :'String',
|
|
61
61
|
:'timeout_ms' => :'Integer'
|
|
62
62
|
}
|
|
63
63
|
end
|
|
@@ -110,6 +110,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
110
110
|
|
|
111
111
|
if attributes.key?(:'success_status')
|
|
112
112
|
self.success_status = attributes[:'success_status']
|
|
113
|
+
else
|
|
114
|
+
self.success_status = '2xx'
|
|
113
115
|
end
|
|
114
116
|
|
|
115
117
|
if attributes.key?(:'timeout_ms')
|
|
@@ -138,6 +140,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
138
140
|
invalid_properties.push('invalid value for "body", the character length must be smaller than or equal to 65536.')
|
|
139
141
|
end
|
|
140
142
|
|
|
143
|
+
if !@success_status.nil? && @success_status.to_s.length > 3
|
|
144
|
+
invalid_properties.push('invalid value for "success_status", the character length must be smaller than or equal to 3.')
|
|
145
|
+
end
|
|
146
|
+
|
|
141
147
|
if !@timeout_ms.nil? && @timeout_ms > 30000
|
|
142
148
|
invalid_properties.push('invalid value for "timeout_ms", must be smaller than or equal to 30000.')
|
|
143
149
|
end
|
|
@@ -157,6 +163,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
157
163
|
return false if @url.to_s.length > 2048
|
|
158
164
|
return false if @url.to_s.length < 1
|
|
159
165
|
return false if !@body.nil? && @body.to_s.length > 65536
|
|
166
|
+
return false if !@success_status.nil? && @success_status.to_s.length > 3
|
|
160
167
|
return false if !@timeout_ms.nil? && @timeout_ms > 30000
|
|
161
168
|
return false if !@timeout_ms.nil? && @timeout_ms < 1
|
|
162
169
|
true
|
|
@@ -190,6 +197,20 @@ module SmplkitGeneratedClient::Audit
|
|
|
190
197
|
@body = body
|
|
191
198
|
end
|
|
192
199
|
|
|
200
|
+
# Custom attribute writer method with validation
|
|
201
|
+
# @param [Object] success_status Value to be assigned
|
|
202
|
+
def success_status=(success_status)
|
|
203
|
+
if success_status.nil?
|
|
204
|
+
fail ArgumentError, 'success_status cannot be nil'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if success_status.to_s.length > 3
|
|
208
|
+
fail ArgumentError, 'invalid value for "success_status", the character length must be smaller than or equal to 3.'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@success_status = success_status
|
|
212
|
+
end
|
|
213
|
+
|
|
193
214
|
# Custom attribute writer method with validation
|
|
194
215
|
# @param [Object] timeout_ms Value to be assigned
|
|
195
216
|
def timeout_ms=(timeout_ms)
|
|
@@ -37,7 +37,6 @@ require 'smplkit_audit_client/models/forwarder_resource'
|
|
|
37
37
|
require 'smplkit_audit_client/models/forwarder_response'
|
|
38
38
|
require 'smplkit_audit_client/models/http_header'
|
|
39
39
|
require 'smplkit_audit_client/models/retry_failed_deliveries_summary'
|
|
40
|
-
require 'smplkit_audit_client/models/success_status'
|
|
41
40
|
require 'smplkit_audit_client/models/test_forwarder_request'
|
|
42
41
|
require 'smplkit_audit_client/models/test_forwarder_response'
|
|
43
42
|
require 'smplkit_audit_client/models/usage_resource'
|
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: 1.0.
|
|
4
|
+
version: 1.0.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Smpl Solutions LLC
|
|
@@ -415,7 +415,6 @@ files:
|
|
|
415
415
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_response.rb
|
|
416
416
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/http_header.rb
|
|
417
417
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb
|
|
418
|
-
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/success_status.rb
|
|
419
418
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb
|
|
420
419
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb
|
|
421
420
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_resource.rb
|
|
@@ -443,7 +442,6 @@ files:
|
|
|
443
442
|
- lib/smplkit/_generated/audit/spec/models/forwarder_spec.rb
|
|
444
443
|
- lib/smplkit/_generated/audit/spec/models/http_header_spec.rb
|
|
445
444
|
- lib/smplkit/_generated/audit/spec/models/retry_failed_deliveries_summary_spec.rb
|
|
446
|
-
- lib/smplkit/_generated/audit/spec/models/success_status_spec.rb
|
|
447
445
|
- lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb
|
|
448
446
|
- lib/smplkit/_generated/audit/spec/models/test_forwarder_response_spec.rb
|
|
449
447
|
- lib/smplkit/_generated/audit/spec/models/usage_resource_spec.rb
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#smplkit Audit API
|
|
3
|
-
|
|
4
|
-
#Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
|
|
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::Audit
|
|
17
|
-
module SuccessStatus
|
|
18
|
-
class << self
|
|
19
|
-
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
-
def openapi_any_of
|
|
21
|
-
[
|
|
22
|
-
:'Integer',
|
|
23
|
-
:'String'
|
|
24
|
-
]
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# Builds the object
|
|
28
|
-
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
-
# @return [Object] Returns the model or the data itself
|
|
30
|
-
def build(data)
|
|
31
|
-
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
-
# Note:
|
|
33
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
-
# - TODO: logging when debugging is set.
|
|
37
|
-
openapi_any_of.each do |klass|
|
|
38
|
-
begin
|
|
39
|
-
next if klass == :AnyType # "nullable: true"
|
|
40
|
-
return find_and_cast_into_type(klass, data)
|
|
41
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
private
|
|
49
|
-
|
|
50
|
-
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
-
|
|
52
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
-
def find_and_cast_into_type(klass, data)
|
|
54
|
-
return if data.nil?
|
|
55
|
-
|
|
56
|
-
case klass.to_s
|
|
57
|
-
when 'Boolean'
|
|
58
|
-
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
-
when 'Float'
|
|
60
|
-
return data if data.instance_of?(Float)
|
|
61
|
-
when 'Integer'
|
|
62
|
-
return data if data.instance_of?(Integer)
|
|
63
|
-
when 'Time'
|
|
64
|
-
return Time.parse(data)
|
|
65
|
-
when 'Date'
|
|
66
|
-
return Date.iso8601(data)
|
|
67
|
-
when 'String'
|
|
68
|
-
return data if data.instance_of?(String)
|
|
69
|
-
when 'Object' # "type: object"
|
|
70
|
-
return data if data.instance_of?(Hash)
|
|
71
|
-
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
-
if data.instance_of?(Array)
|
|
73
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
-
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
-
end
|
|
76
|
-
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
-
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
-
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
-
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
-
end
|
|
81
|
-
else # model
|
|
82
|
-
const = SmplkitGeneratedClient::Audit.const_get(klass)
|
|
83
|
-
if const
|
|
84
|
-
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
-
model = const.build(data)
|
|
86
|
-
return model if model
|
|
87
|
-
else
|
|
88
|
-
# raise if data contains keys that are not known to the model
|
|
89
|
-
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
-
model = const.build_from_hash(data)
|
|
91
|
-
return model if model
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
raise # if no match by now, raise
|
|
97
|
-
rescue
|
|
98
|
-
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#smplkit Audit API
|
|
3
|
-
|
|
4
|
-
#Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
|
|
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::Audit::SuccessStatus
|
|
18
|
-
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
-
# Please update as you see appropriate
|
|
20
|
-
describe SmplkitGeneratedClient::Audit::SuccessStatus do
|
|
21
|
-
end
|