added in microsoft exchange release scraper
This commit is contained in:
parent
47b51b2d87
commit
f9cff52fb2
166 changed files with 17008 additions and 1 deletions
81
tools/microsoft/app_build_number_cpe_mapper/exchange.rb
Normal file
81
tools/microsoft/app_build_number_cpe_mapper/exchange.rb
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
# this will scrape the following:
|
||||||
|
# https://learn.microsoft.com/en-us/exchange/new-features/build-numbers-and-release-dates
|
||||||
|
|
||||||
|
require 'nokogiri'
|
||||||
|
require 'json'
|
||||||
|
require 'rest-client'
|
||||||
|
|
||||||
|
|
||||||
|
class MicrosoftExchangeReleaseInfo
|
||||||
|
attr_accessor :url
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
@url = 'https://learn.microsoft.com/en-us/exchange/new-features/build-numbers-and-release-dates'
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def get
|
||||||
|
r = RestClient::Request.execute(
|
||||||
|
:method => :get,
|
||||||
|
:url => url
|
||||||
|
)
|
||||||
|
if r.code == 200
|
||||||
|
r.body
|
||||||
|
else
|
||||||
|
puts "HTTP Code: #{r.code}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_html(html)
|
||||||
|
Nokogiri::HTML(html)
|
||||||
|
end
|
||||||
|
|
||||||
|
def headings(html_doc)
|
||||||
|
html_doc.xpath("//table").first.xpath('./thead/tr').text.split("\n").drop(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
def table_nodes(html_doc)
|
||||||
|
html_doc.xpath("//table")
|
||||||
|
end
|
||||||
|
|
||||||
|
def table_records(table_node)
|
||||||
|
table_node.xpath("./tbody/tr")
|
||||||
|
end
|
||||||
|
|
||||||
|
def data_from_table(tr)
|
||||||
|
tds = tr.xpath("./td")
|
||||||
|
|
||||||
|
# NO BREAK SPACE removal with the gsub \u00A0. thx msft
|
||||||
|
# only happens if there is a URL linking to the kb for a product_name
|
||||||
|
product_name_text = tds[0].xpath("./a").children.text.gsub("\u00A0", "")
|
||||||
|
if product_name_text.empty?
|
||||||
|
product_name_text = tds[0].text
|
||||||
|
end
|
||||||
|
|
||||||
|
kb_url = tds[0]&.xpath("./a/@href").text
|
||||||
|
release_date = tds[1]&.text
|
||||||
|
build_num_short = tds[2]&.text
|
||||||
|
build_num_long = tds[3]&.text
|
||||||
|
|
||||||
|
{
|
||||||
|
:product_name => product_name_text,
|
||||||
|
:kb_url => kb_url,
|
||||||
|
:release_date => release_date,
|
||||||
|
:build_num_short => build_num_short,
|
||||||
|
:build_num_long => build_num_long
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def main
|
||||||
|
html = get
|
||||||
|
doc = parse_html(html)
|
||||||
|
tables = table_nodes(doc)
|
||||||
|
tables.map do |table_node|
|
||||||
|
trs = table_records(table_node)
|
||||||
|
trs.map do |tr|
|
||||||
|
data_from_table(tr)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
require '../microsoft_cvrf_client.rb'
|
require '../cvrf/microsoft_cvrf_client.rb'
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
|
|
39
tools/microsoft/cvrf/ruby-client/.gitignore
vendored
Normal file
39
tools/microsoft/cvrf/ruby-client/.gitignore
vendored
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# Generated by: https://openapi-generator.tech
|
||||||
|
#
|
||||||
|
|
||||||
|
*.gem
|
||||||
|
*.rbc
|
||||||
|
/.config
|
||||||
|
/coverage/
|
||||||
|
/InstalledFiles
|
||||||
|
/pkg/
|
||||||
|
/spec/reports/
|
||||||
|
/spec/examples.txt
|
||||||
|
/test/tmp/
|
||||||
|
/test/version_tmp/
|
||||||
|
/tmp/
|
||||||
|
|
||||||
|
## Specific to RubyMotion:
|
||||||
|
.dat*
|
||||||
|
.repl_history
|
||||||
|
build/
|
||||||
|
|
||||||
|
## Documentation cache and generated files:
|
||||||
|
/.yardoc/
|
||||||
|
/_yardoc/
|
||||||
|
/doc/
|
||||||
|
/rdoc/
|
||||||
|
|
||||||
|
## Environment normalization:
|
||||||
|
/.bundle/
|
||||||
|
/vendor/bundle
|
||||||
|
/lib/bundler/man/
|
||||||
|
|
||||||
|
# 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:
|
||||||
|
# Gemfile.lock
|
||||||
|
# .ruby-version
|
||||||
|
# .ruby-gemset
|
||||||
|
|
||||||
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
||||||
|
.rvmrc
|
23
tools/microsoft/cvrf/ruby-client/.openapi-generator-ignore
Normal file
23
tools/microsoft/cvrf/ruby-client/.openapi-generator-ignore
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
159
tools/microsoft/cvrf/ruby-client/.openapi-generator/FILES
Normal file
159
tools/microsoft/cvrf/ruby-client/.openapi-generator/FILES
Normal file
|
@ -0,0 +1,159 @@
|
||||||
|
.gitignore
|
||||||
|
.openapi-generator-ignore
|
||||||
|
.rspec
|
||||||
|
.rubocop.yml
|
||||||
|
.travis.yml
|
||||||
|
Gemfile
|
||||||
|
README.md
|
||||||
|
Rakefile
|
||||||
|
docs/CvrfReturnTypes200.md
|
||||||
|
docs/CvrfReturnTypes200Acknowledgements.md
|
||||||
|
docs/CvrfReturnTypes200AffectedFiles.md
|
||||||
|
docs/CvrfReturnTypes200CVSSScoreSets.md
|
||||||
|
docs/CvrfReturnTypes200DocumentNotes.md
|
||||||
|
docs/CvrfReturnTypes200DocumentPublisher.md
|
||||||
|
docs/CvrfReturnTypes200DocumentTitle.md
|
||||||
|
docs/CvrfReturnTypes200DocumentTracking.md
|
||||||
|
docs/CvrfReturnTypes200DocumentTrackingIdentification.md
|
||||||
|
docs/CvrfReturnTypes200DocumentTrackingRevisionHistory.md
|
||||||
|
docs/CvrfReturnTypes200Notes.md
|
||||||
|
docs/CvrfReturnTypes200ProductStatuses.md
|
||||||
|
docs/CvrfReturnTypes200ProductTree.md
|
||||||
|
docs/CvrfReturnTypes200ProductTreeBranch.md
|
||||||
|
docs/CvrfReturnTypes200ProductTreeItems.md
|
||||||
|
docs/CvrfReturnTypes200ProductTreeItems1.md
|
||||||
|
docs/CvrfReturnTypes200Remediations.md
|
||||||
|
docs/CvrfReturnTypes200Threats.md
|
||||||
|
docs/CvrfReturnTypes200Vulnerability.md
|
||||||
|
docs/CvrfReturnTypes200Xml.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdoc.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocDocumentNotes.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocDocumentPublisher.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocDocumentTracking.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocNote.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocProductTree.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocProductTreeBranch.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocProductTreeBranch1.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerability.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat.md
|
||||||
|
docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats.md
|
||||||
|
docs/DefaultApi.md
|
||||||
|
docs/UpdatesReturnTypes200.md
|
||||||
|
docs/UpdatesReturnTypes200Value.md
|
||||||
|
git_push.sh
|
||||||
|
lib/openapi_client.rb
|
||||||
|
lib/openapi_client/api/default_api.rb
|
||||||
|
lib/openapi_client/api_client.rb
|
||||||
|
lib/openapi_client/api_error.rb
|
||||||
|
lib/openapi_client/configuration.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_acknowledgements.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_affected_files.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_cvss_score_sets.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_document_notes.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_document_publisher.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_document_title.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_document_tracking.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_document_tracking_identification.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_document_tracking_revision_history.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_notes.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_product_statuses.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_product_tree.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_product_tree_branch.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_product_tree_items.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_product_tree_items1.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_remediations.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_threats.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_vulnerability.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_notes.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_publisher.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_identification.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_revision_history.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_revision_history_revision.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_note.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_branch.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_branch1.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_full_product_name.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_full_product_name1.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_acknowledgements.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_affected_files.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_cvss_score_sets.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_notes.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_notes_note.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_product_statuses.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_remediations.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_revision_history.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_threat.rb
|
||||||
|
lib/openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_threats.rb
|
||||||
|
lib/openapi_client/models/updates_return_types200.rb
|
||||||
|
lib/openapi_client/models/updates_return_types200_value.rb
|
||||||
|
lib/openapi_client/version.rb
|
||||||
|
openapi_client.gemspec
|
||||||
|
spec/api/default_api_spec.rb
|
||||||
|
spec/api_client_spec.rb
|
||||||
|
spec/configuration_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_acknowledgements_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_affected_files_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_cvss_score_sets_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_document_notes_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_document_publisher_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_document_title_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_document_tracking_identification_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_document_tracking_revision_history_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_document_tracking_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_notes_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_product_statuses_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_product_tree_branch_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_product_tree_items1_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_product_tree_items_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_product_tree_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_remediations_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_threats_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_vulnerability_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_document_notes_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_document_publisher_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_identification_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_revision_history_revision_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_revision_history_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_note_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_product_tree_branch1_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_product_tree_branch_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_product_tree_full_product_name1_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_product_tree_full_product_name_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_product_tree_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_acknowledgements_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_affected_files_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_cvss_score_sets_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_notes_note_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_notes_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_product_statuses_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_remediations_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_revision_history_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_threat_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_threats_spec.rb
|
||||||
|
spec/models/cvrf_return_types200_xml_spec.rb
|
||||||
|
spec/models/updates_return_types200_spec.rb
|
||||||
|
spec/models/updates_return_types200_value_spec.rb
|
||||||
|
spec/spec_helper.rb
|
|
@ -0,0 +1 @@
|
||||||
|
5.2.0-SNAPSHOT
|
2
tools/microsoft/cvrf/ruby-client/.rspec
Normal file
2
tools/microsoft/cvrf/ruby-client/.rspec
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
--color
|
||||||
|
--require spec_helper
|
148
tools/microsoft/cvrf/ruby-client/.rubocop.yml
Normal file
148
tools/microsoft/cvrf/ruby-client/.rubocop.yml
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
|
||||||
|
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
AllCops:
|
||||||
|
TargetRubyVersion: 2.4
|
||||||
|
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
||||||
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||||
|
DisabledByDefault: true
|
||||||
|
Exclude:
|
||||||
|
- '**/templates/**/*'
|
||||||
|
- '**/vendor/**/*'
|
||||||
|
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
||||||
|
|
||||||
|
# Prefer &&/|| over and/or.
|
||||||
|
Style/AndOr:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Align `when` with `case`.
|
||||||
|
Layout/CaseIndentation:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Align comments with method definitions.
|
||||||
|
Layout/CommentIndentation:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/ElseAlignment:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/EmptyLineAfterMagicComment:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# In a regular class definition, no empty lines around the body.
|
||||||
|
Layout/EmptyLinesAroundClassBody:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# In a regular method definition, no empty lines around the body.
|
||||||
|
Layout/EmptyLinesAroundMethodBody:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# In a regular module definition, no empty lines around the body.
|
||||||
|
Layout/EmptyLinesAroundModuleBody:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/FirstArgumentIndentation:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||||
|
Style/HashSyntax:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Method definitions after `private` or `protected` isolated calls need one
|
||||||
|
# extra level of indentation.
|
||||||
|
Layout/IndentationConsistency:
|
||||||
|
Enabled: true
|
||||||
|
EnforcedStyle: indented_internal_methods
|
||||||
|
|
||||||
|
# Two spaces, no tabs (for indentation).
|
||||||
|
Layout/IndentationWidth:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/LeadingCommentSpace:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceAfterColon:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceAfterComma:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceAroundEqualsInParameterDefault:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceAroundKeyword:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceAroundOperators:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceBeforeComma:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceBeforeFirstArg:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/DefWithParentheses:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Defining a method with parameters needs parentheses.
|
||||||
|
Style/MethodDefParentheses:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
|
EnforcedStyle: always
|
||||||
|
|
||||||
|
# Use `foo {}` not `foo{}`.
|
||||||
|
Layout/SpaceBeforeBlockBraces:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Use `foo { bar }` not `foo {bar}`.
|
||||||
|
Layout/SpaceInsideBlockBraces:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Use `{ a: 1 }` not `{a:1}`.
|
||||||
|
Layout/SpaceInsideHashLiteralBraces:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceInsideParens:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Check quotes usage according to lint rule below.
|
||||||
|
#Style/StringLiterals:
|
||||||
|
# Enabled: true
|
||||||
|
# EnforcedStyle: single_quotes
|
||||||
|
|
||||||
|
# Detect hard tabs, no hard tabs.
|
||||||
|
Layout/IndentationStyle:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Blank lines should not have any spaces.
|
||||||
|
Layout/TrailingEmptyLines:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# No trailing whitespace.
|
||||||
|
Layout/TrailingWhitespace:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Use quotes for string literals when they are enough.
|
||||||
|
Style/RedundantPercentQ:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Align `end` with the matching keyword or starting expression except for
|
||||||
|
# assignments, where it should be aligned with the LHS.
|
||||||
|
Layout/EndAlignment:
|
||||||
|
Enabled: true
|
||||||
|
EnforcedStyleAlignWith: variable
|
||||||
|
AutoCorrect: true
|
||||||
|
|
||||||
|
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
||||||
|
Lint/RequireParentheses:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/RedundantReturn:
|
||||||
|
Enabled: true
|
||||||
|
AllowMultipleReturnValues: true
|
||||||
|
|
||||||
|
Style/Semicolon:
|
||||||
|
Enabled: true
|
||||||
|
AllowAsExpressionSeparator: true
|
11
tools/microsoft/cvrf/ruby-client/.travis.yml
Normal file
11
tools/microsoft/cvrf/ruby-client/.travis.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
language: ruby
|
||||||
|
cache: bundler
|
||||||
|
rvm:
|
||||||
|
- 2.3
|
||||||
|
- 2.4
|
||||||
|
- 2.5
|
||||||
|
script:
|
||||||
|
- bundle install --path vendor/bundle
|
||||||
|
- bundle exec rspec
|
||||||
|
- gem build openapi_client.gemspec
|
||||||
|
- gem install ./openapi_client-1.0.0.gem
|
9
tools/microsoft/cvrf/ruby-client/Gemfile
Normal file
9
tools/microsoft/cvrf/ruby-client/Gemfile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gemspec
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
gem 'rake', '~> 13.0.1'
|
||||||
|
gem 'pry-byebug'
|
||||||
|
gem 'rubocop', '~> 0.66.0'
|
||||||
|
end
|
137
tools/microsoft/cvrf/ruby-client/README.md
Normal file
137
tools/microsoft/cvrf/ruby-client/README.md
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
# openapi_client
|
||||||
|
|
||||||
|
OpenapiClient - the Ruby gem for the Microsoft Security Updates API
|
||||||
|
|
||||||
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Build a gem
|
||||||
|
|
||||||
|
To build the Ruby code into a gem:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gem build openapi_client.gemspec
|
||||||
|
```
|
||||||
|
|
||||||
|
Then either install the gem locally:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gem install ./openapi_client-1.0.0.gem
|
||||||
|
```
|
||||||
|
|
||||||
|
(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
|
||||||
|
|
||||||
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
||||||
|
|
||||||
|
Finally add this to the Gemfile:
|
||||||
|
|
||||||
|
gem 'openapi_client', '~> 1.0.0'
|
||||||
|
|
||||||
|
### Install from Git
|
||||||
|
|
||||||
|
If the Ruby gem is hosted at a git repository: https:///YOUR_GIT_USERNAME/YOUR_GIT_REPO, then add the following in the Gemfile:
|
||||||
|
|
||||||
|
gem 'openapi_client', :git => 'https:///YOUR_GIT_USERNAME/YOUR_GIT_REPO.git'
|
||||||
|
|
||||||
|
### Include the Ruby code directly
|
||||||
|
|
||||||
|
Include the Ruby code directly using `-I` as follows:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
ruby -Ilib script.rb
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation](#installation) procedure and then run the following code:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
# Load the gem
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
api_instance = OpenapiClient::DefaultApi.new
|
||||||
|
api_version = 'api_version_example' # String |
|
||||||
|
api_key = 'api_key_example' # String |
|
||||||
|
id = 'id_example' # String |
|
||||||
|
|
||||||
|
begin
|
||||||
|
result = api_instance.cvrf_id_get(api_version, api_key, id)
|
||||||
|
p result
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Exception when calling DefaultApi->cvrf_id_get: #{e}"
|
||||||
|
end
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *https://api.msrc.microsoft.com*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*OpenapiClient::DefaultApi* | [**cvrf_id_get**](docs/DefaultApi.md#cvrf_id_get) | **GET** /cvrf/{id} |
|
||||||
|
*OpenapiClient::DefaultApi* | [**updates_get**](docs/DefaultApi.md#updates_get) | **GET** /Updates |
|
||||||
|
*OpenapiClient::DefaultApi* | [**updates_id_get**](docs/DefaultApi.md#updates_id_get) | **GET** /Updates('{id}') |
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200](docs/CvrfReturnTypes200.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200Acknowledgements](docs/CvrfReturnTypes200Acknowledgements.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200AffectedFiles](docs/CvrfReturnTypes200AffectedFiles.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200CVSSScoreSets](docs/CvrfReturnTypes200CVSSScoreSets.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200DocumentNotes](docs/CvrfReturnTypes200DocumentNotes.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200DocumentPublisher](docs/CvrfReturnTypes200DocumentPublisher.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200DocumentTitle](docs/CvrfReturnTypes200DocumentTitle.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200DocumentTracking](docs/CvrfReturnTypes200DocumentTracking.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200DocumentTrackingIdentification](docs/CvrfReturnTypes200DocumentTrackingIdentification.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200DocumentTrackingRevisionHistory](docs/CvrfReturnTypes200DocumentTrackingRevisionHistory.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200Notes](docs/CvrfReturnTypes200Notes.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200ProductStatuses](docs/CvrfReturnTypes200ProductStatuses.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200ProductTree](docs/CvrfReturnTypes200ProductTree.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200ProductTreeBranch](docs/CvrfReturnTypes200ProductTreeBranch.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200ProductTreeItems](docs/CvrfReturnTypes200ProductTreeItems.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200ProductTreeItems1](docs/CvrfReturnTypes200ProductTreeItems1.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200Remediations](docs/CvrfReturnTypes200Remediations.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200Threats](docs/CvrfReturnTypes200Threats.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200Vulnerability](docs/CvrfReturnTypes200Vulnerability.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200Xml](docs/CvrfReturnTypes200Xml.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdoc](docs/CvrfReturnTypes200XmlCvrfdoc.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentNotes](docs/CvrfReturnTypes200XmlCvrfdocDocumentNotes.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentPublisher](docs/CvrfReturnTypes200XmlCvrfdocDocumentPublisher.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTracking](docs/CvrfReturnTypes200XmlCvrfdocDocumentTracking.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification](docs/CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory](docs/CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision](docs/CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocNote](docs/CvrfReturnTypes200XmlCvrfdocNote.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTree](docs/CvrfReturnTypes200XmlCvrfdocProductTree.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch](docs/CvrfReturnTypes200XmlCvrfdocProductTreeBranch.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch1](docs/CvrfReturnTypes200XmlCvrfdocProductTreeBranch1.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName](docs/CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1](docs/CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerability](docs/CvrfReturnTypes200XmlCvrfdocVulnerability.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat.md)
|
||||||
|
- [OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats](docs/CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats.md)
|
||||||
|
- [OpenapiClient::UpdatesReturnTypes200](docs/UpdatesReturnTypes200.md)
|
||||||
|
- [OpenapiClient::UpdatesReturnTypes200Value](docs/UpdatesReturnTypes200Value.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
All endpoints do not require authorization.
|
||||||
|
|
10
tools/microsoft/cvrf/ruby-client/Rakefile
Normal file
10
tools/microsoft/cvrf/ruby-client/Rakefile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require "bundler/gem_tasks"
|
||||||
|
|
||||||
|
begin
|
||||||
|
require 'rspec/core/rake_task'
|
||||||
|
|
||||||
|
RSpec::Core::RakeTask.new(:spec)
|
||||||
|
task default: :spec
|
||||||
|
rescue LoadError
|
||||||
|
# no rspec available
|
||||||
|
end
|
30
tools/microsoft/cvrf/ruby-client/docs/CvrfReturnTypes200.md
Normal file
30
tools/microsoft/cvrf/ruby-client/docs/CvrfReturnTypes200.md
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **document_title** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **document_type** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **document_publisher** | [**CvrfReturnTypes200DocumentPublisher**](CvrfReturnTypes200DocumentPublisher.md) | | [optional] |
|
||||||
|
| **document_tracking** | [**CvrfReturnTypes200DocumentTracking**](CvrfReturnTypes200DocumentTracking.md) | | [optional] |
|
||||||
|
| **document_notes** | [**Array<CvrfReturnTypes200DocumentNotes>**](CvrfReturnTypes200DocumentNotes.md) | | [optional] |
|
||||||
|
| **product_tree** | [**CvrfReturnTypes200ProductTree**](CvrfReturnTypes200ProductTree.md) | | [optional] |
|
||||||
|
| **vulnerability** | [**Array<CvrfReturnTypes200Vulnerability>**](CvrfReturnTypes200Vulnerability.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200.new(
|
||||||
|
document_title: null,
|
||||||
|
document_type: null,
|
||||||
|
document_publisher: null,
|
||||||
|
document_tracking: null,
|
||||||
|
document_notes: null,
|
||||||
|
product_tree: null,
|
||||||
|
vulnerability: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200Acknowledgements
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **name** | [**Array<CvrfReturnTypes200DocumentTitle>**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **url** | **Array<String>** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200Acknowledgements.new(
|
||||||
|
name: null,
|
||||||
|
url: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200AffectedFiles
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
| **file_name** | **String** | | [optional] |
|
||||||
|
| **file_version** | **String** | | [optional] |
|
||||||
|
| **file_path** | **String** | | [optional] |
|
||||||
|
| **file_last_modified** | **Time** | | [optional] |
|
||||||
|
| **file_architecture** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200AffectedFiles.new(
|
||||||
|
product_id: null,
|
||||||
|
file_name: null,
|
||||||
|
file_version: null,
|
||||||
|
file_path: null,
|
||||||
|
file_last_modified: null,
|
||||||
|
file_architecture: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200CVSSScoreSets
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **base_score** | **Float** | | [optional] |
|
||||||
|
| **temporal_score** | **Float** | | [optional] |
|
||||||
|
| **vector** | **String** | | [optional] |
|
||||||
|
| **product_id** | **Array<String>** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200CVSSScoreSets.new(
|
||||||
|
base_score: null,
|
||||||
|
temporal_score: null,
|
||||||
|
vector: null,
|
||||||
|
product_id: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200DocumentNotes
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **title** | **String** | | [optional] |
|
||||||
|
| **audience** | **String** | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
| **ordinal** | **String** | | [optional] |
|
||||||
|
| **value** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200DocumentNotes.new(
|
||||||
|
title: null,
|
||||||
|
audience: null,
|
||||||
|
type: null,
|
||||||
|
ordinal: null,
|
||||||
|
value: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200DocumentPublisher
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **contact_details** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **issuing_athority** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200DocumentPublisher.new(
|
||||||
|
contact_details: null,
|
||||||
|
issuing_athority: null,
|
||||||
|
type: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200DocumentTitle
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **value** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200DocumentTitle.new(
|
||||||
|
value: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200DocumentTracking
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **identification** | [**CvrfReturnTypes200DocumentTrackingIdentification**](CvrfReturnTypes200DocumentTrackingIdentification.md) | | [optional] |
|
||||||
|
| **status** | **Integer** | | [optional] |
|
||||||
|
| **version** | **String** | | [optional] |
|
||||||
|
| **revision_history** | [**Array<CvrfReturnTypes200DocumentTrackingRevisionHistory>**](CvrfReturnTypes200DocumentTrackingRevisionHistory.md) | | [optional] |
|
||||||
|
| **initial_release_date** | **Time** | | [optional] |
|
||||||
|
| **current_release_date** | **Time** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200DocumentTracking.new(
|
||||||
|
identification: null,
|
||||||
|
status: null,
|
||||||
|
version: null,
|
||||||
|
revision_history: null,
|
||||||
|
initial_release_date: null,
|
||||||
|
current_release_date: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200DocumentTrackingIdentification
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **id** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **_alias** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200DocumentTrackingIdentification.new(
|
||||||
|
id: null,
|
||||||
|
_alias: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200DocumentTrackingRevisionHistory
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **number** | **String** | | [optional] |
|
||||||
|
| **date** | **Time** | | [optional] |
|
||||||
|
| **description** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200DocumentTrackingRevisionHistory.new(
|
||||||
|
number: null,
|
||||||
|
date: null,
|
||||||
|
description: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200Notes
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **title** | **String** | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
| **ordinal** | **String** | | [optional] |
|
||||||
|
| **value** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200Notes.new(
|
||||||
|
title: null,
|
||||||
|
type: null,
|
||||||
|
ordinal: null,
|
||||||
|
value: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200ProductStatuses
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **product_id** | **Array<String>** | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200ProductStatuses.new(
|
||||||
|
product_id: null,
|
||||||
|
type: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200ProductTree
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **branch** | [**Array<CvrfReturnTypes200ProductTreeBranch>**](CvrfReturnTypes200ProductTreeBranch.md) | | [optional] |
|
||||||
|
| **full_product_name** | [**Array<CvrfReturnTypes200ProductTreeItems>**](CvrfReturnTypes200ProductTreeItems.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200ProductTree.new(
|
||||||
|
branch: null,
|
||||||
|
full_product_name: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200ProductTreeBranch
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **items** | [**Array<CvrfReturnTypes200ProductTreeItems1>**](CvrfReturnTypes200ProductTreeItems1.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200ProductTreeBranch.new(
|
||||||
|
items: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200ProductTreeItems
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
| **value** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200ProductTreeItems.new(
|
||||||
|
product_id: null,
|
||||||
|
value: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200ProductTreeItems1
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **items** | [**Array<CvrfReturnTypes200ProductTreeItems>**](CvrfReturnTypes200ProductTreeItems.md) | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
| **name** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200ProductTreeItems1.new(
|
||||||
|
items: null,
|
||||||
|
type: null,
|
||||||
|
name: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200Remediations
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **description** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **url** | **String** | | [optional] |
|
||||||
|
| **supersedence** | **String** | | [optional] |
|
||||||
|
| **product_id** | **Array<String>** | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
| **date_specified** | **Boolean** | | [optional] |
|
||||||
|
| **affected_files** | [**Array<CvrfReturnTypes200AffectedFiles>**](CvrfReturnTypes200AffectedFiles.md) | | [optional] |
|
||||||
|
| **sub_type** | **String** | | [optional] |
|
||||||
|
| **restart_required** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200Remediations.new(
|
||||||
|
description: null,
|
||||||
|
url: null,
|
||||||
|
supersedence: null,
|
||||||
|
product_id: null,
|
||||||
|
type: null,
|
||||||
|
date_specified: null,
|
||||||
|
affected_files: null,
|
||||||
|
sub_type: null,
|
||||||
|
restart_required: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200Threats
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **description** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **product_id** | **Array<String>** | | [optional] |
|
||||||
|
| **type** | **Integer** | | [optional] |
|
||||||
|
| **date_specified** | **Boolean** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200Threats.new(
|
||||||
|
description: null,
|
||||||
|
product_id: null,
|
||||||
|
type: null,
|
||||||
|
date_specified: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200Vulnerability
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **title** | [**CvrfReturnTypes200DocumentTitle**](CvrfReturnTypes200DocumentTitle.md) | | [optional] |
|
||||||
|
| **notes** | [**Array<CvrfReturnTypes200Notes>**](CvrfReturnTypes200Notes.md) | | [optional] |
|
||||||
|
| **discovery_date_specified** | **Boolean** | | [optional] |
|
||||||
|
| **release_date_specified** | **Boolean** | | [optional] |
|
||||||
|
| **cve** | **String** | | [optional] |
|
||||||
|
| **product_statuses** | [**Array<CvrfReturnTypes200ProductStatuses>**](CvrfReturnTypes200ProductStatuses.md) | | [optional] |
|
||||||
|
| **threats** | [**Array<CvrfReturnTypes200Threats>**](CvrfReturnTypes200Threats.md) | | [optional] |
|
||||||
|
| **cvss_score_sets** | [**Array<CvrfReturnTypes200CVSSScoreSets>**](CvrfReturnTypes200CVSSScoreSets.md) | | [optional] |
|
||||||
|
| **remediations** | [**Array<CvrfReturnTypes200Remediations>**](CvrfReturnTypes200Remediations.md) | | [optional] |
|
||||||
|
| **acknowledgements** | [**Array<CvrfReturnTypes200Acknowledgements>**](CvrfReturnTypes200Acknowledgements.md) | | [optional] |
|
||||||
|
| **ordinal** | **String** | | [optional] |
|
||||||
|
| **revision_history** | [**Array<CvrfReturnTypes200DocumentTrackingRevisionHistory>**](CvrfReturnTypes200DocumentTrackingRevisionHistory.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200Vulnerability.new(
|
||||||
|
title: null,
|
||||||
|
notes: null,
|
||||||
|
discovery_date_specified: null,
|
||||||
|
release_date_specified: null,
|
||||||
|
cve: null,
|
||||||
|
product_statuses: null,
|
||||||
|
threats: null,
|
||||||
|
cvss_score_sets: null,
|
||||||
|
remediations: null,
|
||||||
|
acknowledgements: null,
|
||||||
|
ordinal: null,
|
||||||
|
revision_history: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200Xml
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **cvrfdoc** | [**CvrfReturnTypes200XmlCvrfdoc**](CvrfReturnTypes200XmlCvrfdoc.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200Xml.new(
|
||||||
|
cvrfdoc: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdoc
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **document_title** | **String** | | [optional] |
|
||||||
|
| **document_type** | **String** | | [optional] |
|
||||||
|
| **document_publisher** | [**CvrfReturnTypes200XmlCvrfdocDocumentPublisher**](CvrfReturnTypes200XmlCvrfdocDocumentPublisher.md) | | [optional] |
|
||||||
|
| **document_tracking** | [**CvrfReturnTypes200XmlCvrfdocDocumentTracking**](CvrfReturnTypes200XmlCvrfdocDocumentTracking.md) | | [optional] |
|
||||||
|
| **document_notes** | [**Array<CvrfReturnTypes200XmlCvrfdocDocumentNotes>**](CvrfReturnTypes200XmlCvrfdocDocumentNotes.md) | | [optional] |
|
||||||
|
| **product_tree** | [**CvrfReturnTypes200XmlCvrfdocProductTree**](CvrfReturnTypes200XmlCvrfdocProductTree.md) | | [optional] |
|
||||||
|
| **vulnerability** | [**CvrfReturnTypes200XmlCvrfdocVulnerability**](CvrfReturnTypes200XmlCvrfdocVulnerability.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdoc.new(
|
||||||
|
document_title: null,
|
||||||
|
document_type: null,
|
||||||
|
document_publisher: null,
|
||||||
|
document_tracking: null,
|
||||||
|
document_notes: null,
|
||||||
|
product_tree: null,
|
||||||
|
vulnerability: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentNotes
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **note** | [**CvrfReturnTypes200XmlCvrfdocNote**](CvrfReturnTypes200XmlCvrfdocNote.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentNotes.new(
|
||||||
|
note: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentPublisher
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **contact_details** | **String** | | [optional] |
|
||||||
|
| **issuing_authority** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentPublisher.new(
|
||||||
|
type: null,
|
||||||
|
contact_details: null,
|
||||||
|
issuing_authority: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTracking
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **identification** | [**CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification**](CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification.md) | | [optional] |
|
||||||
|
| **status** | **String** | | [optional] |
|
||||||
|
| **version** | **Float** | | [optional] |
|
||||||
|
| **revision_history** | [**CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory**](CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory.md) | | [optional] |
|
||||||
|
| **initial_release_date** | **Time** | | [optional] |
|
||||||
|
| **current_release_date** | **Time** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTracking.new(
|
||||||
|
identification: null,
|
||||||
|
status: null,
|
||||||
|
version: null,
|
||||||
|
revision_history: null,
|
||||||
|
initial_release_date: null,
|
||||||
|
current_release_date: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **id** | **String** | | [optional] |
|
||||||
|
| **_alias** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification.new(
|
||||||
|
id: null,
|
||||||
|
_alias: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **revision** | [**CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision**](CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory.new(
|
||||||
|
revision: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **number** | **Integer** | | [optional] |
|
||||||
|
| **date** | **Time** | | [optional] |
|
||||||
|
| **description** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision.new(
|
||||||
|
number: null,
|
||||||
|
date: null,
|
||||||
|
description: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocNote
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **title** | **String** | | [optional] |
|
||||||
|
| **audience** | **String** | | [optional] |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **ordinal** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocNote.new(
|
||||||
|
title: null,
|
||||||
|
audience: null,
|
||||||
|
type: null,
|
||||||
|
ordinal: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTree
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **branch** | [**Array<CvrfReturnTypes200XmlCvrfdocProductTreeBranch1>**](CvrfReturnTypes200XmlCvrfdocProductTreeBranch1.md) | | [optional] |
|
||||||
|
| **full_product_name** | [**Array<CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1>**](CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTree.new(
|
||||||
|
branch: null,
|
||||||
|
full_product_name: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **name** | **String** | | [optional] |
|
||||||
|
| **full_product_name** | [**Array<CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName>**](CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch.new(
|
||||||
|
type: null,
|
||||||
|
name: null,
|
||||||
|
full_product_name: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch1
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **name** | **String** | | [optional] |
|
||||||
|
| **branch** | [**Array<CvrfReturnTypes200XmlCvrfdocProductTreeBranch>**](CvrfReturnTypes200XmlCvrfdocProductTreeBranch.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch1.new(
|
||||||
|
type: null,
|
||||||
|
name: null,
|
||||||
|
branch: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName.new(
|
||||||
|
product_id: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1.new(
|
||||||
|
product_id: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerability
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **ordinal** | **String** | | [optional] |
|
||||||
|
| **title** | **String** | | [optional] |
|
||||||
|
| **notes** | [**CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes**](CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes.md) | | [optional] |
|
||||||
|
| **cve** | **String** | | [optional] |
|
||||||
|
| **product_statuses** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses.md) | | [optional] |
|
||||||
|
| **threats** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats.md) | | [optional] |
|
||||||
|
| **cvss_score_sets** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets.md) | | [optional] |
|
||||||
|
| **remediations** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations.md) | | [optional] |
|
||||||
|
| **acknowledgements** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements.md) | | [optional] |
|
||||||
|
| **revision_history** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerability.new(
|
||||||
|
ordinal: null,
|
||||||
|
title: null,
|
||||||
|
notes: null,
|
||||||
|
cve: null,
|
||||||
|
product_statuses: null,
|
||||||
|
threats: null,
|
||||||
|
cvss_score_sets: null,
|
||||||
|
remediations: null,
|
||||||
|
acknowledgements: null,
|
||||||
|
revision_history: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **name** | **String** | | [optional] |
|
||||||
|
| **url** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityAcknowledgements.new(
|
||||||
|
name: null,
|
||||||
|
url: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
| **file_name** | **String** | | [optional] |
|
||||||
|
| **file_version** | **String** | | [optional] |
|
||||||
|
| **file_path** | **String** | | [optional] |
|
||||||
|
| **file_last_modified** | **Time** | | [optional] |
|
||||||
|
| **file_architecture** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles.new(
|
||||||
|
product_id: null,
|
||||||
|
file_name: null,
|
||||||
|
file_version: null,
|
||||||
|
file_path: null,
|
||||||
|
file_last_modified: null,
|
||||||
|
file_architecture: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **base_score** | **Float** | | [optional] |
|
||||||
|
| **temporal_score** | **Float** | | [optional] |
|
||||||
|
| **vector** | **String** | | [optional] |
|
||||||
|
| **product_id** | **Float** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityCVSSScoreSets.new(
|
||||||
|
base_score: null,
|
||||||
|
temporal_score: null,
|
||||||
|
vector: null,
|
||||||
|
product_id: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **note** | [**CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote**](CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityNotes.new(
|
||||||
|
note: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **title** | **String** | | [optional] |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **ordianl** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityNotesNote.new(
|
||||||
|
title: null,
|
||||||
|
type: null,
|
||||||
|
ordianl: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityProductStatuses.new(
|
||||||
|
type: null,
|
||||||
|
product_id: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **description** | **Integer** | | [optional] |
|
||||||
|
| **url** | **String** | | [optional] |
|
||||||
|
| **supersedence** | **String** | | [optional] |
|
||||||
|
| **product_id** | **Array<String>** | | [optional] |
|
||||||
|
| **affected_files** | [**Array<CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles>**](CvrfReturnTypes200XmlCvrfdocVulnerabilityAffectedFiles.md) | | [optional] |
|
||||||
|
| **restart_required** | **String** | | [optional] |
|
||||||
|
| **sub_type** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityRemediations.new(
|
||||||
|
type: null,
|
||||||
|
description: null,
|
||||||
|
url: null,
|
||||||
|
supersedence: null,
|
||||||
|
product_id: null,
|
||||||
|
affected_files: null,
|
||||||
|
restart_required: null,
|
||||||
|
sub_type: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **number** | **Float** | | [optional] |
|
||||||
|
| **date** | **Time** | | [optional] |
|
||||||
|
| **description** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityRevisionHistory.new(
|
||||||
|
number: null,
|
||||||
|
date: null,
|
||||||
|
description: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **type** | **String** | | [optional] |
|
||||||
|
| **description** | **String** | | [optional] |
|
||||||
|
| **product_id** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat.new(
|
||||||
|
type: null,
|
||||||
|
description: null,
|
||||||
|
product_id: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **threat** | [**CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat**](CvrfReturnTypes200XmlCvrfdocVulnerabilityThreat.md) | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::CvrfReturnTypes200XmlCvrfdocVulnerabilityThreats.new(
|
||||||
|
threat: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
212
tools/microsoft/cvrf/ruby-client/docs/DefaultApi.md
Normal file
212
tools/microsoft/cvrf/ruby-client/docs/DefaultApi.md
Normal file
|
@ -0,0 +1,212 @@
|
||||||
|
# OpenapiClient::DefaultApi
|
||||||
|
|
||||||
|
All URIs are relative to *https://api.msrc.microsoft.com*
|
||||||
|
|
||||||
|
| Method | HTTP request | Description |
|
||||||
|
| ------ | ------------ | ----------- |
|
||||||
|
| [**cvrf_id_get**](DefaultApi.md#cvrf_id_get) | **GET** /cvrf/{id} | |
|
||||||
|
| [**updates_get**](DefaultApi.md#updates_get) | **GET** /Updates | |
|
||||||
|
| [**updates_id_get**](DefaultApi.md#updates_id_get) | **GET** /Updates('{id}') | |
|
||||||
|
|
||||||
|
|
||||||
|
## cvrf_id_get
|
||||||
|
|
||||||
|
> <CvrfReturnTypes200> cvrf_id_get(api_version, api_key, id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Gets a CVRF document by ID (ie: 2016-Aug) Note: to view the correct XML response, please change *$ref: '#/definitions/cvrfReturnTypes200'* to *$ref: '#/definitions/cvrfReturnTypes200_xml'* in the swagger.json or swagger.yaml file
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'time'
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
api_instance = OpenapiClient::DefaultApi.new
|
||||||
|
api_version = 'api_version_example' # String |
|
||||||
|
api_key = 'api_key_example' # String |
|
||||||
|
id = 'id_example' # String |
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
result = api_instance.cvrf_id_get(api_version, api_key, id)
|
||||||
|
p result
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Error when calling DefaultApi->cvrf_id_get: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Using the cvrf_id_get_with_http_info variant
|
||||||
|
|
||||||
|
This returns an Array which contains the response data, status code and headers.
|
||||||
|
|
||||||
|
> <Array(<CvrfReturnTypes200>, Integer, Hash)> cvrf_id_get_with_http_info(api_version, api_key, id)
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
begin
|
||||||
|
|
||||||
|
data, status_code, headers = api_instance.cvrf_id_get_with_http_info(api_version, api_key, id)
|
||||||
|
p status_code # => 2xx
|
||||||
|
p headers # => { ... }
|
||||||
|
p data # => <CvrfReturnTypes200>
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Error when calling DefaultApi->cvrf_id_get_with_http_info: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **api_version** | **String** | | [default to '2016-08-01'] |
|
||||||
|
| **api_key** | **String** | | |
|
||||||
|
| **id** | **String** | | |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**CvrfReturnTypes200**](CvrfReturnTypes200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
|
||||||
|
## updates_get
|
||||||
|
|
||||||
|
> <UpdatesReturnTypes200> updates_get(api_version, api_key)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Get all updates with a link to the CVRF document
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'time'
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
api_instance = OpenapiClient::DefaultApi.new
|
||||||
|
api_version = 'api_version_example' # String |
|
||||||
|
api_key = 'api_key_example' # String |
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
result = api_instance.updates_get(api_version, api_key)
|
||||||
|
p result
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Error when calling DefaultApi->updates_get: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Using the updates_get_with_http_info variant
|
||||||
|
|
||||||
|
This returns an Array which contains the response data, status code and headers.
|
||||||
|
|
||||||
|
> <Array(<UpdatesReturnTypes200>, Integer, Hash)> updates_get_with_http_info(api_version, api_key)
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
begin
|
||||||
|
|
||||||
|
data, status_code, headers = api_instance.updates_get_with_http_info(api_version, api_key)
|
||||||
|
p status_code # => 2xx
|
||||||
|
p headers # => { ... }
|
||||||
|
p data # => <UpdatesReturnTypes200>
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Error when calling DefaultApi->updates_get_with_http_info: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **api_version** | **String** | | [default to '2016-08-01'] |
|
||||||
|
| **api_key** | **String** | | |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**UpdatesReturnTypes200**](UpdatesReturnTypes200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
## updates_id_get
|
||||||
|
|
||||||
|
> <UpdatesReturnTypes200> updates_id_get(api_version, api_key, id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Get updates with a link to the CVRF document for a particular ID. ID can be: * Update ID (ie: 2016-Aug) * Vulnerability ID (ie: CVE-2016-0128) * Year (ie: 2016)
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'time'
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
api_instance = OpenapiClient::DefaultApi.new
|
||||||
|
api_version = 'api_version_example' # String |
|
||||||
|
api_key = 'api_key_example' # String |
|
||||||
|
id = 'id_example' # String |
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
result = api_instance.updates_id_get(api_version, api_key, id)
|
||||||
|
p result
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Error when calling DefaultApi->updates_id_get: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Using the updates_id_get_with_http_info variant
|
||||||
|
|
||||||
|
This returns an Array which contains the response data, status code and headers.
|
||||||
|
|
||||||
|
> <Array(<UpdatesReturnTypes200>, Integer, Hash)> updates_id_get_with_http_info(api_version, api_key, id)
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
begin
|
||||||
|
|
||||||
|
data, status_code, headers = api_instance.updates_id_get_with_http_info(api_version, api_key, id)
|
||||||
|
p status_code # => 2xx
|
||||||
|
p headers # => { ... }
|
||||||
|
p data # => <UpdatesReturnTypes200>
|
||||||
|
rescue OpenapiClient::ApiError => e
|
||||||
|
puts "Error when calling DefaultApi->updates_id_get_with_http_info: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **api_version** | **String** | | [default to '2016-08-01'] |
|
||||||
|
| **api_key** | **String** | | |
|
||||||
|
| **id** | **String** | | |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**UpdatesReturnTypes200**](UpdatesReturnTypes200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# OpenapiClient::UpdatesReturnTypes200
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **odata_context** | **String** | | [optional] |
|
||||||
|
| **value** | [**Array<UpdatesReturnTypes200Value>**](UpdatesReturnTypes200Value.md) | array of files returned | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::UpdatesReturnTypes200.new(
|
||||||
|
odata_context: null,
|
||||||
|
value: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# OpenapiClient::UpdatesReturnTypes200Value
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Type | Description | Notes |
|
||||||
|
| ---- | ---- | ----------- | ----- |
|
||||||
|
| **_alias** | **String** | | [optional] |
|
||||||
|
| **current_release_date** | **String** | | [optional] |
|
||||||
|
| **cvrf_url** | **String** | | [optional] |
|
||||||
|
| **document_title** | **String** | | [optional] |
|
||||||
|
| **id** | **String** | | [optional] |
|
||||||
|
| **initial_release_data** | **String** | | [optional] |
|
||||||
|
| **severity** | **String** | | [optional] |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require 'openapi_client'
|
||||||
|
|
||||||
|
instance = OpenapiClient::UpdatesReturnTypes200Value.new(
|
||||||
|
_alias: null,
|
||||||
|
current_release_date: null,
|
||||||
|
cvrf_url: null,
|
||||||
|
document_title: null,
|
||||||
|
id: null,
|
||||||
|
initial_release_data: null,
|
||||||
|
severity: null
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
58
tools/microsoft/cvrf/ruby-client/git_push.sh
Normal file
58
tools/microsoft/cvrf/ruby-client/git_push.sh
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
git_host=$4
|
||||||
|
|
||||||
|
if [ "$git_host" = "" ]; then
|
||||||
|
git_host=""
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id=""
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id=""
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note=""
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=`git remote`
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
|
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
86
tools/microsoft/cvrf/ruby-client/lib/openapi_client.rb
Normal file
86
tools/microsoft/cvrf/ruby-client/lib/openapi_client.rb
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
# Common files
|
||||||
|
require 'openapi_client/api_client'
|
||||||
|
require 'openapi_client/api_error'
|
||||||
|
require 'openapi_client/version'
|
||||||
|
require 'openapi_client/configuration'
|
||||||
|
|
||||||
|
# Models
|
||||||
|
require 'openapi_client/models/cvrf_return_types200'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_acknowledgements'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_affected_files'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_cvss_score_sets'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_document_notes'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_document_publisher'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_document_title'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_document_tracking'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_document_tracking_identification'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_document_tracking_revision_history'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_notes'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_product_statuses'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_product_tree'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_product_tree_branch'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_product_tree_items'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_product_tree_items1'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_remediations'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_threats'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_vulnerability'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_notes'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_publisher'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_identification'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_revision_history'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_document_tracking_revision_history_revision'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_note'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_branch'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_branch1'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_full_product_name'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_product_tree_full_product_name1'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_acknowledgements'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_affected_files'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_cvss_score_sets'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_notes'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_notes_note'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_product_statuses'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_remediations'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_revision_history'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_threat'
|
||||||
|
require 'openapi_client/models/cvrf_return_types200_xml_cvrfdoc_vulnerability_threats'
|
||||||
|
require 'openapi_client/models/updates_return_types200'
|
||||||
|
require 'openapi_client/models/updates_return_types200_value'
|
||||||
|
|
||||||
|
# APIs
|
||||||
|
require 'openapi_client/api/default_api'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class << self
|
||||||
|
# Customize default settings for the SDK using block.
|
||||||
|
# OpenapiClient.configure do |config|
|
||||||
|
# config.username = "xxx"
|
||||||
|
# config.password = "xxx"
|
||||||
|
# end
|
||||||
|
# If no block given, return the default Configuration object.
|
||||||
|
def configure
|
||||||
|
if block_given?
|
||||||
|
yield(Configuration.default)
|
||||||
|
else
|
||||||
|
Configuration.default
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,241 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'cgi'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class DefaultApi
|
||||||
|
attr_accessor :api_client
|
||||||
|
|
||||||
|
def initialize(api_client = ApiClient.default)
|
||||||
|
@api_client = api_client
|
||||||
|
end
|
||||||
|
# Gets a CVRF document by ID (ie: 2016-Aug) Note: to view the correct XML response, please change *$ref: '#/definitions/cvrfReturnTypes200'* to *$ref: '#/definitions/cvrfReturnTypes200_xml'* in the swagger.json or swagger.yaml file
|
||||||
|
# @param api_version [String]
|
||||||
|
# @param api_key [String]
|
||||||
|
# @param id [String]
|
||||||
|
# @param [Hash] opts the optional parameters
|
||||||
|
# @return [CvrfReturnTypes200]
|
||||||
|
def cvrf_id_get(api_version, api_key, id, opts = {})
|
||||||
|
data, _status_code, _headers = cvrf_id_get_with_http_info(api_version, api_key, id, opts)
|
||||||
|
data
|
||||||
|
end
|
||||||
|
|
||||||
|
# Gets a CVRF document by ID (ie: 2016-Aug) Note: to view the correct XML response, please change *$ref: '#/definitions/cvrfReturnTypes200'* to *$ref: '#/definitions/cvrfReturnTypes200_xml'* in the swagger.json or swagger.yaml file
|
||||||
|
# @param api_version [String]
|
||||||
|
# @param api_key [String]
|
||||||
|
# @param id [String]
|
||||||
|
# @param [Hash] opts the optional parameters
|
||||||
|
# @return [Array<(CvrfReturnTypes200, Integer, Hash)>] CvrfReturnTypes200 data, response status code and response headers
|
||||||
|
def cvrf_id_get_with_http_info(api_version, api_key, id, opts = {})
|
||||||
|
if @api_client.config.debugging
|
||||||
|
@api_client.config.logger.debug 'Calling API: DefaultApi.cvrf_id_get ...'
|
||||||
|
end
|
||||||
|
# verify the required parameter 'api_version' is set
|
||||||
|
if @api_client.config.client_side_validation && api_version.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'api_version' when calling DefaultApi.cvrf_id_get"
|
||||||
|
end
|
||||||
|
# verify the required parameter 'api_key' is set
|
||||||
|
if @api_client.config.client_side_validation && api_key.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.cvrf_id_get"
|
||||||
|
end
|
||||||
|
# verify the required parameter 'id' is set
|
||||||
|
if @api_client.config.client_side_validation && id.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.cvrf_id_get"
|
||||||
|
end
|
||||||
|
# resource path
|
||||||
|
local_var_path = '/cvrf/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
||||||
|
|
||||||
|
# query parameters
|
||||||
|
query_params = opts[:query_params] || {}
|
||||||
|
query_params[:'api-version'] = api_version
|
||||||
|
|
||||||
|
# header parameters
|
||||||
|
header_params = opts[:header_params] || {}
|
||||||
|
# HTTP header 'Accept' (if needed)
|
||||||
|
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
|
||||||
|
header_params[:'api-key'] = api_key
|
||||||
|
|
||||||
|
# form parameters
|
||||||
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
|
# http body (model)
|
||||||
|
post_body = opts[:debug_body]
|
||||||
|
|
||||||
|
# return_type
|
||||||
|
return_type = opts[:debug_return_type] || 'CvrfReturnTypes200'
|
||||||
|
|
||||||
|
# auth_names
|
||||||
|
auth_names = opts[:debug_auth_names] || []
|
||||||
|
|
||||||
|
new_options = opts.merge(
|
||||||
|
:operation => :"DefaultApi.cvrf_id_get",
|
||||||
|
:header_params => header_params,
|
||||||
|
:query_params => query_params,
|
||||||
|
:form_params => form_params,
|
||||||
|
:body => post_body,
|
||||||
|
:auth_names => auth_names,
|
||||||
|
:return_type => return_type
|
||||||
|
)
|
||||||
|
|
||||||
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
||||||
|
if @api_client.config.debugging
|
||||||
|
@api_client.config.logger.debug "API called: DefaultApi#cvrf_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
|
end
|
||||||
|
return data, status_code, headers
|
||||||
|
end
|
||||||
|
|
||||||
|
# Get all updates with a link to the CVRF document
|
||||||
|
# @param api_version [String]
|
||||||
|
# @param api_key [String]
|
||||||
|
# @param [Hash] opts the optional parameters
|
||||||
|
# @return [UpdatesReturnTypes200]
|
||||||
|
def updates_get(api_version, api_key, opts = {})
|
||||||
|
data, _status_code, _headers = updates_get_with_http_info(api_version, api_key, opts)
|
||||||
|
data
|
||||||
|
end
|
||||||
|
|
||||||
|
# Get all updates with a link to the CVRF document
|
||||||
|
# @param api_version [String]
|
||||||
|
# @param api_key [String]
|
||||||
|
# @param [Hash] opts the optional parameters
|
||||||
|
# @return [Array<(UpdatesReturnTypes200, Integer, Hash)>] UpdatesReturnTypes200 data, response status code and response headers
|
||||||
|
def updates_get_with_http_info(api_version, api_key, opts = {})
|
||||||
|
if @api_client.config.debugging
|
||||||
|
@api_client.config.logger.debug 'Calling API: DefaultApi.updates_get ...'
|
||||||
|
end
|
||||||
|
# verify the required parameter 'api_version' is set
|
||||||
|
if @api_client.config.client_side_validation && api_version.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'api_version' when calling DefaultApi.updates_get"
|
||||||
|
end
|
||||||
|
# verify the required parameter 'api_key' is set
|
||||||
|
if @api_client.config.client_side_validation && api_key.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.updates_get"
|
||||||
|
end
|
||||||
|
# resource path
|
||||||
|
local_var_path = '/Updates'
|
||||||
|
|
||||||
|
# query parameters
|
||||||
|
query_params = opts[:query_params] || {}
|
||||||
|
query_params[:'api-version'] = api_version
|
||||||
|
|
||||||
|
# header parameters
|
||||||
|
header_params = opts[:header_params] || {}
|
||||||
|
# HTTP header 'Accept' (if needed)
|
||||||
|
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
||||||
|
header_params[:'api-key'] = api_key
|
||||||
|
|
||||||
|
# form parameters
|
||||||
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
|
# http body (model)
|
||||||
|
post_body = opts[:debug_body]
|
||||||
|
|
||||||
|
# return_type
|
||||||
|
return_type = opts[:debug_return_type] || 'UpdatesReturnTypes200'
|
||||||
|
|
||||||
|
# auth_names
|
||||||
|
auth_names = opts[:debug_auth_names] || []
|
||||||
|
|
||||||
|
new_options = opts.merge(
|
||||||
|
:operation => :"DefaultApi.updates_get",
|
||||||
|
:header_params => header_params,
|
||||||
|
:query_params => query_params,
|
||||||
|
:form_params => form_params,
|
||||||
|
:body => post_body,
|
||||||
|
:auth_names => auth_names,
|
||||||
|
:return_type => return_type
|
||||||
|
)
|
||||||
|
|
||||||
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
||||||
|
if @api_client.config.debugging
|
||||||
|
@api_client.config.logger.debug "API called: DefaultApi#updates_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
|
end
|
||||||
|
return data, status_code, headers
|
||||||
|
end
|
||||||
|
|
||||||
|
# Get updates with a link to the CVRF document for a particular ID. ID can be: * Update ID (ie: 2016-Aug) * Vulnerability ID (ie: CVE-2016-0128) * Year (ie: 2016)
|
||||||
|
# @param api_version [String]
|
||||||
|
# @param api_key [String]
|
||||||
|
# @param id [String]
|
||||||
|
# @param [Hash] opts the optional parameters
|
||||||
|
# @return [UpdatesReturnTypes200]
|
||||||
|
def updates_id_get(api_version, api_key, id, opts = {})
|
||||||
|
data, _status_code, _headers = updates_id_get_with_http_info(api_version, api_key, id, opts)
|
||||||
|
data
|
||||||
|
end
|
||||||
|
|
||||||
|
# Get updates with a link to the CVRF document for a particular ID. ID can be: * Update ID (ie: 2016-Aug) * Vulnerability ID (ie: CVE-2016-0128) * Year (ie: 2016)
|
||||||
|
# @param api_version [String]
|
||||||
|
# @param api_key [String]
|
||||||
|
# @param id [String]
|
||||||
|
# @param [Hash] opts the optional parameters
|
||||||
|
# @return [Array<(UpdatesReturnTypes200, Integer, Hash)>] UpdatesReturnTypes200 data, response status code and response headers
|
||||||
|
def updates_id_get_with_http_info(api_version, api_key, id, opts = {})
|
||||||
|
if @api_client.config.debugging
|
||||||
|
@api_client.config.logger.debug 'Calling API: DefaultApi.updates_id_get ...'
|
||||||
|
end
|
||||||
|
# verify the required parameter 'api_version' is set
|
||||||
|
if @api_client.config.client_side_validation && api_version.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'api_version' when calling DefaultApi.updates_id_get"
|
||||||
|
end
|
||||||
|
# verify the required parameter 'api_key' is set
|
||||||
|
if @api_client.config.client_side_validation && api_key.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.updates_id_get"
|
||||||
|
end
|
||||||
|
# verify the required parameter 'id' is set
|
||||||
|
if @api_client.config.client_side_validation && id.nil?
|
||||||
|
fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.updates_id_get"
|
||||||
|
end
|
||||||
|
# resource path
|
||||||
|
local_var_path = '/Updates('{id}')'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
||||||
|
|
||||||
|
# query parameters
|
||||||
|
query_params = opts[:query_params] || {}
|
||||||
|
query_params[:'api-version'] = api_version
|
||||||
|
|
||||||
|
# header parameters
|
||||||
|
header_params = opts[:header_params] || {}
|
||||||
|
# HTTP header 'Accept' (if needed)
|
||||||
|
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
|
||||||
|
header_params[:'api-key'] = api_key
|
||||||
|
|
||||||
|
# form parameters
|
||||||
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
|
# http body (model)
|
||||||
|
post_body = opts[:debug_body]
|
||||||
|
|
||||||
|
# return_type
|
||||||
|
return_type = opts[:debug_return_type] || 'UpdatesReturnTypes200'
|
||||||
|
|
||||||
|
# auth_names
|
||||||
|
auth_names = opts[:debug_auth_names] || []
|
||||||
|
|
||||||
|
new_options = opts.merge(
|
||||||
|
:operation => :"DefaultApi.updates_id_get",
|
||||||
|
:header_params => header_params,
|
||||||
|
:query_params => query_params,
|
||||||
|
:form_params => form_params,
|
||||||
|
:body => post_body,
|
||||||
|
:auth_names => auth_names,
|
||||||
|
:return_type => return_type
|
||||||
|
)
|
||||||
|
|
||||||
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
||||||
|
if @api_client.config.debugging
|
||||||
|
@api_client.config.logger.debug "API called: DefaultApi#updates_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||||
|
end
|
||||||
|
return data, status_code, headers
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,389 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'json'
|
||||||
|
require 'logger'
|
||||||
|
require 'tempfile'
|
||||||
|
require 'time'
|
||||||
|
require 'typhoeus'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class ApiClient
|
||||||
|
# The Configuration object holding settings to be used in the API client.
|
||||||
|
attr_accessor :config
|
||||||
|
|
||||||
|
# Defines the headers to be used in HTTP requests of all API calls by default.
|
||||||
|
#
|
||||||
|
# @return [Hash]
|
||||||
|
attr_accessor :default_headers
|
||||||
|
|
||||||
|
# Initializes the ApiClient
|
||||||
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
||||||
|
def initialize(config = Configuration.default)
|
||||||
|
@config = config
|
||||||
|
@user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
|
||||||
|
@default_headers = {
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'User-Agent' => @user_agent
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.default
|
||||||
|
@@default ||= ApiClient.new
|
||||||
|
end
|
||||||
|
|
||||||
|
# Call an API with given options.
|
||||||
|
#
|
||||||
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
||||||
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
||||||
|
def call_api(http_method, path, opts = {})
|
||||||
|
request = build_request(http_method, path, opts)
|
||||||
|
response = request.run
|
||||||
|
|
||||||
|
if @config.debugging
|
||||||
|
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
||||||
|
end
|
||||||
|
|
||||||
|
unless response.success?
|
||||||
|
if response.timed_out?
|
||||||
|
fail ApiError.new('Connection timed out')
|
||||||
|
elsif response.code == 0
|
||||||
|
# Errors from libcurl will be made visible here
|
||||||
|
fail ApiError.new(:code => 0,
|
||||||
|
:message => response.return_message)
|
||||||
|
else
|
||||||
|
fail ApiError.new(:code => response.code,
|
||||||
|
:response_headers => response.headers,
|
||||||
|
:response_body => response.body),
|
||||||
|
response.status_message
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if opts[:return_type]
|
||||||
|
data = deserialize(response, opts[:return_type])
|
||||||
|
else
|
||||||
|
data = nil
|
||||||
|
end
|
||||||
|
return data, response.code, response.headers
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the HTTP request
|
||||||
|
#
|
||||||
|
# @param [String] http_method HTTP method/verb (e.g. POST)
|
||||||
|
# @param [String] path URL path (e.g. /account/new)
|
||||||
|
# @option opts [Hash] :header_params Header parameters
|
||||||
|
# @option opts [Hash] :query_params Query parameters
|
||||||
|
# @option opts [Hash] :form_params Query parameters
|
||||||
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
||||||
|
# @return [Typhoeus::Request] A Typhoeus Request
|
||||||
|
def build_request(http_method, path, opts = {})
|
||||||
|
url = build_request_url(path, opts)
|
||||||
|
http_method = http_method.to_sym.downcase
|
||||||
|
|
||||||
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
||||||
|
query_params = opts[:query_params] || {}
|
||||||
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
|
|
||||||
|
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
||||||
|
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
||||||
|
|
||||||
|
req_opts = {
|
||||||
|
:method => http_method,
|
||||||
|
:headers => header_params,
|
||||||
|
:params => query_params,
|
||||||
|
:params_encoding => @config.params_encoding,
|
||||||
|
:timeout => @config.timeout,
|
||||||
|
:ssl_verifypeer => @config.verify_ssl,
|
||||||
|
:ssl_verifyhost => _verify_ssl_host,
|
||||||
|
:sslcert => @config.cert_file,
|
||||||
|
:sslkey => @config.key_file,
|
||||||
|
:verbose => @config.debugging
|
||||||
|
}
|
||||||
|
|
||||||
|
# set custom cert, if provided
|
||||||
|
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
||||||
|
|
||||||
|
if [:post, :patch, :put, :delete].include?(http_method)
|
||||||
|
req_body = build_request_body(header_params, form_params, opts[:body])
|
||||||
|
req_opts.update :body => req_body
|
||||||
|
if @config.debugging
|
||||||
|
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
request = Typhoeus::Request.new(url, req_opts)
|
||||||
|
download_file(request) if opts[:return_type] == 'File'
|
||||||
|
request
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the HTTP request body
|
||||||
|
#
|
||||||
|
# @param [Hash] header_params Header parameters
|
||||||
|
# @param [Hash] form_params Query parameters
|
||||||
|
# @param [Object] body HTTP body (JSON/XML)
|
||||||
|
# @return [String] HTTP body data in the form of string
|
||||||
|
def build_request_body(header_params, form_params, body)
|
||||||
|
# http form
|
||||||
|
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
||||||
|
header_params['Content-Type'] == 'multipart/form-data'
|
||||||
|
data = {}
|
||||||
|
form_params.each do |key, value|
|
||||||
|
case value
|
||||||
|
when ::File, ::Array, nil
|
||||||
|
# let typhoeus handle File, Array and nil parameters
|
||||||
|
data[key] = value
|
||||||
|
else
|
||||||
|
data[key] = value.to_s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elsif body
|
||||||
|
data = body.is_a?(String) ? body : body.to_json
|
||||||
|
else
|
||||||
|
data = nil
|
||||||
|
end
|
||||||
|
data
|
||||||
|
end
|
||||||
|
|
||||||
|
# Save response body into a file in (the defined) temporary folder, using the filename
|
||||||
|
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
||||||
|
# The response body is written to the file in chunks in order to handle files which
|
||||||
|
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
||||||
|
# process can use.
|
||||||
|
#
|
||||||
|
# @see Configuration#temp_folder_path
|
||||||
|
def download_file(request)
|
||||||
|
tempfile = nil
|
||||||
|
encoding = nil
|
||||||
|
request.on_headers do |response|
|
||||||
|
content_disposition = response.headers['Content-Disposition']
|
||||||
|
if content_disposition && content_disposition =~ /filename=/i
|
||||||
|
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
||||||
|
prefix = sanitize_filename(filename)
|
||||||
|
else
|
||||||
|
prefix = 'download-'
|
||||||
|
end
|
||||||
|
prefix = prefix + '-' unless prefix.end_with?('-')
|
||||||
|
encoding = response.body.encoding
|
||||||
|
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
||||||
|
@tempfile = tempfile
|
||||||
|
end
|
||||||
|
request.on_body do |chunk|
|
||||||
|
chunk.force_encoding(encoding)
|
||||||
|
tempfile.write(chunk)
|
||||||
|
end
|
||||||
|
request.on_complete do |response|
|
||||||
|
if tempfile
|
||||||
|
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`"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check if the given MIME is a JSON MIME.
|
||||||
|
# JSON MIME examples:
|
||||||
|
# application/json
|
||||||
|
# application/json; charset=UTF8
|
||||||
|
# APPLICATION/JSON
|
||||||
|
# */*
|
||||||
|
# @param [String] mime MIME
|
||||||
|
# @return [Boolean] True if the MIME is application/json
|
||||||
|
def json_mime?(mime)
|
||||||
|
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserialize the response to the given return type.
|
||||||
|
#
|
||||||
|
# @param [Response] response HTTP response
|
||||||
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
||||||
|
def deserialize(response, return_type)
|
||||||
|
body = response.body
|
||||||
|
|
||||||
|
# handle file downloading - return the File instance processed in request callbacks
|
||||||
|
# note that response body is empty when the file is written in chunks in request on_body callback
|
||||||
|
return @tempfile if return_type == 'File'
|
||||||
|
|
||||||
|
return nil if body.nil? || body.empty?
|
||||||
|
|
||||||
|
# return response body directly for String return type
|
||||||
|
return body if return_type == 'String'
|
||||||
|
|
||||||
|
# ensuring a default content type
|
||||||
|
content_type = response.headers['Content-Type'] || 'application/json'
|
||||||
|
|
||||||
|
fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
|
||||||
|
|
||||||
|
begin
|
||||||
|
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
||||||
|
rescue JSON::ParserError => e
|
||||||
|
if %w(String Date Time).include?(return_type)
|
||||||
|
data = body
|
||||||
|
else
|
||||||
|
raise e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
convert_to_type data, return_type
|
||||||
|
end
|
||||||
|
|
||||||
|
# Convert data to the given return type.
|
||||||
|
# @param [Object] data Data to be converted
|
||||||
|
# @param [String] return_type Return type
|
||||||
|
# @return [Mixed] Data in a particular type
|
||||||
|
def convert_to_type(data, return_type)
|
||||||
|
return nil if data.nil?
|
||||||
|
case return_type
|
||||||
|
when 'String'
|
||||||
|
data.to_s
|
||||||
|
when 'Integer'
|
||||||
|
data.to_i
|
||||||
|
when 'Float'
|
||||||
|
data.to_f
|
||||||
|
when 'Boolean'
|
||||||
|
data == true
|
||||||
|
when 'Time'
|
||||||
|
# parse date time (expecting ISO 8601 format)
|
||||||
|
Time.parse data
|
||||||
|
when 'Date'
|
||||||
|
# parse date time (expecting ISO 8601 format)
|
||||||
|
Date.parse data
|
||||||
|
when 'Object'
|
||||||
|
# generic object (usually a Hash), return directly
|
||||||
|
data
|
||||||
|
when /\AArray<(.+)>\z/
|
||||||
|
# e.g. Array<Pet>
|
||||||
|
sub_type = $1
|
||||||
|
data.map { |item| convert_to_type(item, sub_type) }
|
||||||
|
when /\AHash\<String, (.+)\>\z/
|
||||||
|
# e.g. Hash<String, Integer>
|
||||||
|
sub_type = $1
|
||||||
|
{}.tap do |hash|
|
||||||
|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# models (e.g. Pet) or oneOf
|
||||||
|
klass = OpenapiClient.const_get(return_type)
|
||||||
|
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Sanitize filename by removing path.
|
||||||
|
# e.g. ../../sun.gif becomes sun.gif
|
||||||
|
#
|
||||||
|
# @param [String] filename the filename to be sanitized
|
||||||
|
# @return [String] the sanitized filename
|
||||||
|
def sanitize_filename(filename)
|
||||||
|
filename.gsub(/.*[\/\\]/, '')
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_request_url(path, opts = {})
|
||||||
|
# Add leading and trailing slashes to path
|
||||||
|
path = "/#{path}".gsub(/\/+/, '/')
|
||||||
|
@config.base_url(opts[:operation]) + path
|
||||||
|
end
|
||||||
|
|
||||||
|
# Update hearder and query params based on authentication settings.
|
||||||
|
#
|
||||||
|
# @param [Hash] header_params Header parameters
|
||||||
|
# @param [Hash] query_params Query parameters
|
||||||
|
# @param [String] auth_names Authentication scheme name
|
||||||
|
def update_params_for_auth!(header_params, query_params, auth_names)
|
||||||
|
Array(auth_names).each do |auth_name|
|
||||||
|
auth_setting = @config.auth_settings[auth_name]
|
||||||
|
next unless auth_setting
|
||||||
|
case auth_setting[:in]
|
||||||
|
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
||||||
|
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
||||||
|
else fail ArgumentError, 'Authentication token must be in `query` or `header`'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Sets user agent in HTTP header
|
||||||
|
#
|
||||||
|
# @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
|
||||||
|
def user_agent=(user_agent)
|
||||||
|
@user_agent = user_agent
|
||||||
|
@default_headers['User-Agent'] = @user_agent
|
||||||
|
end
|
||||||
|
|
||||||
|
# Return Accept header based on an array of accepts provided.
|
||||||
|
# @param [Array] accepts array for Accept
|
||||||
|
# @return [String] the Accept header (e.g. application/json)
|
||||||
|
def select_header_accept(accepts)
|
||||||
|
return nil if accepts.nil? || accepts.empty?
|
||||||
|
# use JSON when present, otherwise use all of the provided
|
||||||
|
json_accept = accepts.find { |s| json_mime?(s) }
|
||||||
|
json_accept || accepts.join(',')
|
||||||
|
end
|
||||||
|
|
||||||
|
# Return Content-Type header based on an array of content types provided.
|
||||||
|
# @param [Array] content_types array for Content-Type
|
||||||
|
# @return [String] the Content-Type header (e.g. application/json)
|
||||||
|
def select_header_content_type(content_types)
|
||||||
|
# use application/json by default
|
||||||
|
return 'application/json' if content_types.nil? || content_types.empty?
|
||||||
|
# use JSON when present, otherwise use the first one
|
||||||
|
json_content_type = content_types.find { |s| json_mime?(s) }
|
||||||
|
json_content_type || content_types.first
|
||||||
|
end
|
||||||
|
|
||||||
|
# Convert object (array, hash, object, etc) to JSON string.
|
||||||
|
# @param [Object] model object to be converted into JSON string
|
||||||
|
# @return [String] JSON string representation of the object
|
||||||
|
def object_to_http_body(model)
|
||||||
|
return model if model.nil? || model.is_a?(String)
|
||||||
|
local_body = nil
|
||||||
|
if model.is_a?(Array)
|
||||||
|
local_body = model.map { |m| object_to_hash(m) }
|
||||||
|
else
|
||||||
|
local_body = object_to_hash(model)
|
||||||
|
end
|
||||||
|
local_body.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
# Convert object(non-array) to hash.
|
||||||
|
# @param [Object] obj object to be converted into JSON string
|
||||||
|
# @return [String] JSON string representation of the object
|
||||||
|
def object_to_hash(obj)
|
||||||
|
if obj.respond_to?(:to_hash)
|
||||||
|
obj.to_hash
|
||||||
|
else
|
||||||
|
obj
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Build parameter value according to the given collection format.
|
||||||
|
# @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
|
||||||
|
def build_collection_param(param, collection_format)
|
||||||
|
case collection_format
|
||||||
|
when :csv
|
||||||
|
param.join(',')
|
||||||
|
when :ssv
|
||||||
|
param.join(' ')
|
||||||
|
when :tsv
|
||||||
|
param.join("\t")
|
||||||
|
when :pipes
|
||||||
|
param.join('|')
|
||||||
|
when :multi
|
||||||
|
# return the array directly as typhoeus will handle it as expected
|
||||||
|
param
|
||||||
|
else
|
||||||
|
fail "unknown collection format: #{collection_format.inspect}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,57 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class ApiError < StandardError
|
||||||
|
attr_reader :code, :response_headers, :response_body
|
||||||
|
|
||||||
|
# Usage examples:
|
||||||
|
# ApiError.new
|
||||||
|
# ApiError.new("message")
|
||||||
|
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
||||||
|
# ApiError.new(:code => 404, :message => "Not Found")
|
||||||
|
def initialize(arg = nil)
|
||||||
|
if arg.is_a? Hash
|
||||||
|
if arg.key?(:message) || arg.key?('message')
|
||||||
|
super(arg[:message] || arg['message'])
|
||||||
|
else
|
||||||
|
super arg
|
||||||
|
end
|
||||||
|
|
||||||
|
arg.each do |k, v|
|
||||||
|
instance_variable_set "@#{k}", v
|
||||||
|
end
|
||||||
|
else
|
||||||
|
super arg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Override to_s to display a friendly error message
|
||||||
|
def to_s
|
||||||
|
message
|
||||||
|
end
|
||||||
|
|
||||||
|
def message
|
||||||
|
if @message.nil?
|
||||||
|
msg = "Error message: the server returns an error"
|
||||||
|
else
|
||||||
|
msg = @message
|
||||||
|
end
|
||||||
|
|
||||||
|
msg += "\nHTTP status code: #{code}" if code
|
||||||
|
msg += "\nResponse headers: #{response_headers}" if response_headers
|
||||||
|
msg += "\nResponse body: #{response_body}" if response_body
|
||||||
|
|
||||||
|
msg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,270 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class Configuration
|
||||||
|
# Defines url scheme
|
||||||
|
attr_accessor :scheme
|
||||||
|
|
||||||
|
# Defines url host
|
||||||
|
attr_accessor :host
|
||||||
|
|
||||||
|
# Defines url base path
|
||||||
|
attr_accessor :base_path
|
||||||
|
|
||||||
|
# Define server configuration index
|
||||||
|
attr_accessor :server_index
|
||||||
|
|
||||||
|
# Define server operation configuration index
|
||||||
|
attr_accessor :server_operation_index
|
||||||
|
|
||||||
|
# Default server variables
|
||||||
|
attr_accessor :server_variables
|
||||||
|
|
||||||
|
# Default server operation variables
|
||||||
|
attr_accessor :server_operation_variables
|
||||||
|
|
||||||
|
# Defines API keys used with API Key authentications.
|
||||||
|
#
|
||||||
|
# @return [Hash] key: parameter name, value: parameter value (API key)
|
||||||
|
#
|
||||||
|
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
||||||
|
# config.api_key['api_key'] = 'xxx'
|
||||||
|
attr_accessor :api_key
|
||||||
|
|
||||||
|
# Defines API key prefixes used with API Key authentications.
|
||||||
|
#
|
||||||
|
# @return [Hash] key: parameter name, value: API key prefix
|
||||||
|
#
|
||||||
|
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
||||||
|
# config.api_key_prefix['api_key'] = 'Token'
|
||||||
|
attr_accessor :api_key_prefix
|
||||||
|
|
||||||
|
# Defines the username used with HTTP basic authentication.
|
||||||
|
#
|
||||||
|
# @return [String]
|
||||||
|
attr_accessor :username
|
||||||
|
|
||||||
|
# Defines the password used with HTTP basic authentication.
|
||||||
|
#
|
||||||
|
# @return [String]
|
||||||
|
attr_accessor :password
|
||||||
|
|
||||||
|
# Defines the access token (Bearer) used with OAuth2.
|
||||||
|
attr_accessor :access_token
|
||||||
|
|
||||||
|
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
||||||
|
# details will be logged with `logger.debug` (see the `logger` attribute).
|
||||||
|
# Default to false.
|
||||||
|
#
|
||||||
|
# @return [true, false]
|
||||||
|
attr_accessor :debugging
|
||||||
|
|
||||||
|
# Defines the logger used for debugging.
|
||||||
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
||||||
|
#
|
||||||
|
# @return [#debug]
|
||||||
|
attr_accessor :logger
|
||||||
|
|
||||||
|
# Defines the temporary folder to store downloaded files
|
||||||
|
# (for API endpoints that have file response).
|
||||||
|
# Default to use `Tempfile`.
|
||||||
|
#
|
||||||
|
# @return [String]
|
||||||
|
attr_accessor :temp_folder_path
|
||||||
|
|
||||||
|
# The time limit for HTTP request in seconds.
|
||||||
|
# Default to 0 (never times out).
|
||||||
|
attr_accessor :timeout
|
||||||
|
|
||||||
|
# Set this to false to skip client side validation in the operation.
|
||||||
|
# Default to true.
|
||||||
|
# @return [true, false]
|
||||||
|
attr_accessor :client_side_validation
|
||||||
|
|
||||||
|
### TLS/SSL setting
|
||||||
|
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
||||||
|
# Default to true.
|
||||||
|
#
|
||||||
|
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
||||||
|
#
|
||||||
|
# @return [true, false]
|
||||||
|
attr_accessor :verify_ssl
|
||||||
|
|
||||||
|
### TLS/SSL setting
|
||||||
|
# Set this to false to skip verifying SSL host name
|
||||||
|
# Default to true.
|
||||||
|
#
|
||||||
|
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
||||||
|
#
|
||||||
|
# @return [true, false]
|
||||||
|
attr_accessor :verify_ssl_host
|
||||||
|
|
||||||
|
### TLS/SSL setting
|
||||||
|
# Set this to customize the certificate file to verify the peer.
|
||||||
|
#
|
||||||
|
# @return [String] the path to the certificate file
|
||||||
|
#
|
||||||
|
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
||||||
|
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
||||||
|
attr_accessor :ssl_ca_cert
|
||||||
|
|
||||||
|
### TLS/SSL setting
|
||||||
|
# Client certificate file (for client certificate)
|
||||||
|
attr_accessor :cert_file
|
||||||
|
|
||||||
|
### TLS/SSL setting
|
||||||
|
# Client private key file (for client certificate)
|
||||||
|
attr_accessor :key_file
|
||||||
|
|
||||||
|
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
||||||
|
# Default to nil.
|
||||||
|
#
|
||||||
|
# @see The params_encoding option of Ethon. Related source code:
|
||||||
|
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
||||||
|
attr_accessor :params_encoding
|
||||||
|
|
||||||
|
attr_accessor :inject_format
|
||||||
|
|
||||||
|
attr_accessor :force_ending_format
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
@scheme = 'https'
|
||||||
|
@host = 'api.msrc.microsoft.com'
|
||||||
|
@base_path = ''
|
||||||
|
@server_index = 0
|
||||||
|
@server_operation_index = {}
|
||||||
|
@server_variables = {}
|
||||||
|
@server_operation_variables = {}
|
||||||
|
@api_key = {}
|
||||||
|
@api_key_prefix = {}
|
||||||
|
@timeout = 0
|
||||||
|
@client_side_validation = true
|
||||||
|
@verify_ssl = true
|
||||||
|
@verify_ssl_host = true
|
||||||
|
@params_encoding = nil
|
||||||
|
@cert_file = nil
|
||||||
|
@key_file = nil
|
||||||
|
@debugging = false
|
||||||
|
@inject_format = false
|
||||||
|
@force_ending_format = false
|
||||||
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
||||||
|
|
||||||
|
yield(self) if block_given?
|
||||||
|
end
|
||||||
|
|
||||||
|
# The default Configuration object.
|
||||||
|
def self.default
|
||||||
|
@@default ||= Configuration.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def configure
|
||||||
|
yield(self) if block_given?
|
||||||
|
end
|
||||||
|
|
||||||
|
def scheme=(scheme)
|
||||||
|
# remove :// from scheme
|
||||||
|
@scheme = scheme.sub(/:\/\//, '')
|
||||||
|
end
|
||||||
|
|
||||||
|
def host=(host)
|
||||||
|
# remove http(s):// and anything after a slash
|
||||||
|
@host = host.sub(/https?:\/\//, '').split('/').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def base_path=(base_path)
|
||||||
|
# Add leading and trailing slashes to base_path
|
||||||
|
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
||||||
|
@base_path = '' if @base_path == '/'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns base URL for specified operation based on server settings
|
||||||
|
def base_url(operation = nil)
|
||||||
|
index = server_operation_index.fetch(operation, server_index)
|
||||||
|
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
|
||||||
|
|
||||||
|
server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Gets API key (with prefix if set).
|
||||||
|
# @param [String] param_name the parameter name of API key auth
|
||||||
|
def api_key_with_prefix(param_name, param_alias = nil)
|
||||||
|
key = @api_key[param_name]
|
||||||
|
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
||||||
|
if @api_key_prefix[param_name]
|
||||||
|
"#{@api_key_prefix[param_name]} #{key}"
|
||||||
|
else
|
||||||
|
key
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Gets Basic Auth token string
|
||||||
|
def basic_auth_token
|
||||||
|
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns Auth Settings hash for api client.
|
||||||
|
def auth_settings
|
||||||
|
{
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns an array of Server setting
|
||||||
|
def server_settings
|
||||||
|
[
|
||||||
|
{
|
||||||
|
url: "https://api.msrc.microsoft.com",
|
||||||
|
description: "No description provided",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
def operation_server_settings
|
||||||
|
{
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns URL based on server settings
|
||||||
|
#
|
||||||
|
# @param index array index of the server settings
|
||||||
|
# @param variables hash of variable and the corresponding value
|
||||||
|
def server_url(index, variables = {}, servers = nil)
|
||||||
|
servers = server_settings if servers == nil
|
||||||
|
|
||||||
|
# check array index out of bound
|
||||||
|
if (index < 0 || index >= servers.size)
|
||||||
|
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
||||||
|
end
|
||||||
|
|
||||||
|
server = servers[index]
|
||||||
|
url = server[:url]
|
||||||
|
|
||||||
|
return url unless server.key? :variables
|
||||||
|
|
||||||
|
# go through variable and assign a value
|
||||||
|
server[:variables].each do |name, variable|
|
||||||
|
if variables.key?(name)
|
||||||
|
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
||||||
|
url.gsub! "{" + name.to_s + "}", variables[name]
|
||||||
|
else
|
||||||
|
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# use default value
|
||||||
|
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
url
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,276 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200
|
||||||
|
attr_accessor :document_title
|
||||||
|
|
||||||
|
attr_accessor :document_type
|
||||||
|
|
||||||
|
attr_accessor :document_publisher
|
||||||
|
|
||||||
|
attr_accessor :document_tracking
|
||||||
|
|
||||||
|
attr_accessor :document_notes
|
||||||
|
|
||||||
|
attr_accessor :product_tree
|
||||||
|
|
||||||
|
attr_accessor :vulnerability
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'document_title' => :'DocumentTitle',
|
||||||
|
:'document_type' => :'DocumentType',
|
||||||
|
:'document_publisher' => :'DocumentPublisher',
|
||||||
|
:'document_tracking' => :'DocumentTracking',
|
||||||
|
:'document_notes' => :'DocumentNotes',
|
||||||
|
:'product_tree' => :'ProductTree',
|
||||||
|
:'vulnerability' => :'Vulnerability'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'document_title' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'document_type' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'document_publisher' => :'CvrfReturnTypes200DocumentPublisher',
|
||||||
|
:'document_tracking' => :'CvrfReturnTypes200DocumentTracking',
|
||||||
|
:'document_notes' => :'Array<CvrfReturnTypes200DocumentNotes>',
|
||||||
|
:'product_tree' => :'CvrfReturnTypes200ProductTree',
|
||||||
|
:'vulnerability' => :'Array<CvrfReturnTypes200Vulnerability>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'document_title')
|
||||||
|
self.document_title = attributes[:'document_title']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_type')
|
||||||
|
self.document_type = attributes[:'document_type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_publisher')
|
||||||
|
self.document_publisher = attributes[:'document_publisher']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_tracking')
|
||||||
|
self.document_tracking = attributes[:'document_tracking']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_notes')
|
||||||
|
if (value = attributes[:'document_notes']).is_a?(Array)
|
||||||
|
self.document_notes = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'product_tree')
|
||||||
|
self.product_tree = attributes[:'product_tree']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'vulnerability')
|
||||||
|
if (value = attributes[:'vulnerability']).is_a?(Array)
|
||||||
|
self.vulnerability = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
document_title == o.document_title &&
|
||||||
|
document_type == o.document_type &&
|
||||||
|
document_publisher == o.document_publisher &&
|
||||||
|
document_tracking == o.document_tracking &&
|
||||||
|
document_notes == o.document_notes &&
|
||||||
|
product_tree == o.product_tree &&
|
||||||
|
vulnerability == o.vulnerability
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[document_title, document_type, document_publisher, document_tracking, document_notes, product_tree, vulnerability].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,231 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200Acknowledgements
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
|
attr_accessor :url
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'name' => :'Name',
|
||||||
|
:'url' => :'URL'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'name' => :'Array<CvrfReturnTypes200DocumentTitle>',
|
||||||
|
:'url' => :'Array<String>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200Acknowledgements` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200Acknowledgements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'name')
|
||||||
|
if (value = attributes[:'name']).is_a?(Array)
|
||||||
|
self.name = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'url')
|
||||||
|
if (value = attributes[:'url']).is_a?(Array)
|
||||||
|
self.url = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
name == o.name &&
|
||||||
|
url == o.url
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[name, url].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,263 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200AffectedFiles
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
attr_accessor :file_name
|
||||||
|
|
||||||
|
attr_accessor :file_version
|
||||||
|
|
||||||
|
attr_accessor :file_path
|
||||||
|
|
||||||
|
attr_accessor :file_last_modified
|
||||||
|
|
||||||
|
attr_accessor :file_architecture
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'product_id' => :'ProductId',
|
||||||
|
:'file_name' => :'FileName',
|
||||||
|
:'file_version' => :'FileVersion',
|
||||||
|
:'file_path' => :'FilePath',
|
||||||
|
:'file_last_modified' => :'FileLastModified',
|
||||||
|
:'file_architecture' => :'FileArchitecture'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'product_id' => :'String',
|
||||||
|
:'file_name' => :'String',
|
||||||
|
:'file_version' => :'String',
|
||||||
|
:'file_path' => :'String',
|
||||||
|
:'file_last_modified' => :'Time',
|
||||||
|
:'file_architecture' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200AffectedFiles` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200AffectedFiles`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
self.product_id = attributes[:'product_id']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'file_name')
|
||||||
|
self.file_name = attributes[:'file_name']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'file_version')
|
||||||
|
self.file_version = attributes[:'file_version']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'file_path')
|
||||||
|
self.file_path = attributes[:'file_path']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'file_last_modified')
|
||||||
|
self.file_last_modified = attributes[:'file_last_modified']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'file_architecture')
|
||||||
|
self.file_architecture = attributes[:'file_architecture']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
product_id == o.product_id &&
|
||||||
|
file_name == o.file_name &&
|
||||||
|
file_version == o.file_version &&
|
||||||
|
file_path == o.file_path &&
|
||||||
|
file_last_modified == o.file_last_modified &&
|
||||||
|
file_architecture == o.file_architecture
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[product_id, file_name, file_version, file_path, file_last_modified, file_architecture].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,247 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200CVSSScoreSets
|
||||||
|
attr_accessor :base_score
|
||||||
|
|
||||||
|
attr_accessor :temporal_score
|
||||||
|
|
||||||
|
attr_accessor :vector
|
||||||
|
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'base_score' => :'BaseScore',
|
||||||
|
:'temporal_score' => :'TemporalScore',
|
||||||
|
:'vector' => :'Vector',
|
||||||
|
:'product_id' => :'ProductID'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'base_score' => :'Float',
|
||||||
|
:'temporal_score' => :'Float',
|
||||||
|
:'vector' => :'String',
|
||||||
|
:'product_id' => :'Array<String>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200CVSSScoreSets` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200CVSSScoreSets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'base_score')
|
||||||
|
self.base_score = attributes[:'base_score']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'temporal_score')
|
||||||
|
self.temporal_score = attributes[:'temporal_score']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'vector')
|
||||||
|
self.vector = attributes[:'vector']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
if (value = attributes[:'product_id']).is_a?(Array)
|
||||||
|
self.product_id = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
base_score == o.base_score &&
|
||||||
|
temporal_score == o.temporal_score &&
|
||||||
|
vector == o.vector &&
|
||||||
|
product_id == o.product_id
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[base_score, temporal_score, vector, product_id].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,254 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200DocumentNotes
|
||||||
|
attr_accessor :title
|
||||||
|
|
||||||
|
attr_accessor :audience
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :ordinal
|
||||||
|
|
||||||
|
attr_accessor :value
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'title' => :'Title',
|
||||||
|
:'audience' => :'Audience',
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'ordinal' => :'Ordinal',
|
||||||
|
:'value' => :'Value'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'title' => :'String',
|
||||||
|
:'audience' => :'String',
|
||||||
|
:'type' => :'Integer',
|
||||||
|
:'ordinal' => :'String',
|
||||||
|
:'value' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200DocumentNotes` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200DocumentNotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'title')
|
||||||
|
self.title = attributes[:'title']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'audience')
|
||||||
|
self.audience = attributes[:'audience']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'ordinal')
|
||||||
|
self.ordinal = attributes[:'ordinal']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'value')
|
||||||
|
self.value = attributes[:'value']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
title == o.title &&
|
||||||
|
audience == o.audience &&
|
||||||
|
type == o.type &&
|
||||||
|
ordinal == o.ordinal &&
|
||||||
|
value == o.value
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[title, audience, type, ordinal, value].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,236 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200DocumentPublisher
|
||||||
|
attr_accessor :contact_details
|
||||||
|
|
||||||
|
attr_accessor :issuing_athority
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'contact_details' => :'ContactDetails',
|
||||||
|
:'issuing_athority' => :'IssuingAthority',
|
||||||
|
:'type' => :'Type'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'contact_details' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'issuing_athority' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'type' => :'Integer'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200DocumentPublisher` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200DocumentPublisher`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'contact_details')
|
||||||
|
self.contact_details = attributes[:'contact_details']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'issuing_athority')
|
||||||
|
self.issuing_athority = attributes[:'issuing_athority']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
contact_details == o.contact_details &&
|
||||||
|
issuing_athority == o.issuing_athority &&
|
||||||
|
type == o.type
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[contact_details, issuing_athority, type].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,218 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200DocumentTitle
|
||||||
|
attr_accessor :value
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'value' => :'Value'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'value' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200DocumentTitle` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200DocumentTitle`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'value')
|
||||||
|
self.value = attributes[:'value']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
value == o.value
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[value].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,265 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200DocumentTracking
|
||||||
|
attr_accessor :identification
|
||||||
|
|
||||||
|
attr_accessor :status
|
||||||
|
|
||||||
|
attr_accessor :version
|
||||||
|
|
||||||
|
attr_accessor :revision_history
|
||||||
|
|
||||||
|
attr_accessor :initial_release_date
|
||||||
|
|
||||||
|
attr_accessor :current_release_date
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'identification' => :'Identification',
|
||||||
|
:'status' => :'Status',
|
||||||
|
:'version' => :'Version',
|
||||||
|
:'revision_history' => :'RevisionHistory',
|
||||||
|
:'initial_release_date' => :'InitialReleaseDate',
|
||||||
|
:'current_release_date' => :'CurrentReleaseDate'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'identification' => :'CvrfReturnTypes200DocumentTrackingIdentification',
|
||||||
|
:'status' => :'Integer',
|
||||||
|
:'version' => :'String',
|
||||||
|
:'revision_history' => :'Array<CvrfReturnTypes200DocumentTrackingRevisionHistory>',
|
||||||
|
:'initial_release_date' => :'Time',
|
||||||
|
:'current_release_date' => :'Time'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200DocumentTracking` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200DocumentTracking`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'identification')
|
||||||
|
self.identification = attributes[:'identification']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'status')
|
||||||
|
self.status = attributes[:'status']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'version')
|
||||||
|
self.version = attributes[:'version']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'revision_history')
|
||||||
|
if (value = attributes[:'revision_history']).is_a?(Array)
|
||||||
|
self.revision_history = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'initial_release_date')
|
||||||
|
self.initial_release_date = attributes[:'initial_release_date']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'current_release_date')
|
||||||
|
self.current_release_date = attributes[:'current_release_date']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
identification == o.identification &&
|
||||||
|
status == o.status &&
|
||||||
|
version == o.version &&
|
||||||
|
revision_history == o.revision_history &&
|
||||||
|
initial_release_date == o.initial_release_date &&
|
||||||
|
current_release_date == o.current_release_date
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[identification, status, version, revision_history, initial_release_date, current_release_date].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,227 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200DocumentTrackingIdentification
|
||||||
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :_alias
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'id' => :'ID',
|
||||||
|
:'_alias' => :'Alias'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'id' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'_alias' => :'CvrfReturnTypes200DocumentTitle'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200DocumentTrackingIdentification` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200DocumentTrackingIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'id')
|
||||||
|
self.id = attributes[:'id']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'_alias')
|
||||||
|
self._alias = attributes[:'_alias']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
id == o.id &&
|
||||||
|
_alias == o._alias
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[id, _alias].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,236 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200DocumentTrackingRevisionHistory
|
||||||
|
attr_accessor :number
|
||||||
|
|
||||||
|
attr_accessor :date
|
||||||
|
|
||||||
|
attr_accessor :description
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'number' => :'Number',
|
||||||
|
:'date' => :'Date',
|
||||||
|
:'description' => :'Description'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'number' => :'String',
|
||||||
|
:'date' => :'Time',
|
||||||
|
:'description' => :'CvrfReturnTypes200DocumentTitle'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200DocumentTrackingRevisionHistory` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200DocumentTrackingRevisionHistory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'number')
|
||||||
|
self.number = attributes[:'number']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'date')
|
||||||
|
self.date = attributes[:'date']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'description')
|
||||||
|
self.description = attributes[:'description']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
number == o.number &&
|
||||||
|
date == o.date &&
|
||||||
|
description == o.description
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[number, date, description].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,245 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200Notes
|
||||||
|
attr_accessor :title
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :ordinal
|
||||||
|
|
||||||
|
attr_accessor :value
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'title' => :'Title',
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'ordinal' => :'Ordinal',
|
||||||
|
:'value' => :'Value'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'title' => :'String',
|
||||||
|
:'type' => :'Integer',
|
||||||
|
:'ordinal' => :'String',
|
||||||
|
:'value' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200Notes` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200Notes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'title')
|
||||||
|
self.title = attributes[:'title']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'ordinal')
|
||||||
|
self.ordinal = attributes[:'ordinal']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'value')
|
||||||
|
self.value = attributes[:'value']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
title == o.title &&
|
||||||
|
type == o.type &&
|
||||||
|
ordinal == o.ordinal &&
|
||||||
|
value == o.value
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[title, type, ordinal, value].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,229 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200ProductStatuses
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'product_id' => :'ProductID',
|
||||||
|
:'type' => :'Type'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'product_id' => :'Array<String>',
|
||||||
|
:'type' => :'Integer'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200ProductStatuses` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200ProductStatuses`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
if (value = attributes[:'product_id']).is_a?(Array)
|
||||||
|
self.product_id = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
product_id == o.product_id &&
|
||||||
|
type == o.type
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[product_id, type].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,231 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200ProductTree
|
||||||
|
attr_accessor :branch
|
||||||
|
|
||||||
|
attr_accessor :full_product_name
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'branch' => :'Branch',
|
||||||
|
:'full_product_name' => :'FullProductName'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'branch' => :'Array<CvrfReturnTypes200ProductTreeBranch>',
|
||||||
|
:'full_product_name' => :'Array<CvrfReturnTypes200ProductTreeItems>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200ProductTree` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200ProductTree`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'branch')
|
||||||
|
if (value = attributes[:'branch']).is_a?(Array)
|
||||||
|
self.branch = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'full_product_name')
|
||||||
|
if (value = attributes[:'full_product_name']).is_a?(Array)
|
||||||
|
self.full_product_name = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
branch == o.branch &&
|
||||||
|
full_product_name == o.full_product_name
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[branch, full_product_name].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,220 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200ProductTreeBranch
|
||||||
|
attr_accessor :items
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'items' => :'Items'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'items' => :'Array<CvrfReturnTypes200ProductTreeItems1>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200ProductTreeBranch` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200ProductTreeBranch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'items')
|
||||||
|
if (value = attributes[:'items']).is_a?(Array)
|
||||||
|
self.items = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
items == o.items
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[items].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,227 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200ProductTreeItems
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
attr_accessor :value
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'product_id' => :'ProductID',
|
||||||
|
:'value' => :'Value'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'product_id' => :'String',
|
||||||
|
:'value' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200ProductTreeItems` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200ProductTreeItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
self.product_id = attributes[:'product_id']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'value')
|
||||||
|
self.value = attributes[:'value']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
product_id == o.product_id &&
|
||||||
|
value == o.value
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[product_id, value].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,238 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200ProductTreeItems1
|
||||||
|
attr_accessor :items
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'items' => :'Items',
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'name' => :'Name'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'items' => :'Array<CvrfReturnTypes200ProductTreeItems>',
|
||||||
|
:'type' => :'Integer',
|
||||||
|
:'name' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200ProductTreeItems1` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200ProductTreeItems1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'items')
|
||||||
|
if (value = attributes[:'items']).is_a?(Array)
|
||||||
|
self.items = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'name')
|
||||||
|
self.name = attributes[:'name']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
items == o.items &&
|
||||||
|
type == o.type &&
|
||||||
|
name == o.name
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[items, type, name].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,294 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200Remediations
|
||||||
|
attr_accessor :description
|
||||||
|
|
||||||
|
attr_accessor :url
|
||||||
|
|
||||||
|
attr_accessor :supersedence
|
||||||
|
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :date_specified
|
||||||
|
|
||||||
|
attr_accessor :affected_files
|
||||||
|
|
||||||
|
attr_accessor :sub_type
|
||||||
|
|
||||||
|
attr_accessor :restart_required
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'description' => :'Description',
|
||||||
|
:'url' => :'URL',
|
||||||
|
:'supersedence' => :'Supersedence',
|
||||||
|
:'product_id' => :'ProductID',
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'date_specified' => :'DateSpecified',
|
||||||
|
:'affected_files' => :'AffectedFiles',
|
||||||
|
:'sub_type' => :'SubType',
|
||||||
|
:'restart_required' => :'RestartRequired'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'description' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'url' => :'String',
|
||||||
|
:'supersedence' => :'String',
|
||||||
|
:'product_id' => :'Array<String>',
|
||||||
|
:'type' => :'Integer',
|
||||||
|
:'date_specified' => :'Boolean',
|
||||||
|
:'affected_files' => :'Array<CvrfReturnTypes200AffectedFiles>',
|
||||||
|
:'sub_type' => :'String',
|
||||||
|
:'restart_required' => :'CvrfReturnTypes200DocumentTitle'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200Remediations` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200Remediations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'description')
|
||||||
|
self.description = attributes[:'description']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'url')
|
||||||
|
self.url = attributes[:'url']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'supersedence')
|
||||||
|
self.supersedence = attributes[:'supersedence']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
if (value = attributes[:'product_id']).is_a?(Array)
|
||||||
|
self.product_id = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'date_specified')
|
||||||
|
self.date_specified = attributes[:'date_specified']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'affected_files')
|
||||||
|
if (value = attributes[:'affected_files']).is_a?(Array)
|
||||||
|
self.affected_files = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'sub_type')
|
||||||
|
self.sub_type = attributes[:'sub_type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'restart_required')
|
||||||
|
self.restart_required = attributes[:'restart_required']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
description == o.description &&
|
||||||
|
url == o.url &&
|
||||||
|
supersedence == o.supersedence &&
|
||||||
|
product_id == o.product_id &&
|
||||||
|
type == o.type &&
|
||||||
|
date_specified == o.date_specified &&
|
||||||
|
affected_files == o.affected_files &&
|
||||||
|
sub_type == o.sub_type &&
|
||||||
|
restart_required == o.restart_required
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[description, url, supersedence, product_id, type, date_specified, affected_files, sub_type, restart_required].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,247 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200Threats
|
||||||
|
attr_accessor :description
|
||||||
|
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :date_specified
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'description' => :'Description',
|
||||||
|
:'product_id' => :'ProductID',
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'date_specified' => :'DateSpecified'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'description' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'product_id' => :'Array<String>',
|
||||||
|
:'type' => :'Integer',
|
||||||
|
:'date_specified' => :'Boolean'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200Threats` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200Threats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'description')
|
||||||
|
self.description = attributes[:'description']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
if (value = attributes[:'product_id']).is_a?(Array)
|
||||||
|
self.product_id = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'date_specified')
|
||||||
|
self.date_specified = attributes[:'date_specified']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
description == o.description &&
|
||||||
|
product_id == o.product_id &&
|
||||||
|
type == o.type &&
|
||||||
|
date_specified == o.date_specified
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[description, product_id, type, date_specified].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,331 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200Vulnerability
|
||||||
|
attr_accessor :title
|
||||||
|
|
||||||
|
attr_accessor :notes
|
||||||
|
|
||||||
|
attr_accessor :discovery_date_specified
|
||||||
|
|
||||||
|
attr_accessor :release_date_specified
|
||||||
|
|
||||||
|
attr_accessor :cve
|
||||||
|
|
||||||
|
attr_accessor :product_statuses
|
||||||
|
|
||||||
|
attr_accessor :threats
|
||||||
|
|
||||||
|
attr_accessor :cvss_score_sets
|
||||||
|
|
||||||
|
attr_accessor :remediations
|
||||||
|
|
||||||
|
attr_accessor :acknowledgements
|
||||||
|
|
||||||
|
attr_accessor :ordinal
|
||||||
|
|
||||||
|
attr_accessor :revision_history
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'title' => :'Title',
|
||||||
|
:'notes' => :'Notes',
|
||||||
|
:'discovery_date_specified' => :'DiscoveryDateSpecified',
|
||||||
|
:'release_date_specified' => :'ReleaseDateSpecified',
|
||||||
|
:'cve' => :'CVE',
|
||||||
|
:'product_statuses' => :'ProductStatuses',
|
||||||
|
:'threats' => :'Threats',
|
||||||
|
:'cvss_score_sets' => :'CVSSScoreSets',
|
||||||
|
:'remediations' => :'Remediations',
|
||||||
|
:'acknowledgements' => :'Acknowledgements',
|
||||||
|
:'ordinal' => :'Ordinal',
|
||||||
|
:'revision_history' => :'RevisionHistory'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'title' => :'CvrfReturnTypes200DocumentTitle',
|
||||||
|
:'notes' => :'Array<CvrfReturnTypes200Notes>',
|
||||||
|
:'discovery_date_specified' => :'Boolean',
|
||||||
|
:'release_date_specified' => :'Boolean',
|
||||||
|
:'cve' => :'String',
|
||||||
|
:'product_statuses' => :'Array<CvrfReturnTypes200ProductStatuses>',
|
||||||
|
:'threats' => :'Array<CvrfReturnTypes200Threats>',
|
||||||
|
:'cvss_score_sets' => :'Array<CvrfReturnTypes200CVSSScoreSets>',
|
||||||
|
:'remediations' => :'Array<CvrfReturnTypes200Remediations>',
|
||||||
|
:'acknowledgements' => :'Array<CvrfReturnTypes200Acknowledgements>',
|
||||||
|
:'ordinal' => :'String',
|
||||||
|
:'revision_history' => :'Array<CvrfReturnTypes200DocumentTrackingRevisionHistory>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200Vulnerability` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200Vulnerability`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'title')
|
||||||
|
self.title = attributes[:'title']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'notes')
|
||||||
|
if (value = attributes[:'notes']).is_a?(Array)
|
||||||
|
self.notes = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'discovery_date_specified')
|
||||||
|
self.discovery_date_specified = attributes[:'discovery_date_specified']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'release_date_specified')
|
||||||
|
self.release_date_specified = attributes[:'release_date_specified']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'cve')
|
||||||
|
self.cve = attributes[:'cve']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'product_statuses')
|
||||||
|
if (value = attributes[:'product_statuses']).is_a?(Array)
|
||||||
|
self.product_statuses = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'threats')
|
||||||
|
if (value = attributes[:'threats']).is_a?(Array)
|
||||||
|
self.threats = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'cvss_score_sets')
|
||||||
|
if (value = attributes[:'cvss_score_sets']).is_a?(Array)
|
||||||
|
self.cvss_score_sets = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'remediations')
|
||||||
|
if (value = attributes[:'remediations']).is_a?(Array)
|
||||||
|
self.remediations = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'acknowledgements')
|
||||||
|
if (value = attributes[:'acknowledgements']).is_a?(Array)
|
||||||
|
self.acknowledgements = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'ordinal')
|
||||||
|
self.ordinal = attributes[:'ordinal']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'revision_history')
|
||||||
|
if (value = attributes[:'revision_history']).is_a?(Array)
|
||||||
|
self.revision_history = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
title == o.title &&
|
||||||
|
notes == o.notes &&
|
||||||
|
discovery_date_specified == o.discovery_date_specified &&
|
||||||
|
release_date_specified == o.release_date_specified &&
|
||||||
|
cve == o.cve &&
|
||||||
|
product_statuses == o.product_statuses &&
|
||||||
|
threats == o.threats &&
|
||||||
|
cvss_score_sets == o.cvss_score_sets &&
|
||||||
|
remediations == o.remediations &&
|
||||||
|
acknowledgements == o.acknowledgements &&
|
||||||
|
ordinal == o.ordinal &&
|
||||||
|
revision_history == o.revision_history
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[title, notes, discovery_date_specified, release_date_specified, cve, product_statuses, threats, cvss_score_sets, remediations, acknowledgements, ordinal, revision_history].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,219 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
# Swagger has some limitations and can not display complex XML documents in a model, please refer to the ICASI CVRF schema online. for a more exact specification on return schema.
|
||||||
|
class CvrfReturnTypes200Xml
|
||||||
|
attr_accessor :cvrfdoc
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'cvrfdoc' => :'cvrfdoc'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'cvrfdoc' => :'CvrfReturnTypes200XmlCvrfdoc'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200Xml` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200Xml`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'cvrfdoc')
|
||||||
|
self.cvrfdoc = attributes[:'cvrfdoc']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
cvrfdoc == o.cvrfdoc
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[cvrfdoc].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,274 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdoc
|
||||||
|
attr_accessor :document_title
|
||||||
|
|
||||||
|
attr_accessor :document_type
|
||||||
|
|
||||||
|
attr_accessor :document_publisher
|
||||||
|
|
||||||
|
attr_accessor :document_tracking
|
||||||
|
|
||||||
|
attr_accessor :document_notes
|
||||||
|
|
||||||
|
attr_accessor :product_tree
|
||||||
|
|
||||||
|
attr_accessor :vulnerability
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'document_title' => :'DocumentTitle',
|
||||||
|
:'document_type' => :'DocumentType',
|
||||||
|
:'document_publisher' => :'DocumentPublisher',
|
||||||
|
:'document_tracking' => :'DocumentTracking',
|
||||||
|
:'document_notes' => :'DocumentNotes',
|
||||||
|
:'product_tree' => :'ProductTree',
|
||||||
|
:'vulnerability' => :'Vulnerability'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'document_title' => :'String',
|
||||||
|
:'document_type' => :'String',
|
||||||
|
:'document_publisher' => :'CvrfReturnTypes200XmlCvrfdocDocumentPublisher',
|
||||||
|
:'document_tracking' => :'CvrfReturnTypes200XmlCvrfdocDocumentTracking',
|
||||||
|
:'document_notes' => :'Array<CvrfReturnTypes200XmlCvrfdocDocumentNotes>',
|
||||||
|
:'product_tree' => :'CvrfReturnTypes200XmlCvrfdocProductTree',
|
||||||
|
:'vulnerability' => :'CvrfReturnTypes200XmlCvrfdocVulnerability'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdoc` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdoc`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'document_title')
|
||||||
|
self.document_title = attributes[:'document_title']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_type')
|
||||||
|
self.document_type = attributes[:'document_type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_publisher')
|
||||||
|
self.document_publisher = attributes[:'document_publisher']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_tracking')
|
||||||
|
self.document_tracking = attributes[:'document_tracking']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'document_notes')
|
||||||
|
if (value = attributes[:'document_notes']).is_a?(Array)
|
||||||
|
self.document_notes = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'product_tree')
|
||||||
|
self.product_tree = attributes[:'product_tree']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'vulnerability')
|
||||||
|
self.vulnerability = attributes[:'vulnerability']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
document_title == o.document_title &&
|
||||||
|
document_type == o.document_type &&
|
||||||
|
document_publisher == o.document_publisher &&
|
||||||
|
document_tracking == o.document_tracking &&
|
||||||
|
document_notes == o.document_notes &&
|
||||||
|
product_tree == o.product_tree &&
|
||||||
|
vulnerability == o.vulnerability
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[document_title, document_type, document_publisher, document_tracking, document_notes, product_tree, vulnerability].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,218 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocDocumentNotes
|
||||||
|
attr_accessor :note
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'note' => :'Note'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'note' => :'CvrfReturnTypes200XmlCvrfdocNote'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentNotes` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentNotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'note')
|
||||||
|
self.note = attributes[:'note']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
note == o.note
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[note].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,236 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocDocumentPublisher
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :contact_details
|
||||||
|
|
||||||
|
attr_accessor :issuing_authority
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'contact_details' => :'ContactDetails',
|
||||||
|
:'issuing_authority' => :'IssuingAuthority'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'type' => :'String',
|
||||||
|
:'contact_details' => :'String',
|
||||||
|
:'issuing_authority' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentPublisher` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentPublisher`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'contact_details')
|
||||||
|
self.contact_details = attributes[:'contact_details']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'issuing_authority')
|
||||||
|
self.issuing_authority = attributes[:'issuing_authority']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
type == o.type &&
|
||||||
|
contact_details == o.contact_details &&
|
||||||
|
issuing_authority == o.issuing_authority
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[type, contact_details, issuing_authority].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,263 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocDocumentTracking
|
||||||
|
attr_accessor :identification
|
||||||
|
|
||||||
|
attr_accessor :status
|
||||||
|
|
||||||
|
attr_accessor :version
|
||||||
|
|
||||||
|
attr_accessor :revision_history
|
||||||
|
|
||||||
|
attr_accessor :initial_release_date
|
||||||
|
|
||||||
|
attr_accessor :current_release_date
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'identification' => :'Identification',
|
||||||
|
:'status' => :'Status',
|
||||||
|
:'version' => :'Version',
|
||||||
|
:'revision_history' => :'RevisionHistory',
|
||||||
|
:'initial_release_date' => :'InitialReleaseDate',
|
||||||
|
:'current_release_date' => :'CurrentReleaseDate'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'identification' => :'CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification',
|
||||||
|
:'status' => :'String',
|
||||||
|
:'version' => :'Float',
|
||||||
|
:'revision_history' => :'CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory',
|
||||||
|
:'initial_release_date' => :'Time',
|
||||||
|
:'current_release_date' => :'Time'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTracking` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTracking`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'identification')
|
||||||
|
self.identification = attributes[:'identification']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'status')
|
||||||
|
self.status = attributes[:'status']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'version')
|
||||||
|
self.version = attributes[:'version']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'revision_history')
|
||||||
|
self.revision_history = attributes[:'revision_history']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'initial_release_date')
|
||||||
|
self.initial_release_date = attributes[:'initial_release_date']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'current_release_date')
|
||||||
|
self.current_release_date = attributes[:'current_release_date']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
identification == o.identification &&
|
||||||
|
status == o.status &&
|
||||||
|
version == o.version &&
|
||||||
|
revision_history == o.revision_history &&
|
||||||
|
initial_release_date == o.initial_release_date &&
|
||||||
|
current_release_date == o.current_release_date
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[identification, status, version, revision_history, initial_release_date, current_release_date].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,227 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification
|
||||||
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :_alias
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'id' => :'ID',
|
||||||
|
:'_alias' => :'Alias'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'id' => :'String',
|
||||||
|
:'_alias' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingIdentification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'id')
|
||||||
|
self.id = attributes[:'id']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'_alias')
|
||||||
|
self._alias = attributes[:'_alias']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
id == o.id &&
|
||||||
|
_alias == o._alias
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[id, _alias].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,218 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory
|
||||||
|
attr_accessor :revision
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'revision' => :'Revision'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'revision' => :'CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'revision')
|
||||||
|
self.revision = attributes[:'revision']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
revision == o.revision
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[revision].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,236 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision
|
||||||
|
attr_accessor :number
|
||||||
|
|
||||||
|
attr_accessor :date
|
||||||
|
|
||||||
|
attr_accessor :description
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'number' => :'Number',
|
||||||
|
:'date' => :'Date',
|
||||||
|
:'description' => :'Description'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'number' => :'Integer',
|
||||||
|
:'date' => :'Time',
|
||||||
|
:'description' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocDocumentTrackingRevisionHistoryRevision`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'number')
|
||||||
|
self.number = attributes[:'number']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'date')
|
||||||
|
self.date = attributes[:'date']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'description')
|
||||||
|
self.description = attributes[:'description']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
number == o.number &&
|
||||||
|
date == o.date &&
|
||||||
|
description == o.description
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[number, date, description].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,246 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
# has a string in <Note>...</Note>
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocNote
|
||||||
|
attr_accessor :title
|
||||||
|
|
||||||
|
attr_accessor :audience
|
||||||
|
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :ordinal
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'title' => :'Title',
|
||||||
|
:'audience' => :'Audience',
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'ordinal' => :'Ordinal'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'title' => :'String',
|
||||||
|
:'audience' => :'String',
|
||||||
|
:'type' => :'String',
|
||||||
|
:'ordinal' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocNote` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocNote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'title')
|
||||||
|
self.title = attributes[:'title']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'audience')
|
||||||
|
self.audience = attributes[:'audience']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'ordinal')
|
||||||
|
self.ordinal = attributes[:'ordinal']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
title == o.title &&
|
||||||
|
audience == o.audience &&
|
||||||
|
type == o.type &&
|
||||||
|
ordinal == o.ordinal
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[title, audience, type, ordinal].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,231 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocProductTree
|
||||||
|
attr_accessor :branch
|
||||||
|
|
||||||
|
attr_accessor :full_product_name
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'branch' => :'Branch',
|
||||||
|
:'full_product_name' => :'FullProductName'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'branch' => :'Array<CvrfReturnTypes200XmlCvrfdocProductTreeBranch1>',
|
||||||
|
:'full_product_name' => :'Array<CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName1>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTree` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTree`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'branch')
|
||||||
|
if (value = attributes[:'branch']).is_a?(Array)
|
||||||
|
self.branch = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'full_product_name')
|
||||||
|
if (value = attributes[:'full_product_name']).is_a?(Array)
|
||||||
|
self.full_product_name = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
branch == o.branch &&
|
||||||
|
full_product_name == o.full_product_name
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[branch, full_product_name].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,238 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocProductTreeBranch
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
|
attr_accessor :full_product_name
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'name' => :'Name',
|
||||||
|
:'full_product_name' => :'FullProductName'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'type' => :'String',
|
||||||
|
:'name' => :'String',
|
||||||
|
:'full_product_name' => :'Array<CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'name')
|
||||||
|
self.name = attributes[:'name']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'full_product_name')
|
||||||
|
if (value = attributes[:'full_product_name']).is_a?(Array)
|
||||||
|
self.full_product_name = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
type == o.type &&
|
||||||
|
name == o.name &&
|
||||||
|
full_product_name == o.full_product_name
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[type, name, full_product_name].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,238 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocProductTreeBranch1
|
||||||
|
attr_accessor :type
|
||||||
|
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
|
attr_accessor :branch
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'type' => :'Type',
|
||||||
|
:'name' => :'Name',
|
||||||
|
:'branch' => :'Branch'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'type' => :'String',
|
||||||
|
:'name' => :'String',
|
||||||
|
:'branch' => :'Array<CvrfReturnTypes200XmlCvrfdocProductTreeBranch>'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch1` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeBranch1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'type')
|
||||||
|
self.type = attributes[:'type']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'name')
|
||||||
|
self.name = attributes[:'name']
|
||||||
|
end
|
||||||
|
|
||||||
|
if attributes.key?(:'branch')
|
||||||
|
if (value = attributes[:'branch']).is_a?(Array)
|
||||||
|
self.branch = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
type == o.type &&
|
||||||
|
name == o.name &&
|
||||||
|
branch == o.branch
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[type, name, branch].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
|
@ -0,0 +1,218 @@
|
||||||
|
=begin
|
||||||
|
#Microsoft Security Updates API
|
||||||
|
|
||||||
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
OpenAPI Generator version: 5.2.0-SNAPSHOT
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
|
module OpenapiClient
|
||||||
|
class CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName
|
||||||
|
attr_accessor :product_id
|
||||||
|
|
||||||
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
|
def self.attribute_map
|
||||||
|
{
|
||||||
|
:'product_id' => :'ProductID'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns all the JSON keys this model knows about
|
||||||
|
def self.acceptable_attributes
|
||||||
|
attribute_map.values
|
||||||
|
end
|
||||||
|
|
||||||
|
# Attribute type mapping.
|
||||||
|
def self.openapi_types
|
||||||
|
{
|
||||||
|
:'product_id' => :'String'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of attributes with nullable: true
|
||||||
|
def self.openapi_nullable
|
||||||
|
Set.new([
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Initializes the object
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
def initialize(attributes = {})
|
||||||
|
if (!attributes.is_a?(Hash))
|
||||||
|
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName` initialize method"
|
||||||
|
end
|
||||||
|
|
||||||
|
# check to see if the attribute exists and convert string to symbol for hash key
|
||||||
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||||
|
if (!self.class.attribute_map.key?(k.to_sym))
|
||||||
|
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CvrfReturnTypes200XmlCvrfdocProductTreeFullProductName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||||
|
end
|
||||||
|
h[k.to_sym] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
if attributes.key?(:'product_id')
|
||||||
|
self.product_id = attributes[:'product_id']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Show invalid properties with the reasons. Usually used together with valid?
|
||||||
|
# @return Array for valid properties with the reasons
|
||||||
|
def list_invalid_properties
|
||||||
|
invalid_properties = Array.new
|
||||||
|
invalid_properties
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check to see if the all the properties in the model are valid
|
||||||
|
# @return true if the model is valid
|
||||||
|
def valid?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Checks equality by comparing each attribute.
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def ==(o)
|
||||||
|
return true if self.equal?(o)
|
||||||
|
self.class == o.class &&
|
||||||
|
product_id == o.product_id
|
||||||
|
end
|
||||||
|
|
||||||
|
# @see the `==` method
|
||||||
|
# @param [Object] Object to be compared
|
||||||
|
def eql?(o)
|
||||||
|
self == o
|
||||||
|
end
|
||||||
|
|
||||||
|
# Calculates hash code according to all attributes.
|
||||||
|
# @return [Integer] Hash code
|
||||||
|
def hash
|
||||||
|
[product_id].hash
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def self.build_from_hash(attributes)
|
||||||
|
new.build_from_hash(attributes)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Builds the object from hash
|
||||||
|
# @param [Hash] attributes Model attributes in the form of hash
|
||||||
|
# @return [Object] Returns the model itself
|
||||||
|
def build_from_hash(attributes)
|
||||||
|
return nil unless attributes.is_a?(Hash)
|
||||||
|
self.class.openapi_types.each_pair do |key, type|
|
||||||
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
||||||
|
self.send("#{key}=", nil)
|
||||||
|
elsif type =~ /\AArray<(.*)>/i
|
||||||
|
# check to ensure the input is an array given that the attribute
|
||||||
|
# is documented as an array but the input is not
|
||||||
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||||
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
||||||
|
end
|
||||||
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||||
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
# Deserializes the data based on type
|
||||||
|
# @param string type Data type
|
||||||
|
# @param string value Value to be deserialized
|
||||||
|
# @return [Object] Deserialized data
|
||||||
|
def _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 = OpenapiClient.const_get(type)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Returns the object in the form of hash
|
||||||
|
# @return [Hash] Returns the object in the form of hash
|
||||||
|
def to_hash
|
||||||
|
hash = {}
|
||||||
|
self.class.attribute_map.each_pair do |attr, param|
|
||||||
|
value = self.send(attr)
|
||||||
|
if value.nil?
|
||||||
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||||
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
hash[param] = _to_hash(value)
|
||||||
|
end
|
||||||
|
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
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue