45 lines
925 B
Ruby
Executable file
45 lines
925 B
Ruby
Executable file
require 'openapi_client'
|
|
require 'date'
|
|
require 'json'
|
|
require 'pry'
|
|
|
|
MONTHS = %w[
|
|
Jan
|
|
Feb
|
|
Mar
|
|
Apr
|
|
May
|
|
Jun
|
|
Jul
|
|
Aug
|
|
Sep
|
|
Oct
|
|
Nov
|
|
Dec
|
|
]
|
|
|
|
BEGIN_YEAR = 2016
|
|
CURRENT_YEAR = Date.today.year
|
|
YEAR_RANGE = (BEGIN_YEAR..CURRENT_YEAR).to_a
|
|
|
|
class MicrosoftCvrfClient
|
|
attr_accessor :ids, :api_instance, :api_version, :api_key
|
|
|
|
def initialize(api_instance = OpenapiClient::DefaultApi.new, api_version = 'api_version_example', api_key = 'api_key_example')
|
|
@ids = YEAR_RANGE.map { |y| MONTHS.map { |m| "#{y}-#{m}" } }.flatten
|
|
@api_instance = api_instance
|
|
@api_version = api_version
|
|
@api_key = api_key
|
|
end
|
|
|
|
def get_id(id)
|
|
p "Now checking #{id}"
|
|
p "------------------"
|
|
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
|
|
end
|
|
|
|
c = MicrosoftCvrfClient.new
|