smplkit 2.0.4 → 2.0.6
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 +159 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/functions_api.rb +90 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/resource_types_api.rb +159 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_attributes.rb +192 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_list_links.rb +148 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_list_meta.rb +164 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_list_response.rb +202 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_resource.rb +202 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb +23 -10
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_type.rb +45 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_attributes.rb +192 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_list_links.rb +148 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_list_meta.rb +164 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_list_response.rb +202 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_resource.rb +202 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_response.rb +201 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_tables_summary.rb +348 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +16 -0
- data/lib/smplkit/_generated/audit/spec/api/actions_api_spec.rb +62 -0
- data/lib/smplkit/_generated/audit/spec/api/functions_api_spec.rb +47 -0
- data/lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb +62 -0
- data/lib/smplkit/_generated/audit/spec/models/action_attributes_spec.rb +42 -0
- data/lib/smplkit/_generated/audit/spec/models/action_list_links_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/action_list_meta_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/action_list_response_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/action_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_type_spec.rb +30 -0
- data/lib/smplkit/_generated/audit/spec/models/resource_type_attributes_spec.rb +42 -0
- data/lib/smplkit/_generated/audit/spec/models/resource_type_list_links_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/resource_type_list_meta_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/resource_type_list_response_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/resource_type_resource_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/wipe_response_spec.rb +48 -0
- data/lib/smplkit/_generated/audit/spec/models/wipe_tables_summary_spec.rb +66 -0
- metadata +33 -1
|
@@ -40,6 +40,28 @@ module SmplkitGeneratedClient::Audit
|
|
|
40
40
|
|
|
41
41
|
attr_accessor :data
|
|
42
42
|
|
|
43
|
+
class EnumAttributeValidator
|
|
44
|
+
attr_reader :datatype
|
|
45
|
+
attr_reader :allowable_values
|
|
46
|
+
|
|
47
|
+
def initialize(datatype, allowable_values)
|
|
48
|
+
@allowable_values = allowable_values.map do |value|
|
|
49
|
+
case datatype.to_s
|
|
50
|
+
when /Integer/i
|
|
51
|
+
value.to_i
|
|
52
|
+
when /Float/i
|
|
53
|
+
value.to_f
|
|
54
|
+
else
|
|
55
|
+
value
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def valid?(value)
|
|
61
|
+
!value || allowable_values.include?(value)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
43
65
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
66
|
def self.attribute_map
|
|
45
67
|
{
|
|
@@ -72,7 +94,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
72
94
|
def self.openapi_types
|
|
73
95
|
{
|
|
74
96
|
:'name' => :'String',
|
|
75
|
-
:'forwarder_type' => :'
|
|
97
|
+
:'forwarder_type' => :'ForwarderType',
|
|
76
98
|
:'enabled' => :'Boolean',
|
|
77
99
|
:'filter' => :'Hash<String, Object>',
|
|
78
100
|
:'transform' => :'String',
|
|
@@ -197,10 +219,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
197
219
|
invalid_properties.push('invalid value for "forwarder_type", forwarder_type cannot be nil.')
|
|
198
220
|
end
|
|
199
221
|
|
|
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
222
|
if !@transform.nil? && @transform.to_s.length > 16384
|
|
205
223
|
invalid_properties.push('invalid value for "transform", the character length must be smaller than or equal to 16384.')
|
|
206
224
|
end
|
|
@@ -220,7 +238,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
220
238
|
return false if @name.to_s.length > 200
|
|
221
239
|
return false if @name.to_s.length < 1
|
|
222
240
|
return false if @forwarder_type.nil?
|
|
223
|
-
return false if @forwarder_type.to_s.length < 1
|
|
224
241
|
return false if !@transform.nil? && @transform.to_s.length > 16384
|
|
225
242
|
return false if @http.nil?
|
|
226
243
|
true
|
|
@@ -251,10 +268,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
251
268
|
fail ArgumentError, 'forwarder_type cannot be nil'
|
|
252
269
|
end
|
|
253
270
|
|
|
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
271
|
@forwarder_type = forwarder_type
|
|
259
272
|
end
|
|
260
273
|
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
class ForwarderType
|
|
18
|
+
HTTP = "http".freeze
|
|
19
|
+
DATADOG = "datadog".freeze
|
|
20
|
+
SPLUNK_HEC = "splunk_hec".freeze
|
|
21
|
+
SUMO_LOGIC = "sumo_logic".freeze
|
|
22
|
+
NEW_RELIC = "new_relic".freeze
|
|
23
|
+
HONEYCOMB = "honeycomb".freeze
|
|
24
|
+
ELASTIC = "elastic".freeze
|
|
25
|
+
|
|
26
|
+
def self.all_vars
|
|
27
|
+
@all_vars ||= [HTTP, DATADOG, SPLUNK_HEC, SUMO_LOGIC, NEW_RELIC, HONEYCOMB, ELASTIC].freeze
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Builds the enum from string
|
|
31
|
+
# @param [String] The enum value in the form of the string
|
|
32
|
+
# @return [String] The enum value
|
|
33
|
+
def self.build_from_hash(value)
|
|
34
|
+
new.build_from_hash(value)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Builds the enum from string
|
|
38
|
+
# @param [String] The enum value in the form of the string
|
|
39
|
+
# @return [String] The enum value
|
|
40
|
+
def build_from_hash(value)
|
|
41
|
+
return value if ForwarderType.all_vars.include?(value)
|
|
42
|
+
raise "Invalid ENUM value #{value} for class #ForwarderType"
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,192 @@
|
|
|
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
|
+
class ResourceTypeAttributes < ApiModelBase
|
|
18
|
+
# The resource_type slug. Same as the JSON:API ``id``.
|
|
19
|
+
attr_accessor :resource_type
|
|
20
|
+
|
|
21
|
+
# First sighting of this resource_type for the account.
|
|
22
|
+
attr_accessor :created_at
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'resource_type' => :'resource_type',
|
|
28
|
+
:'created_at' => :'created_at'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'resource_type' => :'String',
|
|
46
|
+
:'created_at' => :'Time'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::ResourceTypeAttributes` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::ResourceTypeAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'resource_type')
|
|
73
|
+
self.resource_type = attributes[:'resource_type']
|
|
74
|
+
else
|
|
75
|
+
self.resource_type = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'created_at')
|
|
79
|
+
self.created_at = attributes[:'created_at']
|
|
80
|
+
else
|
|
81
|
+
self.created_at = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @resource_type.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if @created_at.nil?
|
|
95
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
invalid_properties
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Check to see if the all the properties in the model are valid
|
|
102
|
+
# @return true if the model is valid
|
|
103
|
+
def valid?
|
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
+
return false if @resource_type.nil?
|
|
106
|
+
return false if @created_at.nil?
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Custom attribute writer method with validation
|
|
111
|
+
# @param [Object] resource_type Value to be assigned
|
|
112
|
+
def resource_type=(resource_type)
|
|
113
|
+
if resource_type.nil?
|
|
114
|
+
fail ArgumentError, 'resource_type cannot be nil'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@resource_type = resource_type
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] created_at Value to be assigned
|
|
122
|
+
def created_at=(created_at)
|
|
123
|
+
if created_at.nil?
|
|
124
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@created_at = created_at
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Checks equality by comparing each attribute.
|
|
131
|
+
# @param [Object] Object to be compared
|
|
132
|
+
def ==(o)
|
|
133
|
+
return true if self.equal?(o)
|
|
134
|
+
self.class == o.class &&
|
|
135
|
+
resource_type == o.resource_type &&
|
|
136
|
+
created_at == o.created_at
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# @see the `==` method
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def eql?(o)
|
|
142
|
+
self == o
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Calculates hash code according to all attributes.
|
|
146
|
+
# @return [Integer] Hash code
|
|
147
|
+
def hash
|
|
148
|
+
[resource_type, created_at].hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Builds the object from hash
|
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
153
|
+
# @return [Object] Returns the model itself
|
|
154
|
+
def self.build_from_hash(attributes)
|
|
155
|
+
return nil unless attributes.is_a?(Hash)
|
|
156
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
157
|
+
transformed_hash = {}
|
|
158
|
+
openapi_types.each_pair do |key, type|
|
|
159
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = nil
|
|
161
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
162
|
+
# check to ensure the input is an array given that the attribute
|
|
163
|
+
# is documented as an array but the input is not
|
|
164
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
165
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
166
|
+
end
|
|
167
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
168
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
new(transformed_hash)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the object in the form of hash
|
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
|
176
|
+
def to_hash
|
|
177
|
+
hash = {}
|
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
179
|
+
value = self.send(attr)
|
|
180
|
+
if value.nil?
|
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
hash[param] = _to_hash(value)
|
|
186
|
+
end
|
|
187
|
+
hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
end
|
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
class ResourceTypeListLinks < ApiModelBase
|
|
18
|
+
attr_accessor :_next
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'_next' => :'next'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'_next' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
:'_next'
|
|
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::ResourceTypeListLinks` 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::ResourceTypeListLinks`. 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?(:'_next')
|
|
68
|
+
self._next = attributes[:'_next']
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
73
|
+
# @return Array for valid properties with the reasons
|
|
74
|
+
def list_invalid_properties
|
|
75
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
76
|
+
invalid_properties = Array.new
|
|
77
|
+
invalid_properties
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Check to see if the all the properties in the model are valid
|
|
81
|
+
# @return true if the model is valid
|
|
82
|
+
def valid?
|
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
84
|
+
true
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Checks equality by comparing each attribute.
|
|
88
|
+
# @param [Object] Object to be compared
|
|
89
|
+
def ==(o)
|
|
90
|
+
return true if self.equal?(o)
|
|
91
|
+
self.class == o.class &&
|
|
92
|
+
_next == o._next
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# @see the `==` method
|
|
96
|
+
# @param [Object] Object to be compared
|
|
97
|
+
def eql?(o)
|
|
98
|
+
self == o
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Calculates hash code according to all attributes.
|
|
102
|
+
# @return [Integer] Hash code
|
|
103
|
+
def hash
|
|
104
|
+
[_next].hash
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Builds the object from hash
|
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
|
+
# @return [Object] Returns the model itself
|
|
110
|
+
def self.build_from_hash(attributes)
|
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
113
|
+
transformed_hash = {}
|
|
114
|
+
openapi_types.each_pair do |key, type|
|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
116
|
+
transformed_hash["#{key}"] = nil
|
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
118
|
+
# check to ensure the input is an array given that the attribute
|
|
119
|
+
# is documented as an array but the input is not
|
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
121
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
122
|
+
end
|
|
123
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
new(transformed_hash)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Returns the object in the form of hash
|
|
131
|
+
# @return [Hash] Returns the object in the form of hash
|
|
132
|
+
def to_hash
|
|
133
|
+
hash = {}
|
|
134
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
135
|
+
value = self.send(attr)
|
|
136
|
+
if value.nil?
|
|
137
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
138
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
hash[param] = _to_hash(value)
|
|
142
|
+
end
|
|
143
|
+
hash
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
class ResourceTypeListMeta < ApiModelBase
|
|
18
|
+
attr_accessor :page_size
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'page_size' => :'page_size'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'page_size' => :'Integer'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::ResourceTypeListMeta` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::ResourceTypeListMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'page_size')
|
|
67
|
+
self.page_size = attributes[:'page_size']
|
|
68
|
+
else
|
|
69
|
+
self.page_size = nil
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @page_size.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "page_size", page_size cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
+
return false if @page_size.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] page_size Value to be assigned
|
|
95
|
+
def page_size=(page_size)
|
|
96
|
+
if page_size.nil?
|
|
97
|
+
fail ArgumentError, 'page_size cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@page_size = page_size
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
page_size == o.page_size
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see the `==` method
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def eql?(o)
|
|
114
|
+
self == o
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Calculates hash code according to all attributes.
|
|
118
|
+
# @return [Integer] Hash code
|
|
119
|
+
def hash
|
|
120
|
+
[page_size].hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def self.build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
transformed_hash = {}
|
|
130
|
+
openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = nil
|
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
134
|
+
# check to ensure the input is an array given that the attribute
|
|
135
|
+
# is documented as an array but the input is not
|
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
new(transformed_hash)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the object in the form of hash
|
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
|
148
|
+
def to_hash
|
|
149
|
+
hash = {}
|
|
150
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
151
|
+
value = self.send(attr)
|
|
152
|
+
if value.nil?
|
|
153
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
154
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
hash[param] = _to_hash(value)
|
|
158
|
+
end
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|