Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4fdedca
Add changes
github-actions[bot] May 15, 2025
6fd202e
bumping versions (#76)
yandrickg May 15, 2025
7eb01f7
Release/v3.2.0 (#75)
valerioponte May 15, 2025
1fb6a65
Add changes
github-actions[bot] May 15, 2025
675d587
small fix
yandrickg May 15, 2025
93e1435
Merge remote-tracking branch 'origin/develop' into develop
yandrickg May 15, 2025
3e51cd9
Add changes
github-actions[bot] Jun 3, 2025
c1bc7d5
Add changes
github-actions[bot] Jun 4, 2025
70f69ed
Add changes
github-actions[bot] Jun 16, 2025
f26a4b9
Add changes
github-actions[bot] Jul 10, 2025
02f6380
Add changes
github-actions[bot] Jul 11, 2025
c21d22d
Add changes
github-actions[bot] Jul 17, 2025
71fc38a
Add changes
github-actions[bot] Jul 18, 2025
40af249
Add changes
github-actions[bot] Jul 21, 2025
fd93a35
Add changes
github-actions[bot] Jul 21, 2025
c9b6d27
Add changes
github-actions[bot] Jul 23, 2025
0021135
Add changes
github-actions[bot] Jul 24, 2025
680d7ca
Add changes
github-actions[bot] Jul 24, 2025
391767d
Add changes
github-actions[bot] Jul 30, 2025
33a3434
Add changes
github-actions[bot] Aug 4, 2025
419f69b
Add changes
github-actions[bot] Aug 5, 2025
2171970
Add changes
github-actions[bot] Aug 25, 2025
9dc8de9
Add changes
github-actions[bot] Aug 27, 2025
8c28cdd
Add changes
github-actions[bot] Sep 1, 2025
5acf801
Add changes
github-actions[bot] Sep 29, 2025
7b49f7e
Add changes
github-actions[bot] Oct 2, 2025
346a228
Add changes
github-actions[bot] Oct 22, 2025
461ae4b
Add changes
github-actions[bot] Oct 31, 2025
b62e152
Add changes
github-actions[bot] Nov 12, 2025
b6b6633
Add changes
github-actions[bot] Dec 2, 2025
f9a7845
Add changes
github-actions[bot] Dec 3, 2025
446d922
Add changes
github-actions[bot] Dec 4, 2025
2dbdc34
Add changes
github-actions[bot] Dec 9, 2025
355ef29
Add changes
github-actions[bot] Jan 6, 2026
f00ee7a
Add changes
github-actions[bot] Jan 8, 2026
83bdbd5
Add changes
github-actions[bot] Jan 29, 2026
e0e2f6c
Add changes
github-actions[bot] Jan 29, 2026
2839b80
Add changes
github-actions[bot] Jan 29, 2026
de4e07c
Add changes
github-actions[bot] Feb 3, 2026
eacecac
Add changes
github-actions[bot] Feb 16, 2026
35c4565
Add changes
github-actions[bot] Mar 5, 2026
7a22fe8
Add changes
github-actions[bot] Mar 16, 2026
a0f9a2b
Feature/bump openapi generator (#77)
fybJenkins Mar 25, 2026
69277e3
bumping versions and updating certain mustache templates
fybJenkins Mar 25, 2026
2ab0cd1
updated api client template
fybJenkins Mar 25, 2026
3e90e5d
Merge branch 'develop' of github.com:phoenixnap/ruby-sdk-bmc into dev…
fybJenkins Mar 25, 2026
92ce8ba
Add changes
github-actions[bot] Mar 25, 2026
282d7a7
Fixed tests and documented method of running them on NixOS
fybJenkins Mar 27, 2026
e1356b1
Merge branch 'master' into release/v4.0.0
fybJenkins Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ build-iPhoneSimulator/
/.bundle/
/vendor/bundle
/lib/bundler/man/
vendor

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Expand Down
2 changes: 1 addition & 1 deletion AuditApi/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.4
2.0.5
3 changes: 2 additions & 1 deletion AuditApi/lib/pnap_audit_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.2.0
Generator version: 7.20.0

=end

# Common files
require 'pnap_audit_api/api_client'
require 'pnap_audit_api/api_error'
require 'pnap_audit_api/api_model_base'
require 'pnap_audit_api/version'
require 'pnap_audit_api/configuration'

Expand Down
4 changes: 2 additions & 2 deletions AuditApi/lib/pnap_audit_api/api/events_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.2.0
Generator version: 7.20.0

=end

Expand Down Expand Up @@ -74,7 +74,7 @@ def events_get_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

# form parameters
form_params = opts[:form_params] || {}
Expand Down
31 changes: 17 additions & 14 deletions AuditApi/lib/pnap_audit_api/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.2.0
Generator version: 7.20.0

=end

Expand Down Expand Up @@ -52,7 +52,8 @@ def self.default
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
def call_api(http_method, path, opts = {})
request = build_request(http_method, path, opts)
tempfile = download_file(request) if opts[:return_type] == 'File'
tempfile = nil
(download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
response = request.run

if @config.debugging
Expand Down Expand Up @@ -191,19 +192,17 @@ def download_file(request)
chunk.force_encoding(encoding)
tempfile.write(chunk)
end
# run the request to ensure the tempfile is created successfully before returning it
request.run
if tempfile
request.on_complete do
if !tempfile
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
end
tempfile.close
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
"explicitly with `tempfile.delete`"
else
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
yield tempfile if block_given?
end

tempfile
end

# Check if the given MIME is a JSON MIME.
Expand All @@ -215,7 +214,7 @@ def download_file(request)
# @param [String] mime MIME
# @return [Boolean] True if the MIME is application/json
def json_mime?(mime)
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
end

# Deserialize the response to the given return type.
Expand Down Expand Up @@ -282,9 +281,13 @@ def convert_to_type(data, return_type)
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
end
else
# models (e.g. Pet) or oneOf
# models (e.g. Pet) or oneOf/anyOf
klass = AuditApi.const_get(return_type)
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
klass.build(data)
else
klass.build_from_hash(data)
end
end
end

Expand All @@ -294,7 +297,7 @@ def convert_to_type(data, return_type)
# @param [String] filename the filename to be sanitized
# @return [String] the sanitized filename
def sanitize_filename(filename)
filename.gsub(/.*[\/\\]/, '')
filename.split(/[\/\\]/).last
end

def build_request_url(path, opts = {})
Expand Down Expand Up @@ -394,4 +397,4 @@ def build_collection_param(param, collection_format)
end
end
end
end
end
2 changes: 1 addition & 1 deletion AuditApi/lib/pnap_audit_api/api_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.2.0
Generator version: 7.20.0

=end

Expand Down
88 changes: 88 additions & 0 deletions AuditApi/lib/pnap_audit_api/api_model_base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
=begin
#Audit Log API

#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>

The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
Generator version: 7.20.0

=end

module AuditApi
class ApiModelBase
# Deserializes the data based on type
# @param string type Data type
# @param string value Value to be deserialized
# @return [Object] Deserialized data
def self._deserialize(type, value)
case type.to_sym
when :Time
Time.parse(value)
when :Date
Date.parse(value)
when :String
value.to_s
when :Integer
value.to_i
when :Float
value.to_f
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
false
end
when :Object
# generic object (usually a Hash), return directly
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
k_type = Regexp.last_match[:k_type]
v_type = Regexp.last_match[:v_type]
{}.tap do |hash|
value.each do |k, v|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
end
end
else # model
# models (e.g. Pet) or oneOf
klass = AuditApi.const_get(type)
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
end
end

# Returns the string representation of the object
# @return [String] String presentation of the object
def to_s
to_hash.to_s
end

# to_body is an alias to to_hash (backward compatibility)
# @return [Hash] Returns the object in the form of hash
def to_body
to_hash
end

# Outputs non-array value in the form of hash
# For object, use to_hash. Otherwise, just return the value
# @param [Object] value Any valid value
# @return [Hash] Returns the value in the form of hash
def _to_hash(value)
if value.is_a?(Array)
value.compact.map { |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end
end
end
12 changes: 11 additions & 1 deletion AuditApi/lib/pnap_audit_api/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 1.0
Contact: support@phoenixnap.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.2.0
Generator version: 7.20.0

=end

Expand Down Expand Up @@ -79,6 +79,14 @@ class Configuration
# @return [true, false]
attr_accessor :debugging

# Set this to ignore operation servers for the API client. This is useful when you need to
# send requests to a different server than the one specified in the OpenAPI document.
# Will default to the base url defined in the spec but can be overridden by setting
# `scheme`, `host`, `base_path` directly.
# Default to false.
# @return [true, false]
attr_accessor :ignore_operation_servers

# Defines the logger used for debugging.
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
#
Expand Down Expand Up @@ -166,6 +174,7 @@ def initialize
@timeout = 0
@params_encoding = nil
@debugging = false
@ignore_operation_servers = false
@inject_format = false
@force_ending_format = false
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
Expand Down Expand Up @@ -200,6 +209,7 @@ def base_path=(base_path)

# Returns base URL for specified operation based on server settings
def base_url(operation = nil)
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
if operation_server_settings.key?(operation) then
index = server_operation_index.fetch(operation, server_index)
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
Expand Down
Loading
Loading