pnap_audit_api 1.0.5 → 2.0.0

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.
@@ -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: 5.4.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -22,24 +22,26 @@ describe AuditApi::Event do
22
22
 
23
23
  describe 'test an instance of Event' do
24
24
  it 'should create an instance of Event' do
25
- expect(instance).to be_instance_of(AuditApi::Event)
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(AuditApi::Event)
26
27
  end
27
28
  end
29
+
28
30
  describe 'test attribute "name"' do
29
31
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
33
  end
32
34
  end
33
35
 
34
36
  describe 'test attribute "timestamp"' do
35
37
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
37
39
  end
38
40
  end
39
41
 
40
42
  describe 'test attribute "user_info"' do
41
43
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
45
  end
44
46
  end
45
47
 
@@ -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: 5.4.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -22,24 +22,26 @@ describe AuditApi::UserInfo do
22
22
 
23
23
  describe 'test an instance of UserInfo' do
24
24
  it 'should create an instance of UserInfo' do
25
- expect(instance).to be_instance_of(AuditApi::UserInfo)
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(AuditApi::UserInfo)
26
27
  end
27
28
  end
29
+
28
30
  describe 'test attribute "account_id"' do
29
31
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
31
33
  end
32
34
  end
33
35
 
34
36
  describe 'test attribute "client_id"' do
35
37
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
37
39
  end
38
40
  end
39
41
 
40
42
  describe 'test attribute "username"' do
41
43
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
45
  end
44
46
  end
45
47
 
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: 6.1.0
9
+ OpenAPI Generator version: 7.2.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: 1.0.5
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhoenixNAP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-25 00:00:00.000000000 Z
11
+ date: 2024-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -61,40 +61,23 @@ files:
61
61
  - README.md
62
62
  - Rakefile
63
63
  - VERSION
64
- - docs/ApiAction.md
65
- - docs/ApiActionAllOf.md
66
64
  - docs/Error.md
67
65
  - docs/Event.md
68
66
  - docs/EventsApi.md
69
- - docs/Headers.md
70
- - docs/Request.md
71
- - docs/Response.md
72
67
  - docs/UserInfo.md
73
68
  - lib/pnap_audit_api.rb
74
69
  - lib/pnap_audit_api/api/events_api.rb
75
70
  - lib/pnap_audit_api/api_client.rb
76
71
  - lib/pnap_audit_api/api_error.rb
77
72
  - lib/pnap_audit_api/configuration.rb
78
- - lib/pnap_audit_api/models/api_action.rb
79
- - lib/pnap_audit_api/models/api_action_all_of.rb
80
73
  - lib/pnap_audit_api/models/error.rb
81
74
  - lib/pnap_audit_api/models/event.rb
82
- - lib/pnap_audit_api/models/headers.rb
83
- - lib/pnap_audit_api/models/request.rb
84
- - lib/pnap_audit_api/models/response.rb
85
75
  - lib/pnap_audit_api/models/user_info.rb
86
76
  - lib/pnap_audit_api/version.rb
87
77
  - pnap_audit_api.gemspec
88
78
  - spec/api/events_api_spec.rb
89
- - spec/api_client_spec.rb
90
- - spec/configuration_spec.rb
91
- - spec/models/api_action_all_of_spec.rb
92
- - spec/models/api_action_spec.rb
93
79
  - spec/models/error_spec.rb
94
80
  - spec/models/event_spec.rb
95
- - spec/models/headers_spec.rb
96
- - spec/models/request_spec.rb
97
- - spec/models/response_spec.rb
98
81
  - spec/models/user_info_spec.rb
99
82
  - spec/spec_helper.rb
100
83
  homepage: https://phoenixnap.com/bare-metal-cloud
@@ -110,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
93
  requirements:
111
94
  - - ">="
112
95
  - !ruby/object:Gem::Version
113
- version: '2.4'
96
+ version: '2.7'
114
97
  required_rubygems_version: !ruby/object:Gem::Requirement
115
98
  requirements:
116
99
  - - ">="
@@ -123,14 +106,7 @@ specification_version: 4
123
106
  summary: Audit Log API Ruby Gem
124
107
  test_files:
125
108
  - spec/api/events_api_spec.rb
126
- - spec/api_client_spec.rb
127
- - spec/configuration_spec.rb
128
- - spec/models/api_action_all_of_spec.rb
129
109
  - spec/models/error_spec.rb
130
- - spec/models/headers_spec.rb
131
- - spec/models/response_spec.rb
132
110
  - spec/models/user_info_spec.rb
133
- - spec/models/api_action_spec.rb
134
- - spec/models/request_spec.rb
135
111
  - spec/models/event_spec.rb
136
112
  - spec/spec_helper.rb
data/docs/ApiAction.md DELETED
@@ -1,26 +0,0 @@
1
- # AuditApi::ApiAction
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **name** | **String** | The name of the event. | [optional] |
8
- | **timestamp** | **Time** | The UTC time the event initiated. | |
9
- | **user_info** | [**UserInfo**](UserInfo.md) | | |
10
- | **response** | [**Response**](Response.md) | | |
11
- | **request** | [**Request**](Request.md) | | |
12
-
13
- ## Example
14
-
15
- ```ruby
16
- require 'pnap_audit_api'
17
-
18
- instance = AuditApi::ApiAction.new(
19
- name: API.CreateServer,
20
- timestamp: null,
21
- user_info: null,
22
- response: null,
23
- request: null
24
- )
25
- ```
26
-
@@ -1,20 +0,0 @@
1
- # AuditApi::ApiActionAllOf
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **response** | [**Response**](Response.md) | | |
8
- | **request** | [**Request**](Request.md) | | |
9
-
10
- ## Example
11
-
12
- ```ruby
13
- require 'pnap_audit_api'
14
-
15
- instance = AuditApi::ApiActionAllOf.new(
16
- response: null,
17
- request: null
18
- )
19
- ```
20
-
data/docs/Headers.md DELETED
@@ -1,18 +0,0 @@
1
- # AuditApi::Headers
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **user_agent** | **String** | The UA String | |
8
-
9
- ## Example
10
-
11
- ```ruby
12
- require 'pnap_audit_api'
13
-
14
- instance = AuditApi::Headers.new(
15
- user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
16
- )
17
- ```
18
-
data/docs/Request.md DELETED
@@ -1,22 +0,0 @@
1
- # AuditApi::Request
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **headers** | [**Headers**](Headers.md) | | |
8
- | **uri** | **String** | The request URI. | |
9
- | **verb** | **String** | The HTTP request verb. | |
10
-
11
- ## Example
12
-
13
- ```ruby
14
- require 'pnap_audit_api'
15
-
16
- instance = AuditApi::Request.new(
17
- headers: null,
18
- uri: /v1/servers/jghf757HGhjghg,
19
- verb: PATCH
20
- )
21
- ```
22
-
data/docs/Response.md DELETED
@@ -1,20 +0,0 @@
1
- # AuditApi::Response
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **status_code** | **Integer** | The status code returned in the response sent to the API. | |
8
- | **resource_id** | **String** | The ID of the resource that was created. | [optional] |
9
-
10
- ## Example
11
-
12
- ```ruby
13
- require 'pnap_audit_api'
14
-
15
- instance = AuditApi::Response.new(
16
- status_code: 200,
17
- resource_id: 5edf1c9b4215748ac543d721
18
- )
19
- ```
20
-
@@ -1,284 +0,0 @@
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
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module AuditApi
17
- class ApiAction
18
- # The name of the event.
19
- attr_accessor :name
20
-
21
- # The UTC time the event initiated.
22
- attr_accessor :timestamp
23
-
24
- attr_accessor :user_info
25
-
26
- attr_accessor :response
27
-
28
- attr_accessor :request
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- :'name' => :'name',
34
- :'timestamp' => :'timestamp',
35
- :'user_info' => :'userInfo',
36
- :'response' => :'response',
37
- :'request' => :'request'
38
- }
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'name' => :'String',
50
- :'timestamp' => :'Time',
51
- :'user_info' => :'UserInfo',
52
- :'response' => :'Response',
53
- :'request' => :'Request'
54
- }
55
- end
56
-
57
- # List of attributes with nullable: true
58
- def self.openapi_nullable
59
- Set.new([
60
- ])
61
- end
62
-
63
- # List of class defined in allOf (OpenAPI v3)
64
- def self.openapi_all_of
65
- [
66
- :'ApiActionAllOf',
67
- :'Event'
68
- ]
69
- end
70
-
71
- # Initializes the object
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- def initialize(attributes = {})
74
- if (!attributes.is_a?(Hash))
75
- fail ArgumentError, "The input argument (attributes) must be a hash in `AuditApi::ApiAction` initialize method"
76
- end
77
-
78
- # check to see if the attribute exists and convert string to symbol for hash key
79
- attributes = attributes.each_with_object({}) { |(k, v), h|
80
- if (!self.class.attribute_map.key?(k.to_sym))
81
- fail ArgumentError, "`#{k}` is not a valid attribute in `AuditApi::ApiAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
- end
83
- h[k.to_sym] = v
84
- }
85
-
86
- if attributes.key?(:'name')
87
- self.name = attributes[:'name']
88
- end
89
-
90
- if attributes.key?(:'timestamp')
91
- self.timestamp = attributes[:'timestamp']
92
- end
93
-
94
- if attributes.key?(:'user_info')
95
- self.user_info = attributes[:'user_info']
96
- end
97
-
98
- if attributes.key?(:'response')
99
- self.response = attributes[:'response']
100
- end
101
-
102
- if attributes.key?(:'request')
103
- self.request = attributes[:'request']
104
- end
105
- end
106
-
107
- # Show invalid properties with the reasons. Usually used together with valid?
108
- # @return Array for valid properties with the reasons
109
- def list_invalid_properties
110
- invalid_properties = Array.new
111
- if @timestamp.nil?
112
- invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
113
- end
114
-
115
- if @user_info.nil?
116
- invalid_properties.push('invalid value for "user_info", user_info cannot be nil.')
117
- end
118
-
119
- if @response.nil?
120
- invalid_properties.push('invalid value for "response", response cannot be nil.')
121
- end
122
-
123
- if @request.nil?
124
- invalid_properties.push('invalid value for "request", request cannot be nil.')
125
- end
126
-
127
- invalid_properties
128
- end
129
-
130
- # Check to see if the all the properties in the model are valid
131
- # @return true if the model is valid
132
- def valid?
133
- return false if @timestamp.nil?
134
- return false if @user_info.nil?
135
- return false if @response.nil?
136
- return false if @request.nil?
137
- true
138
- end
139
-
140
- # Checks equality by comparing each attribute.
141
- # @param [Object] Object to be compared
142
- def ==(o)
143
- return true if self.equal?(o)
144
- self.class == o.class &&
145
- name == o.name &&
146
- timestamp == o.timestamp &&
147
- user_info == o.user_info &&
148
- response == o.response &&
149
- request == o.request
150
- end
151
-
152
- # @see the `==` method
153
- # @param [Object] Object to be compared
154
- def eql?(o)
155
- self == o
156
- end
157
-
158
- # Calculates hash code according to all attributes.
159
- # @return [Integer] Hash code
160
- def hash
161
- [name, timestamp, user_info, response, request].hash
162
- end
163
-
164
- # Builds the object from hash
165
- # @param [Hash] attributes Model attributes in the form of hash
166
- # @return [Object] Returns the model itself
167
- def self.build_from_hash(attributes)
168
- new.build_from_hash(attributes)
169
- end
170
-
171
- # Builds the object from hash
172
- # @param [Hash] attributes Model attributes in the form of hash
173
- # @return [Object] Returns the model itself
174
- def build_from_hash(attributes)
175
- return nil unless attributes.is_a?(Hash)
176
- self.class.openapi_types.each_pair do |key, type|
177
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
178
- self.send("#{key}=", nil)
179
- elsif type =~ /\AArray<(.*)>/i
180
- # check to ensure the input is an array given that the attribute
181
- # is documented as an array but the input is not
182
- if attributes[self.class.attribute_map[key]].is_a?(Array)
183
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
184
- end
185
- elsif !attributes[self.class.attribute_map[key]].nil?
186
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
187
- end
188
- end
189
-
190
- self
191
- end
192
-
193
- # Deserializes the data based on type
194
- # @param string type Data type
195
- # @param string value Value to be deserialized
196
- # @return [Object] Deserialized data
197
- def _deserialize(type, value)
198
- case type.to_sym
199
- when :Time
200
- Time.parse(value)
201
- when :Date
202
- Date.parse(value)
203
- when :String
204
- value.to_s
205
- when :Integer
206
- value.to_i
207
- when :Float
208
- value.to_f
209
- when :Boolean
210
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
211
- true
212
- else
213
- false
214
- end
215
- when :Object
216
- # generic object (usually a Hash), return directly
217
- value
218
- when /\AArray<(?<inner_type>.+)>\z/
219
- inner_type = Regexp.last_match[:inner_type]
220
- value.map { |v| _deserialize(inner_type, v) }
221
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
222
- k_type = Regexp.last_match[:k_type]
223
- v_type = Regexp.last_match[:v_type]
224
- {}.tap do |hash|
225
- value.each do |k, v|
226
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
227
- end
228
- end
229
- else # model
230
- # models (e.g. Pet) or oneOf
231
- klass = AuditApi.const_get(type)
232
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
233
- end
234
- end
235
-
236
- # Returns the string representation of the object
237
- # @return [String] String presentation of the object
238
- def to_s
239
- to_hash.to_s
240
- end
241
-
242
- # to_body is an alias to to_hash (backward compatibility)
243
- # @return [Hash] Returns the object in the form of hash
244
- def to_body
245
- to_hash
246
- end
247
-
248
- # Returns the object in the form of hash
249
- # @return [Hash] Returns the object in the form of hash
250
- def to_hash
251
- hash = {}
252
- self.class.attribute_map.each_pair do |attr, param|
253
- value = self.send(attr)
254
- if value.nil?
255
- is_nullable = self.class.openapi_nullable.include?(attr)
256
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
257
- end
258
-
259
- hash[param] = _to_hash(value)
260
- end
261
- hash
262
- end
263
-
264
- # Outputs non-array value in the form of hash
265
- # For object, use to_hash. Otherwise, just return the value
266
- # @param [Object] value Any valid value
267
- # @return [Hash] Returns the value in the form of hash
268
- def _to_hash(value)
269
- if value.is_a?(Array)
270
- value.compact.map { |v| _to_hash(v) }
271
- elsif value.is_a?(Hash)
272
- {}.tap do |hash|
273
- value.each { |k, v| hash[k] = _to_hash(v) }
274
- end
275
- elsif value.respond_to? :to_hash
276
- value.to_hash
277
- else
278
- value
279
- end
280
- end
281
-
282
- end
283
-
284
- end