pnap_audit_api 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20e3b1de279ef64a62acb4d78fbd580b2d95843a5558e8941e6279bd567fd301
4
- data.tar.gz: 9ccdff869d7fe2769214b8d39fd6d32a073011da0bac9fc1b5e84031a7aa84b9
3
+ metadata.gz: 3f24e4665f5dfd83397e089392663cac9b0cffc97ef08f6f02ae6105227dc421
4
+ data.tar.gz: 3ea159f4c6df4c3e54e2b333ac2e8e73f7e93501e81deb6fd04cf0a588891e08
5
5
  SHA512:
6
- metadata.gz: 203fc91f5204ec57f64d53620428cd757afef0397afe769646045a32f3d2029b2a467cf52cf80923f07ba70be07f17d92d58de87b543a8ab67dfa238c0f2c344
7
- data.tar.gz: 026dfe7b69e8940c8964b8fad75ba325cc8595d635a59a4dd19db22b59e945f54a5b3ec20da4c098c430070cb857e46bda0e46b634ab78f4dc1f6df823966e58
6
+ metadata.gz: dca9588228cd4e3a763cf304bb70524f608d32bd7965af58b3a064ee08faefa21829956ae78af108b5427a1f7082b16395d46a9993e6047015b126e8ce42f646
7
+ data.tar.gz: 3ab1cb19f9027f815651dce139cd7a80c8994e0711d789665c0812680bb6403c229e90b4da4e7a40574e874ae8d927758b0f9c51a7ce30c201b43a53c5310c9c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.5
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -74,7 +74,7 @@ module AuditApi
74
74
  # header parameters
75
75
  header_params = opts[:header_params] || {}
76
76
  # HTTP header 'Accept' (if needed)
77
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
77
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
78
78
 
79
79
  # form parameters
80
80
  form_params = opts[:form_params] || {}
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -52,7 +52,8 @@ module AuditApi
52
52
  # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
53
53
  def call_api(http_method, path, opts = {})
54
54
  request = build_request(http_method, path, opts)
55
- tempfile = download_file(request) if opts[:return_type] == 'File'
55
+ tempfile = nil
56
+ (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
56
57
  response = request.run
57
58
 
58
59
  if @config.debugging
@@ -191,19 +192,17 @@ module AuditApi
191
192
  chunk.force_encoding(encoding)
192
193
  tempfile.write(chunk)
193
194
  end
194
- # run the request to ensure the tempfile is created successfully before returning it
195
- request.run
196
- if tempfile
195
+ request.on_complete do
196
+ if !tempfile
197
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
198
+ end
197
199
  tempfile.close
198
200
  @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
199
201
  "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
200
202
  "will be deleted automatically with GC. It's also recommended to delete the temp file "\
201
203
  "explicitly with `tempfile.delete`"
202
- else
203
- fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
204
+ yield tempfile if block_given?
204
205
  end
205
-
206
- tempfile
207
206
  end
208
207
 
209
208
  # Check if the given MIME is a JSON MIME.
@@ -215,7 +214,7 @@ module AuditApi
215
214
  # @param [String] mime MIME
216
215
  # @return [Boolean] True if the MIME is application/json
217
216
  def json_mime?(mime)
218
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
217
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
219
218
  end
220
219
 
221
220
  # Deserialize the response to the given return type.
@@ -282,9 +281,13 @@ module AuditApi
282
281
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
283
282
  end
284
283
  else
285
- # models (e.g. Pet) or oneOf
284
+ # models (e.g. Pet) or oneOf/anyOf
286
285
  klass = AuditApi.const_get(return_type)
287
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
286
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
287
+ klass.build(data)
288
+ else
289
+ klass.build_from_hash(data)
290
+ end
288
291
  end
289
292
  end
290
293
 
@@ -294,7 +297,7 @@ module AuditApi
294
297
  # @param [String] filename the filename to be sanitized
295
298
  # @return [String] the sanitized filename
296
299
  def sanitize_filename(filename)
297
- filename.gsub(/.*[\/\\]/, '')
300
+ filename.split(/[\/\\]/).last
298
301
  end
299
302
 
300
303
  def build_request_url(path, opts = {})
@@ -394,4 +397,4 @@ module AuditApi
394
397
  end
395
398
  end
396
399
  end
397
- end
400
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,88 @@
1
+ =begin
2
+ #Audit Log API
3
+
4
+ #The Audit Logs API lets you read audit log entries and track API calls or activities in the Bare Metal Cloud Portal.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#audit-log-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/audit/v1/)</b>
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@phoenixnap.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.20.0
10
+
11
+ =end
12
+
13
+ module AuditApi
14
+ class ApiModelBase
15
+ # Deserializes the data based on type
16
+ # @param string type Data type
17
+ # @param string value Value to be deserialized
18
+ # @return [Object] Deserialized data
19
+ def self._deserialize(type, value)
20
+ case type.to_sym
21
+ when :Time
22
+ Time.parse(value)
23
+ when :Date
24
+ Date.parse(value)
25
+ when :String
26
+ value.to_s
27
+ when :Integer
28
+ value.to_i
29
+ when :Float
30
+ value.to_f
31
+ when :Boolean
32
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
33
+ true
34
+ else
35
+ false
36
+ end
37
+ when :Object
38
+ # generic object (usually a Hash), return directly
39
+ value
40
+ when /\AArray<(?<inner_type>.+)>\z/
41
+ inner_type = Regexp.last_match[:inner_type]
42
+ value.map { |v| _deserialize(inner_type, v) }
43
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
44
+ k_type = Regexp.last_match[:k_type]
45
+ v_type = Regexp.last_match[:v_type]
46
+ {}.tap do |hash|
47
+ value.each do |k, v|
48
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
49
+ end
50
+ end
51
+ else # model
52
+ # models (e.g. Pet) or oneOf
53
+ klass = AuditApi.const_get(type)
54
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
55
+ end
56
+ end
57
+
58
+ # Returns the string representation of the object
59
+ # @return [String] String presentation of the object
60
+ def to_s
61
+ to_hash.to_s
62
+ end
63
+
64
+ # to_body is an alias to to_hash (backward compatibility)
65
+ # @return [Hash] Returns the object in the form of hash
66
+ def to_body
67
+ to_hash
68
+ end
69
+
70
+ # Outputs non-array value in the form of hash
71
+ # For object, use to_hash. Otherwise, just return the value
72
+ # @param [Object] value Any valid value
73
+ # @return [Hash] Returns the value in the form of hash
74
+ def _to_hash(value)
75
+ if value.is_a?(Array)
76
+ value.compact.map { |v| _to_hash(v) }
77
+ elsif value.is_a?(Hash)
78
+ {}.tap do |hash|
79
+ value.each { |k, v| hash[k] = _to_hash(v) }
80
+ end
81
+ elsif value.respond_to? :to_hash
82
+ value.to_hash
83
+ else
84
+ value
85
+ end
86
+ end
87
+ end
88
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -79,6 +79,14 @@ module AuditApi
79
79
  # @return [true, false]
80
80
  attr_accessor :debugging
81
81
 
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
82
90
  # Defines the logger used for debugging.
83
91
  # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
84
92
  #
@@ -166,6 +174,7 @@ module AuditApi
166
174
  @timeout = 0
167
175
  @params_encoding = nil
168
176
  @debugging = false
177
+ @ignore_operation_servers = false
169
178
  @inject_format = false
170
179
  @force_ending_format = false
171
180
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -200,6 +209,7 @@ module AuditApi
200
209
 
201
210
  # Returns base URL for specified operation based on server settings
202
211
  def base_url(operation = nil)
212
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
203
213
  if operation_server_settings.key?(operation) then
204
214
  index = server_operation_index.fetch(operation, server_index)
205
215
  server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module AuditApi
17
- class Error
17
+ class Error < ApiModelBase
18
18
  # The description detailing the cause of the error code.
19
19
  attr_accessor :message
20
20
 
@@ -29,9 +29,14 @@ module AuditApi
29
29
  }
30
30
  end
31
31
 
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
32
37
  # Returns all the JSON keys this model knows about
33
38
  def self.acceptable_attributes
34
- attribute_map.values
39
+ acceptable_attribute_map.values
35
40
  end
36
41
 
37
42
  # Attribute type mapping.
@@ -56,9 +61,10 @@ module AuditApi
56
61
  end
57
62
 
58
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
59
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
68
  end
63
69
  h[k.to_sym] = v
64
70
  }
@@ -96,6 +102,16 @@ module AuditApi
96
102
  true
97
103
  end
98
104
 
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] message Value to be assigned
107
+ def message=(message)
108
+ if message.nil?
109
+ fail ArgumentError, 'message cannot be nil'
110
+ end
111
+
112
+ @message = message
113
+ end
114
+
99
115
  # Checks equality by comparing each attribute.
100
116
  # @param [Object] Object to be compared
101
117
  def ==(o)
@@ -140,61 +156,6 @@ module AuditApi
140
156
  new(transformed_hash)
141
157
  end
142
158
 
143
- # Deserializes the data based on type
144
- # @param string type Data type
145
- # @param string value Value to be deserialized
146
- # @return [Object] Deserialized data
147
- def self._deserialize(type, value)
148
- case type.to_sym
149
- when :Time
150
- Time.parse(value)
151
- when :Date
152
- Date.parse(value)
153
- when :String
154
- value.to_s
155
- when :Integer
156
- value.to_i
157
- when :Float
158
- value.to_f
159
- when :Boolean
160
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
- true
162
- else
163
- false
164
- end
165
- when :Object
166
- # generic object (usually a Hash), return directly
167
- value
168
- when /\AArray<(?<inner_type>.+)>\z/
169
- inner_type = Regexp.last_match[:inner_type]
170
- value.map { |v| _deserialize(inner_type, v) }
171
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
- k_type = Regexp.last_match[:k_type]
173
- v_type = Regexp.last_match[:v_type]
174
- {}.tap do |hash|
175
- value.each do |k, v|
176
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
- end
178
- end
179
- else # model
180
- # models (e.g. Pet) or oneOf
181
- klass = AuditApi.const_get(type)
182
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
- end
184
- end
185
-
186
- # Returns the string representation of the object
187
- # @return [String] String presentation of the object
188
- def to_s
189
- to_hash.to_s
190
- end
191
-
192
- # to_body is an alias to to_hash (backward compatibility)
193
- # @return [Hash] Returns the object in the form of hash
194
- def to_body
195
- to_hash
196
- end
197
-
198
159
  # Returns the object in the form of hash
199
160
  # @return [Hash] Returns the object in the form of hash
200
161
  def to_hash
@@ -211,24 +172,6 @@ module AuditApi
211
172
  hash
212
173
  end
213
174
 
214
- # Outputs non-array value in the form of hash
215
- # For object, use to_hash. Otherwise, just return the value
216
- # @param [Object] value Any valid value
217
- # @return [Hash] Returns the value in the form of hash
218
- def _to_hash(value)
219
- if value.is_a?(Array)
220
- value.compact.map { |v| _to_hash(v) }
221
- elsif value.is_a?(Hash)
222
- {}.tap do |hash|
223
- value.each { |k, v| hash[k] = _to_hash(v) }
224
- end
225
- elsif value.respond_to? :to_hash
226
- value.to_hash
227
- else
228
- value
229
- end
230
- end
231
-
232
175
  end
233
176
 
234
177
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module AuditApi
17
17
  # The event log.
18
- class Event
18
+ class Event < ApiModelBase
19
19
  # The name of the event.
20
20
  attr_accessor :name
21
21
 
@@ -33,9 +33,14 @@ module AuditApi
33
33
  }
34
34
  end
35
35
 
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
36
41
  # Returns all the JSON keys this model knows about
37
42
  def self.acceptable_attributes
38
- attribute_map.values
43
+ acceptable_attribute_map.values
39
44
  end
40
45
 
41
46
  # Attribute type mapping.
@@ -61,9 +66,10 @@ module AuditApi
61
66
  end
62
67
 
63
68
  # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::Event`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
73
  end
68
74
  h[k.to_sym] = v
69
75
  }
@@ -110,6 +116,26 @@ module AuditApi
110
116
  true
111
117
  end
112
118
 
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] timestamp Value to be assigned
121
+ def timestamp=(timestamp)
122
+ if timestamp.nil?
123
+ fail ArgumentError, 'timestamp cannot be nil'
124
+ end
125
+
126
+ @timestamp = timestamp
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] user_info Value to be assigned
131
+ def user_info=(user_info)
132
+ if user_info.nil?
133
+ fail ArgumentError, 'user_info cannot be nil'
134
+ end
135
+
136
+ @user_info = user_info
137
+ end
138
+
113
139
  # Checks equality by comparing each attribute.
114
140
  # @param [Object] Object to be compared
115
141
  def ==(o)
@@ -155,61 +181,6 @@ module AuditApi
155
181
  new(transformed_hash)
156
182
  end
157
183
 
158
- # Deserializes the data based on type
159
- # @param string type Data type
160
- # @param string value Value to be deserialized
161
- # @return [Object] Deserialized data
162
- def self._deserialize(type, value)
163
- case type.to_sym
164
- when :Time
165
- Time.parse(value)
166
- when :Date
167
- Date.parse(value)
168
- when :String
169
- value.to_s
170
- when :Integer
171
- value.to_i
172
- when :Float
173
- value.to_f
174
- when :Boolean
175
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
- true
177
- else
178
- false
179
- end
180
- when :Object
181
- # generic object (usually a Hash), return directly
182
- value
183
- when /\AArray<(?<inner_type>.+)>\z/
184
- inner_type = Regexp.last_match[:inner_type]
185
- value.map { |v| _deserialize(inner_type, v) }
186
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
- k_type = Regexp.last_match[:k_type]
188
- v_type = Regexp.last_match[:v_type]
189
- {}.tap do |hash|
190
- value.each do |k, v|
191
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
- end
193
- end
194
- else # model
195
- # models (e.g. Pet) or oneOf
196
- klass = AuditApi.const_get(type)
197
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
- end
199
- end
200
-
201
- # Returns the string representation of the object
202
- # @return [String] String presentation of the object
203
- def to_s
204
- to_hash.to_s
205
- end
206
-
207
- # to_body is an alias to to_hash (backward compatibility)
208
- # @return [Hash] Returns the object in the form of hash
209
- def to_body
210
- to_hash
211
- end
212
-
213
184
  # Returns the object in the form of hash
214
185
  # @return [Hash] Returns the object in the form of hash
215
186
  def to_hash
@@ -226,24 +197,6 @@ module AuditApi
226
197
  hash
227
198
  end
228
199
 
229
- # Outputs non-array value in the form of hash
230
- # For object, use to_hash. Otherwise, just return the value
231
- # @param [Object] value Any valid value
232
- # @return [Hash] Returns the value in the form of hash
233
- def _to_hash(value)
234
- if value.is_a?(Array)
235
- value.compact.map { |v| _to_hash(v) }
236
- elsif value.is_a?(Hash)
237
- {}.tap do |hash|
238
- value.each { |k, v| hash[k] = _to_hash(v) }
239
- end
240
- elsif value.respond_to? :to_hash
241
- value.to_hash
242
- else
243
- value
244
- end
245
- end
246
-
247
200
  end
248
201
 
249
202
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module AuditApi
17
17
  # Details related to the user / application performing this request
18
- class UserInfo
18
+ class UserInfo < ApiModelBase
19
19
  # The BMC account ID
20
20
  attr_accessor :account_id
21
21
 
@@ -34,9 +34,14 @@ module AuditApi
34
34
  }
35
35
  end
36
36
 
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
37
42
  # Returns all the JSON keys this model knows about
38
43
  def self.acceptable_attributes
39
- attribute_map.values
44
+ acceptable_attribute_map.values
40
45
  end
41
46
 
42
47
  # Attribute type mapping.
@@ -62,9 +67,10 @@ module AuditApi
62
67
  end
63
68
 
64
69
  # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::UserInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::UserInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
74
  end
69
75
  h[k.to_sym] = v
70
76
  }
@@ -111,6 +117,26 @@ module AuditApi
111
117
  true
112
118
  end
113
119
 
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] account_id Value to be assigned
122
+ def account_id=(account_id)
123
+ if account_id.nil?
124
+ fail ArgumentError, 'account_id cannot be nil'
125
+ end
126
+
127
+ @account_id = account_id
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] username Value to be assigned
132
+ def username=(username)
133
+ if username.nil?
134
+ fail ArgumentError, 'username cannot be nil'
135
+ end
136
+
137
+ @username = username
138
+ end
139
+
114
140
  # Checks equality by comparing each attribute.
115
141
  # @param [Object] Object to be compared
116
142
  def ==(o)
@@ -156,61 +182,6 @@ module AuditApi
156
182
  new(transformed_hash)
157
183
  end
158
184
 
159
- # Deserializes the data based on type
160
- # @param string type Data type
161
- # @param string value Value to be deserialized
162
- # @return [Object] Deserialized data
163
- def self._deserialize(type, value)
164
- case type.to_sym
165
- when :Time
166
- Time.parse(value)
167
- when :Date
168
- Date.parse(value)
169
- when :String
170
- value.to_s
171
- when :Integer
172
- value.to_i
173
- when :Float
174
- value.to_f
175
- when :Boolean
176
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
- true
178
- else
179
- false
180
- end
181
- when :Object
182
- # generic object (usually a Hash), return directly
183
- value
184
- when /\AArray<(?<inner_type>.+)>\z/
185
- inner_type = Regexp.last_match[:inner_type]
186
- value.map { |v| _deserialize(inner_type, v) }
187
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
- k_type = Regexp.last_match[:k_type]
189
- v_type = Regexp.last_match[:v_type]
190
- {}.tap do |hash|
191
- value.each do |k, v|
192
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
- end
194
- end
195
- else # model
196
- # models (e.g. Pet) or oneOf
197
- klass = AuditApi.const_get(type)
198
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
- end
200
- end
201
-
202
- # Returns the string representation of the object
203
- # @return [String] String presentation of the object
204
- def to_s
205
- to_hash.to_s
206
- end
207
-
208
- # to_body is an alias to to_hash (backward compatibility)
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_body
211
- to_hash
212
- end
213
-
214
185
  # Returns the object in the form of hash
215
186
  # @return [Hash] Returns the object in the form of hash
216
187
  def to_hash
@@ -227,24 +198,6 @@ module AuditApi
227
198
  hash
228
199
  end
229
200
 
230
- # Outputs non-array value in the form of hash
231
- # For object, use to_hash. Otherwise, just return the value
232
- # @param [Object] value Any valid value
233
- # @return [Hash] Returns the value in the form of hash
234
- def _to_hash(value)
235
- if value.is_a?(Array)
236
- value.compact.map { |v| _to_hash(v) }
237
- elsif value.is_a?(Hash)
238
- {}.tap do |hash|
239
- value.each { |k, v| hash[k] = _to_hash(v) }
240
- end
241
- elsif value.respond_to? :to_hash
242
- value.to_hash
243
- else
244
- value
245
- end
246
- end
247
-
248
201
  end
249
202
 
250
203
  end
@@ -6,8 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
10
-
9
+ Generator version: 7.20.0
11
10
  =end
12
11
 
13
12
  def get_version()
@@ -6,13 +6,14 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
13
13
  # Common files
14
14
  require 'pnap_audit_api/api_client'
15
15
  require 'pnap_audit_api/api_error'
16
+ require 'pnap_audit_api/api_model_base'
16
17
  require 'pnap_audit_api/version'
17
18
  require 'pnap_audit_api/configuration'
18
19
 
@@ -8,7 +8,7 @@
8
8
  The version of the OpenAPI document: 1.0
9
9
  Contact: support@phoenixnap.com
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 7.2.0
11
+ Generator version: 7.20.0
12
12
 
13
13
  =end
14
14
 
@@ -19,14 +19,14 @@ Gem::Specification.new do |s|
19
19
  s.name = "pnap_audit_api"
20
20
  s.version = AuditApi::VERSION
21
21
  s.platform = Gem::Platform::RUBY
22
- s.authors = ["PhoenixNAP"]
22
+ s.authors = ["OpenAPI-Generator"]
23
23
  s.email = ["support@phoenixnap.com"]
24
- s.homepage = "https://phoenixnap.com/bare-metal-cloud"
24
+ s.homepage = "https://openapi-generator.tech"
25
25
  s.summary = "Audit Log API Ruby Gem"
26
- s.description = "Audit Log API Ruby Gem"
26
+ s.description = "The Audit Logs API lets you read audit log entries and track API calls or activities in the Bare Metal Cloud Portal.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#audit-log-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/audit/v1/)</b> "
27
27
  s.license = "MPL-2.0"
28
28
  s.required_ruby_version = ">= 2.7"
29
- s.metadata = { "source_code_uri" => "https://github.com/phoenixnap/ruby-sdk-bmc" }
29
+ s.metadata = {}
30
30
 
31
31
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
32
32
 
@@ -36,4 +36,4 @@ Gem::Specification.new do |s|
36
36
  s.test_files = `find spec/*`.split("\n")
37
37
  s.executables = []
38
38
  s.require_paths = ["lib"]
39
- end
39
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe AuditApi::Error do
21
- let(:instance) { AuditApi::Error.new }
21
+ #let(:instance) { AuditApi::Error.new }
22
22
 
23
23
  describe 'test an instance of Error' do
24
24
  it 'should create an instance of Error' do
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe AuditApi::Event do
21
- let(:instance) { AuditApi::Event.new }
21
+ #let(:instance) { AuditApi::Event.new }
22
22
 
23
23
  describe 'test an instance of Event' do
24
24
  it 'should create an instance of Event' do
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe AuditApi::UserInfo do
21
- let(:instance) { AuditApi::UserInfo.new }
21
+ #let(:instance) { AuditApi::UserInfo.new }
22
22
 
23
23
  describe 'test an instance of UserInfo' do
24
24
  it 'should create an instance of UserInfo' do
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pnap_audit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - PhoenixNAP
7
+ - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-12 00:00:00.000000000 Z
11
+ date: 2026-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -50,7 +50,10 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.6.0
53
- description: Audit Log API Ruby Gem
53
+ description: 'The Audit Logs API lets you read audit log entries and track API calls
54
+ or activities in the Bare Metal Cloud Portal.<br> <br> <span class=''pnap-api-knowledge-base-link''>
55
+ Knowledge base articles to help you can be found <a href=''https://phoenixnap.com/kb/bmc-server-management-via-api#audit-log-api''
56
+ target=''_blank''>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/audit/v1/)</b> '
54
57
  email:
55
58
  - support@phoenixnap.com
56
59
  executables: []
@@ -69,6 +72,7 @@ files:
69
72
  - lib/pnap_audit_api/api/events_api.rb
70
73
  - lib/pnap_audit_api/api_client.rb
71
74
  - lib/pnap_audit_api/api_error.rb
75
+ - lib/pnap_audit_api/api_model_base.rb
72
76
  - lib/pnap_audit_api/configuration.rb
73
77
  - lib/pnap_audit_api/models/error.rb
74
78
  - lib/pnap_audit_api/models/event.rb
@@ -80,11 +84,10 @@ files:
80
84
  - spec/models/event_spec.rb
81
85
  - spec/models/user_info_spec.rb
82
86
  - spec/spec_helper.rb
83
- homepage: https://phoenixnap.com/bare-metal-cloud
87
+ homepage: https://openapi-generator.tech
84
88
  licenses:
85
89
  - MPL-2.0
86
- metadata:
87
- source_code_uri: https://github.com/phoenixnap/ruby-sdk-bmc
90
+ metadata: {}
88
91
  post_install_message:
89
92
  rdoc_options: []
90
93
  require_paths: