smplkit 2.0.14 → 2.0.15
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/api/actions_api.rb +2 -69
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb +17 -17
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +36 -36
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/functions_api.rb +2 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/resource_types_api.rb +2 -72
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/usage_api.rb +4 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +12 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_response.rb +1 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_request.rb +165 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_resource.rb +2 -18
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_response.rb +1 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb +17 -17
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb +11 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_resource.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_http.rb +40 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_request.rb +165 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_resource.rb +2 -17
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/http_header.rb +3 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb +4 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb +41 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb +7 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_attributes.rb +4 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_response.rb +3 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_tables_summary.rb +7 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +2 -0
- data/lib/smplkit/_generated/audit/spec/api/actions_api_spec.rb +1 -14
- data/lib/smplkit/_generated/audit/spec/api/events_api_spec.rb +5 -5
- data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +11 -11
- data/lib/smplkit/_generated/audit/spec/api/functions_api_spec.rb +1 -1
- data/lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb +1 -15
- data/lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb +2 -2
- data/lib/smplkit/_generated/audit/spec/models/event_request_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_http_spec.rb +4 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_request_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_spec.rb +0 -6
- data/lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb +4 -0
- data/lib/smplkit/audit/actions.rb +35 -0
- data/lib/smplkit/audit/client.rb +11 -9
- data/lib/smplkit/audit/events.rb +8 -45
- data/lib/smplkit/audit/models.rb +197 -0
- data/lib/smplkit/audit/resource_types.rb +30 -0
- data/lib/smplkit/errors.rb +5 -0
- data/lib/smplkit/management/audit.rb +111 -0
- data/lib/smplkit/management/client.rb +4 -1
- data/lib/smplkit.rb +7 -5
- metadata +9 -3
- data/lib/smplkit/audit/forwarders.rb +0 -282
- data/lib/smplkit/audit/functions.rb +0 -58
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
# JSON:API collection response
|
|
17
|
+
# JSON:API collection response for audit events.
|
|
18
18
|
class EventListResponse < ApiModelBase
|
|
19
19
|
attr_accessor :data
|
|
20
20
|
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
# JSON:API request envelope for recording an audit event.
|
|
18
|
+
class EventRequest < 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' => :'EventResource'
|
|
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::Audit::EventRequest` 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::Audit::EventRequest`. 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,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
# JSON:API resource envelope for an audit event.
|
|
17
|
+
# JSON:API resource envelope for an audit event. `id` must not be specified for create requests (the server assigns it).
|
|
18
18
|
class EventResource < ApiModelBase
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
@@ -53,6 +53,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
53
53
|
# List of attributes with nullable: true
|
|
54
54
|
def self.openapi_nullable
|
|
55
55
|
Set.new([
|
|
56
|
+
:'id',
|
|
56
57
|
])
|
|
57
58
|
end
|
|
58
59
|
|
|
@@ -74,8 +75,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
74
75
|
|
|
75
76
|
if attributes.key?(:'id')
|
|
76
77
|
self.id = attributes[:'id']
|
|
77
|
-
else
|
|
78
|
-
self.id = nil
|
|
79
78
|
end
|
|
80
79
|
|
|
81
80
|
if attributes.key?(:'type')
|
|
@@ -96,10 +95,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
96
95
|
def list_invalid_properties
|
|
97
96
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
98
97
|
invalid_properties = Array.new
|
|
99
|
-
if @id.nil?
|
|
100
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
101
|
-
end
|
|
102
|
-
|
|
103
98
|
if @attributes.nil?
|
|
104
99
|
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
|
105
100
|
end
|
|
@@ -111,21 +106,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
111
106
|
# @return true if the model is valid
|
|
112
107
|
def valid?
|
|
113
108
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
-
return false if @id.nil?
|
|
115
109
|
return false if @attributes.nil?
|
|
116
110
|
true
|
|
117
111
|
end
|
|
118
112
|
|
|
119
|
-
# Custom attribute writer method with validation
|
|
120
|
-
# @param [Object] id Value to be assigned
|
|
121
|
-
def id=(id)
|
|
122
|
-
if id.nil?
|
|
123
|
-
fail ArgumentError, 'id cannot be nil'
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
@id = id
|
|
127
|
-
end
|
|
128
|
-
|
|
129
113
|
# Custom attribute writer method with validation
|
|
130
114
|
# @param [Object] attributes Value to be assigned
|
|
131
115
|
def attributes=(attributes)
|
|
@@ -14,32 +14,41 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
#
|
|
17
|
+
# A destination that receives audit events recorded for the account. Each event recorded for the account is evaluated against every enabled forwarder. If the filter expression evaluates truthy — or is absent — the event is delivered to the destination using the configured HTTP request. The slug, derived from `name` at create time, is the stable identifier used by the console and other tooling.
|
|
18
18
|
class Forwarder < ApiModelBase
|
|
19
|
+
# Human-readable name for the forwarder.
|
|
19
20
|
attr_accessor :name
|
|
20
21
|
|
|
22
|
+
# Destination type.
|
|
21
23
|
attr_accessor :forwarder_type
|
|
22
24
|
|
|
25
|
+
# Whether the forwarder is currently delivering events. Set to `false` to pause deliveries without deleting the forwarder.
|
|
23
26
|
attr_accessor :enabled
|
|
24
27
|
|
|
28
|
+
# JSON Logic expression evaluated against each event. The event is delivered only if the expression returns truthy. Omit to deliver every event.
|
|
25
29
|
attr_accessor :filter
|
|
26
30
|
|
|
31
|
+
# JSONata template applied to each event before delivery. Omit to deliver the event unchanged.
|
|
27
32
|
attr_accessor :transform
|
|
28
33
|
|
|
34
|
+
# HTTP request used to deliver each event to the destination.
|
|
29
35
|
attr_accessor :http
|
|
30
36
|
|
|
37
|
+
# URL-safe identifier derived from `name` at create time. Stable for the lifetime of the forwarder.
|
|
31
38
|
attr_accessor :slug
|
|
32
39
|
|
|
40
|
+
# When the forwarder was created.
|
|
33
41
|
attr_accessor :created_at
|
|
34
42
|
|
|
43
|
+
# When the forwarder was last modified.
|
|
35
44
|
attr_accessor :updated_at
|
|
36
45
|
|
|
46
|
+
# When the forwarder was deleted. `null` for active forwarders.
|
|
37
47
|
attr_accessor :deleted_at
|
|
38
48
|
|
|
49
|
+
# Monotonic counter incremented on every update, starting at 1.
|
|
39
50
|
attr_accessor :version
|
|
40
51
|
|
|
41
|
-
attr_accessor :data
|
|
42
|
-
|
|
43
52
|
class EnumAttributeValidator
|
|
44
53
|
attr_reader :datatype
|
|
45
54
|
attr_reader :allowable_values
|
|
@@ -75,8 +84,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
75
84
|
:'created_at' => :'created_at',
|
|
76
85
|
:'updated_at' => :'updated_at',
|
|
77
86
|
:'deleted_at' => :'deleted_at',
|
|
78
|
-
:'version' => :'version'
|
|
79
|
-
:'data' => :'data'
|
|
87
|
+
:'version' => :'version'
|
|
80
88
|
}
|
|
81
89
|
end
|
|
82
90
|
|
|
@@ -103,8 +111,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
103
111
|
:'created_at' => :'Time',
|
|
104
112
|
:'updated_at' => :'Time',
|
|
105
113
|
:'deleted_at' => :'Time',
|
|
106
|
-
:'version' => :'Integer'
|
|
107
|
-
:'data' => :'Hash<String, Object>'
|
|
114
|
+
:'version' => :'Integer'
|
|
108
115
|
}
|
|
109
116
|
end
|
|
110
117
|
|
|
@@ -117,7 +124,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
117
124
|
:'created_at',
|
|
118
125
|
:'updated_at',
|
|
119
126
|
:'deleted_at',
|
|
120
|
-
:'version'
|
|
127
|
+
:'version'
|
|
121
128
|
])
|
|
122
129
|
end
|
|
123
130
|
|
|
@@ -190,12 +197,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
190
197
|
if attributes.key?(:'version')
|
|
191
198
|
self.version = attributes[:'version']
|
|
192
199
|
end
|
|
193
|
-
|
|
194
|
-
if attributes.key?(:'data')
|
|
195
|
-
if (value = attributes[:'data']).is_a?(Hash)
|
|
196
|
-
self.data = value
|
|
197
|
-
end
|
|
198
|
-
end
|
|
199
200
|
end
|
|
200
201
|
|
|
201
202
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -306,8 +307,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
306
307
|
created_at == o.created_at &&
|
|
307
308
|
updated_at == o.updated_at &&
|
|
308
309
|
deleted_at == o.deleted_at &&
|
|
309
|
-
version == o.version
|
|
310
|
-
data == o.data
|
|
310
|
+
version == o.version
|
|
311
311
|
end
|
|
312
312
|
|
|
313
313
|
# @see the `==` method
|
|
@@ -319,7 +319,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
319
319
|
# Calculates hash code according to all attributes.
|
|
320
320
|
# @return [Integer] Hash code
|
|
321
321
|
def hash
|
|
322
|
-
[name, forwarder_type, enabled, filter, transform, http, slug, created_at, updated_at, deleted_at, version
|
|
322
|
+
[name, forwarder_type, enabled, filter, transform, http, slug, created_at, updated_at, deleted_at, version].hash
|
|
323
323
|
end
|
|
324
324
|
|
|
325
325
|
# Builds the object from hash
|
|
@@ -14,26 +14,36 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
#
|
|
17
|
+
# A log entry for one attempt to deliver an event to a forwarder.
|
|
18
18
|
class ForwarderDelivery < ApiModelBase
|
|
19
|
+
# Forwarder the delivery belongs to.
|
|
19
20
|
attr_accessor :forwarder_id
|
|
20
21
|
|
|
22
|
+
# Event that was being delivered.
|
|
21
23
|
attr_accessor :event_id
|
|
22
24
|
|
|
25
|
+
# 1 for the initial delivery, incremented for each retry.
|
|
23
26
|
attr_accessor :attempt_number
|
|
24
27
|
|
|
28
|
+
# Delivery outcome. `SUCCEEDED` and `FAILED` are the live-delivery outcomes; `FILTERED_OUT` is recorded when the forwarder's filter rejected the event; `SKIPPED_DO_NOT_FORWARD` is recorded when the event was emitted with `do_not_forward=true`.
|
|
25
29
|
attr_accessor :status
|
|
26
30
|
|
|
31
|
+
# The HTTP request as it was sent to the destination. Header values are redacted.
|
|
27
32
|
attr_accessor :request
|
|
28
33
|
|
|
34
|
+
# HTTP status code returned by the destination.
|
|
29
35
|
attr_accessor :response_status
|
|
30
36
|
|
|
37
|
+
# Response body returned by the destination.
|
|
31
38
|
attr_accessor :response_body
|
|
32
39
|
|
|
40
|
+
# Elapsed time of the delivery attempt in milliseconds.
|
|
33
41
|
attr_accessor :latency_ms
|
|
34
42
|
|
|
43
|
+
# Error message if the delivery did not complete.
|
|
35
44
|
attr_accessor :error
|
|
36
45
|
|
|
46
|
+
# When the delivery attempt was recorded.
|
|
37
47
|
attr_accessor :created_at
|
|
38
48
|
|
|
39
49
|
class EnumAttributeValidator
|
|
@@ -14,18 +14,45 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
#
|
|
17
|
+
# HTTP request configuration used to deliver an event to the destination.
|
|
18
18
|
class ForwarderHttp < ApiModelBase
|
|
19
|
+
# HTTP method used when delivering an event.
|
|
19
20
|
attr_accessor :method
|
|
20
21
|
|
|
22
|
+
# Destination URL.
|
|
21
23
|
attr_accessor :url
|
|
22
24
|
|
|
25
|
+
# HTTP headers attached to each delivery request.
|
|
23
26
|
attr_accessor :headers
|
|
24
27
|
|
|
28
|
+
# Request body sent to the destination. If omitted, the event JSON is sent as the body.
|
|
25
29
|
attr_accessor :body
|
|
26
30
|
|
|
31
|
+
# 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`).
|
|
27
32
|
attr_accessor :success_status
|
|
28
33
|
|
|
34
|
+
class EnumAttributeValidator
|
|
35
|
+
attr_reader :datatype
|
|
36
|
+
attr_reader :allowable_values
|
|
37
|
+
|
|
38
|
+
def initialize(datatype, allowable_values)
|
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
|
40
|
+
case datatype.to_s
|
|
41
|
+
when /Integer/i
|
|
42
|
+
value.to_i
|
|
43
|
+
when /Float/i
|
|
44
|
+
value.to_f
|
|
45
|
+
else
|
|
46
|
+
value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def valid?(value)
|
|
52
|
+
!value || allowable_values.include?(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
29
56
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
57
|
def self.attribute_map
|
|
31
58
|
{
|
|
@@ -142,6 +169,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
142
169
|
# @return true if the model is valid
|
|
143
170
|
def valid?
|
|
144
171
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
172
|
+
method_validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
173
|
+
return false unless method_validator.valid?(@method)
|
|
145
174
|
return false if @url.nil?
|
|
146
175
|
return false if @url.to_s.length > 2048
|
|
147
176
|
return false if @url.to_s.length < 1
|
|
@@ -150,6 +179,16 @@ module SmplkitGeneratedClient::Audit
|
|
|
150
179
|
true
|
|
151
180
|
end
|
|
152
181
|
|
|
182
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
183
|
+
# @param [Object] method Object to be assigned
|
|
184
|
+
def method=(method)
|
|
185
|
+
validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
186
|
+
unless validator.valid?(method)
|
|
187
|
+
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
|
188
|
+
end
|
|
189
|
+
@method = method
|
|
190
|
+
end
|
|
191
|
+
|
|
153
192
|
# Custom attribute writer method with validation
|
|
154
193
|
# @param [Object] url Value to be assigned
|
|
155
194
|
def url=(url)
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
# JSON:API request envelope for creating or updating a forwarder.
|
|
18
|
+
class ForwarderRequest < 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' => :'ForwarderResource'
|
|
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::Audit::ForwarderRequest` 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::Audit::ForwarderRequest`. 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
|