smplkit 1.0.19 → 1.0.21
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/{default_api.rb → events_api.rb} +38 -102
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +640 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/usage_api.rb +86 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +13 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb +353 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb +329 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_response.rb +202 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_resource.rb +201 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_response.rb +164 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_http.rb +239 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_links.rb +148 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_meta.rb +164 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_response.rb +202 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_resource.rb +201 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_response.rb +164 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/http_header.rb +218 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb +216 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/success_status.rb +103 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb +273 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb +220 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +19 -1
- data/lib/smplkit/_generated/audit/spec/api/{default_api_spec.rb → events_api_spec.rb} +13 -25
- data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +152 -0
- data/lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb +47 -0
- data/lib/smplkit/_generated/audit/spec/models/event_spec.rb +6 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_response_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_response_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_delivery_spec.rb +94 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_http_spec.rb +60 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_list_links_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_list_meta_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_list_response_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_response_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_spec.rb +102 -0
- data/lib/smplkit/_generated/audit/spec/models/http_header_spec.rb +42 -0
- data/lib/smplkit/_generated/audit/spec/models/retry_failed_deliveries_summary_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/success_status_spec.rb +21 -0
- data/lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb +66 -0
- data/lib/smplkit/_generated/audit/spec/models/test_forwarder_response_spec.rb +66 -0
- data/lib/smplkit/audit/buffer.rb +15 -6
- data/lib/smplkit/audit/client.rb +1 -1
- data/lib/smplkit/audit/events.rb +1 -1
- metadata +39 -3
|
@@ -0,0 +1,86 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module SmplkitGeneratedClient::Audit
|
|
16
|
+
class UsageApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List Usage
|
|
23
|
+
# Current-period usage and quota for the audit product. Only ``filter[period]=current`` is supported; historical usage is a follow-up.
|
|
24
|
+
# @param filter_period [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [UsageResponse]
|
|
27
|
+
def list_usage(filter_period, opts = {})
|
|
28
|
+
data, _status_code, _headers = list_usage_with_http_info(filter_period, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# List Usage
|
|
33
|
+
# Current-period usage and quota for the audit product. Only ``filter[period]=current`` is supported; historical usage is a follow-up.
|
|
34
|
+
# @param filter_period [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(UsageResponse, Integer, Hash)>] UsageResponse data, response status code and response headers
|
|
37
|
+
def list_usage_with_http_info(filter_period, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: UsageApi.list_usage ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'filter_period' is set
|
|
42
|
+
if @api_client.config.client_side_validation && filter_period.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'filter_period' when calling UsageApi.list_usage"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/v1/usage'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
query_params[:'filter[period]'] = filter_period
|
|
51
|
+
|
|
52
|
+
# header parameters
|
|
53
|
+
header_params = opts[:header_params] || {}
|
|
54
|
+
# HTTP header 'Accept' (if needed)
|
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
|
|
56
|
+
|
|
57
|
+
# form parameters
|
|
58
|
+
form_params = opts[:form_params] || {}
|
|
59
|
+
|
|
60
|
+
# http body (model)
|
|
61
|
+
post_body = opts[:debug_body]
|
|
62
|
+
|
|
63
|
+
# return_type
|
|
64
|
+
return_type = opts[:debug_return_type] || 'UsageResponse'
|
|
65
|
+
|
|
66
|
+
# auth_names
|
|
67
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
68
|
+
|
|
69
|
+
new_options = opts.merge(
|
|
70
|
+
:operation => :"UsageApi.list_usage",
|
|
71
|
+
:header_params => header_params,
|
|
72
|
+
:query_params => query_params,
|
|
73
|
+
:form_params => form_params,
|
|
74
|
+
:body => post_body,
|
|
75
|
+
:auth_names => auth_names,
|
|
76
|
+
:return_type => return_type
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
80
|
+
if @api_client.config.debugging
|
|
81
|
+
@api_client.config.logger.debug "API called: UsageApi#list_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
82
|
+
end
|
|
83
|
+
return data, status_code, headers
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -28,6 +28,9 @@ module SmplkitGeneratedClient::Audit
|
|
|
28
28
|
|
|
29
29
|
attr_accessor :data
|
|
30
30
|
|
|
31
|
+
# When true, this event is recorded normally but is not forwarded to any configured SIEM forwarder. A forwarder_delivery row with status=skipped_do_not_forward is recorded for each enabled forwarder so the skip is visible in the delivery log.
|
|
32
|
+
attr_accessor :do_not_forward
|
|
33
|
+
|
|
31
34
|
attr_accessor :created_at
|
|
32
35
|
|
|
33
36
|
attr_accessor :actor_type
|
|
@@ -47,6 +50,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
47
50
|
:'occurred_at' => :'occurred_at',
|
|
48
51
|
:'snapshot' => :'snapshot',
|
|
49
52
|
:'data' => :'data',
|
|
53
|
+
:'do_not_forward' => :'do_not_forward',
|
|
50
54
|
:'created_at' => :'created_at',
|
|
51
55
|
:'actor_type' => :'actor_type',
|
|
52
56
|
:'actor_id' => :'actor_id',
|
|
@@ -74,6 +78,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
74
78
|
:'occurred_at' => :'Time',
|
|
75
79
|
:'snapshot' => :'Hash<String, Object>',
|
|
76
80
|
:'data' => :'Hash<String, Object>',
|
|
81
|
+
:'do_not_forward' => :'Boolean',
|
|
77
82
|
:'created_at' => :'Time',
|
|
78
83
|
:'actor_type' => :'String',
|
|
79
84
|
:'actor_id' => :'String',
|
|
@@ -145,6 +150,12 @@ module SmplkitGeneratedClient::Audit
|
|
|
145
150
|
end
|
|
146
151
|
end
|
|
147
152
|
|
|
153
|
+
if attributes.key?(:'do_not_forward')
|
|
154
|
+
self.do_not_forward = attributes[:'do_not_forward']
|
|
155
|
+
else
|
|
156
|
+
self.do_not_forward = false
|
|
157
|
+
end
|
|
158
|
+
|
|
148
159
|
if attributes.key?(:'created_at')
|
|
149
160
|
self.created_at = attributes[:'created_at']
|
|
150
161
|
end
|
|
@@ -264,6 +275,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
264
275
|
occurred_at == o.occurred_at &&
|
|
265
276
|
snapshot == o.snapshot &&
|
|
266
277
|
data == o.data &&
|
|
278
|
+
do_not_forward == o.do_not_forward &&
|
|
267
279
|
created_at == o.created_at &&
|
|
268
280
|
actor_type == o.actor_type &&
|
|
269
281
|
actor_id == o.actor_id &&
|
|
@@ -280,7 +292,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
280
292
|
# Calculates hash code according to all attributes.
|
|
281
293
|
# @return [Integer] Hash code
|
|
282
294
|
def hash
|
|
283
|
-
[action, resource_type, resource_id, occurred_at, snapshot, data, created_at, actor_type, actor_id, actor_label, idempotency_key].hash
|
|
295
|
+
[action, resource_type, resource_id, occurred_at, snapshot, data, do_not_forward, created_at, actor_type, actor_id, actor_label, idempotency_key].hash
|
|
284
296
|
end
|
|
285
297
|
|
|
286
298
|
# Builds the object from hash
|
|
@@ -0,0 +1,353 @@
|
|
|
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
|
+
# Public-facing forwarder resource. Attribute set on POST /api/v1/forwarders: - name (required) - forwarder_type (required) - http (required) - enabled (optional, defaults true) - filter (optional, JSON Logic) - transform (optional, JSONata) The slug is server-derived from name on create; it is immutable on update because consumers (UI, observability) key off it.
|
|
18
|
+
class Forwarder < ApiModelBase
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
attr_accessor :forwarder_type
|
|
22
|
+
|
|
23
|
+
attr_accessor :enabled
|
|
24
|
+
|
|
25
|
+
attr_accessor :filter
|
|
26
|
+
|
|
27
|
+
attr_accessor :transform
|
|
28
|
+
|
|
29
|
+
attr_accessor :http
|
|
30
|
+
|
|
31
|
+
attr_accessor :slug
|
|
32
|
+
|
|
33
|
+
attr_accessor :created_at
|
|
34
|
+
|
|
35
|
+
attr_accessor :updated_at
|
|
36
|
+
|
|
37
|
+
attr_accessor :deleted_at
|
|
38
|
+
|
|
39
|
+
attr_accessor :version
|
|
40
|
+
|
|
41
|
+
attr_accessor :data
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'name' => :'name',
|
|
47
|
+
:'forwarder_type' => :'forwarder_type',
|
|
48
|
+
:'enabled' => :'enabled',
|
|
49
|
+
:'filter' => :'filter',
|
|
50
|
+
:'transform' => :'transform',
|
|
51
|
+
:'http' => :'http',
|
|
52
|
+
:'slug' => :'slug',
|
|
53
|
+
:'created_at' => :'created_at',
|
|
54
|
+
:'updated_at' => :'updated_at',
|
|
55
|
+
:'deleted_at' => :'deleted_at',
|
|
56
|
+
:'version' => :'version',
|
|
57
|
+
:'data' => :'data'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'name' => :'String',
|
|
75
|
+
:'forwarder_type' => :'String',
|
|
76
|
+
:'enabled' => :'Boolean',
|
|
77
|
+
:'filter' => :'Hash<String, Object>',
|
|
78
|
+
:'transform' => :'String',
|
|
79
|
+
:'http' => :'ForwarderHttp',
|
|
80
|
+
:'slug' => :'String',
|
|
81
|
+
:'created_at' => :'Time',
|
|
82
|
+
:'updated_at' => :'Time',
|
|
83
|
+
:'deleted_at' => :'Time',
|
|
84
|
+
:'version' => :'Integer',
|
|
85
|
+
:'data' => :'Hash<String, Object>'
|
|
86
|
+
}
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# List of attributes with nullable: true
|
|
90
|
+
def self.openapi_nullable
|
|
91
|
+
Set.new([
|
|
92
|
+
:'filter',
|
|
93
|
+
:'transform',
|
|
94
|
+
:'slug',
|
|
95
|
+
:'created_at',
|
|
96
|
+
:'updated_at',
|
|
97
|
+
:'deleted_at',
|
|
98
|
+
:'version',
|
|
99
|
+
])
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Initializes the object
|
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
104
|
+
def initialize(attributes = {})
|
|
105
|
+
if (!attributes.is_a?(Hash))
|
|
106
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::Forwarder` initialize method"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
110
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
112
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
113
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::Forwarder`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
114
|
+
end
|
|
115
|
+
h[k.to_sym] = v
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'name')
|
|
119
|
+
self.name = attributes[:'name']
|
|
120
|
+
else
|
|
121
|
+
self.name = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'forwarder_type')
|
|
125
|
+
self.forwarder_type = attributes[:'forwarder_type']
|
|
126
|
+
else
|
|
127
|
+
self.forwarder_type = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'enabled')
|
|
131
|
+
self.enabled = attributes[:'enabled']
|
|
132
|
+
else
|
|
133
|
+
self.enabled = true
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'filter')
|
|
137
|
+
if (value = attributes[:'filter']).is_a?(Hash)
|
|
138
|
+
self.filter = value
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'transform')
|
|
143
|
+
self.transform = attributes[:'transform']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'http')
|
|
147
|
+
self.http = attributes[:'http']
|
|
148
|
+
else
|
|
149
|
+
self.http = nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'slug')
|
|
153
|
+
self.slug = attributes[:'slug']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'created_at')
|
|
157
|
+
self.created_at = attributes[:'created_at']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'updated_at')
|
|
161
|
+
self.updated_at = attributes[:'updated_at']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'deleted_at')
|
|
165
|
+
self.deleted_at = attributes[:'deleted_at']
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'version')
|
|
169
|
+
self.version = attributes[:'version']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'data')
|
|
173
|
+
if (value = attributes[:'data']).is_a?(Hash)
|
|
174
|
+
self.data = value
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
180
|
+
# @return Array for valid properties with the reasons
|
|
181
|
+
def list_invalid_properties
|
|
182
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
183
|
+
invalid_properties = Array.new
|
|
184
|
+
if @name.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @name.to_s.length > 200
|
|
189
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @name.to_s.length < 1
|
|
193
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @forwarder_type.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "forwarder_type", forwarder_type cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if @forwarder_type.to_s.length < 1
|
|
201
|
+
invalid_properties.push('invalid value for "forwarder_type", the character length must be greater than or equal to 1.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if !@transform.nil? && @transform.to_s.length > 16384
|
|
205
|
+
invalid_properties.push('invalid value for "transform", the character length must be smaller than or equal to 16384.')
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if @http.nil?
|
|
209
|
+
invalid_properties.push('invalid value for "http", http cannot be nil.')
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
invalid_properties
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Check to see if the all the properties in the model are valid
|
|
216
|
+
# @return true if the model is valid
|
|
217
|
+
def valid?
|
|
218
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
219
|
+
return false if @name.nil?
|
|
220
|
+
return false if @name.to_s.length > 200
|
|
221
|
+
return false if @name.to_s.length < 1
|
|
222
|
+
return false if @forwarder_type.nil?
|
|
223
|
+
return false if @forwarder_type.to_s.length < 1
|
|
224
|
+
return false if !@transform.nil? && @transform.to_s.length > 16384
|
|
225
|
+
return false if @http.nil?
|
|
226
|
+
true
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Custom attribute writer method with validation
|
|
230
|
+
# @param [Object] name Value to be assigned
|
|
231
|
+
def name=(name)
|
|
232
|
+
if name.nil?
|
|
233
|
+
fail ArgumentError, 'name cannot be nil'
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if name.to_s.length > 200
|
|
237
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.'
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if name.to_s.length < 1
|
|
241
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
@name = name
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Custom attribute writer method with validation
|
|
248
|
+
# @param [Object] forwarder_type Value to be assigned
|
|
249
|
+
def forwarder_type=(forwarder_type)
|
|
250
|
+
if forwarder_type.nil?
|
|
251
|
+
fail ArgumentError, 'forwarder_type cannot be nil'
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
if forwarder_type.to_s.length < 1
|
|
255
|
+
fail ArgumentError, 'invalid value for "forwarder_type", the character length must be greater than or equal to 1.'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@forwarder_type = forwarder_type
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Custom attribute writer method with validation
|
|
262
|
+
# @param [Object] transform Value to be assigned
|
|
263
|
+
def transform=(transform)
|
|
264
|
+
if !transform.nil? && transform.to_s.length > 16384
|
|
265
|
+
fail ArgumentError, 'invalid value for "transform", the character length must be smaller than or equal to 16384.'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
@transform = transform
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Custom attribute writer method with validation
|
|
272
|
+
# @param [Object] http Value to be assigned
|
|
273
|
+
def http=(http)
|
|
274
|
+
if http.nil?
|
|
275
|
+
fail ArgumentError, 'http cannot be nil'
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
@http = http
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Checks equality by comparing each attribute.
|
|
282
|
+
# @param [Object] Object to be compared
|
|
283
|
+
def ==(o)
|
|
284
|
+
return true if self.equal?(o)
|
|
285
|
+
self.class == o.class &&
|
|
286
|
+
name == o.name &&
|
|
287
|
+
forwarder_type == o.forwarder_type &&
|
|
288
|
+
enabled == o.enabled &&
|
|
289
|
+
filter == o.filter &&
|
|
290
|
+
transform == o.transform &&
|
|
291
|
+
http == o.http &&
|
|
292
|
+
slug == o.slug &&
|
|
293
|
+
created_at == o.created_at &&
|
|
294
|
+
updated_at == o.updated_at &&
|
|
295
|
+
deleted_at == o.deleted_at &&
|
|
296
|
+
version == o.version &&
|
|
297
|
+
data == o.data
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# @see the `==` method
|
|
301
|
+
# @param [Object] Object to be compared
|
|
302
|
+
def eql?(o)
|
|
303
|
+
self == o
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Calculates hash code according to all attributes.
|
|
307
|
+
# @return [Integer] Hash code
|
|
308
|
+
def hash
|
|
309
|
+
[name, forwarder_type, enabled, filter, transform, http, slug, created_at, updated_at, deleted_at, version, data].hash
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Builds the object from hash
|
|
313
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
314
|
+
# @return [Object] Returns the model itself
|
|
315
|
+
def self.build_from_hash(attributes)
|
|
316
|
+
return nil unless attributes.is_a?(Hash)
|
|
317
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
318
|
+
transformed_hash = {}
|
|
319
|
+
openapi_types.each_pair do |key, type|
|
|
320
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
321
|
+
transformed_hash["#{key}"] = nil
|
|
322
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
323
|
+
# check to ensure the input is an array given that the attribute
|
|
324
|
+
# is documented as an array but the input is not
|
|
325
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
326
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
327
|
+
end
|
|
328
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
329
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
new(transformed_hash)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
# Returns the object in the form of hash
|
|
336
|
+
# @return [Hash] Returns the object in the form of hash
|
|
337
|
+
def to_hash
|
|
338
|
+
hash = {}
|
|
339
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
340
|
+
value = self.send(attr)
|
|
341
|
+
if value.nil?
|
|
342
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
343
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
hash[param] = _to_hash(value)
|
|
347
|
+
end
|
|
348
|
+
hash
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
end
|