pds-metronome 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +164 -0
- data/Rakefile +10 -0
- data/docs/AccessManagementApi.md +300 -0
- data/docs/AccessType.md +15 -0
- data/docs/AgingOffsetUnit.md +15 -0
- data/docs/AgingStrategy.md +15 -0
- data/docs/ApiKeyData.md +28 -0
- data/docs/ApiKeyDataListResponse.md +20 -0
- data/docs/ApiKeyListResponse.md +20 -0
- data/docs/CreateApiKeyRequest.md +22 -0
- data/docs/CreateOrModifyApiKeyResponse.md +22 -0
- data/docs/CreateOrModifyPolicyRequest.md +22 -0
- data/docs/CreateOrModifyPolicyResponse.md +20 -0
- data/docs/DataExpiryApi.md +79 -0
- data/docs/ExpireItemResponse.md +20 -0
- data/docs/ExpireSubItemResponse.md +22 -0
- data/docs/ExpiryResponse.md +22 -0
- data/docs/ExpiryResponsePendingInner.md +79 -0
- data/docs/GetManyApiKeys200Response.md +79 -0
- data/docs/GetManyPolicies200Response.md +79 -0
- data/docs/ItemAccessApi.md +605 -0
- data/docs/ItemExpiry.md +20 -0
- data/docs/ItemMetadataResponse.md +28 -0
- data/docs/ItemOrSubItemAccessLog.md +32 -0
- data/docs/ItemOrSubItemPolicyResponse.md +22 -0
- data/docs/ModifyApiKeyRequest.md +20 -0
- data/docs/Permission.md +15 -0
- data/docs/PermissionDeniedResponse.md +30 -0
- data/docs/PolicyData.md +26 -0
- data/docs/PolicyDataListResponse.md +28 -0
- data/docs/PolicyListResponse.md +28 -0
- data/docs/PolicyManagementApi.md +379 -0
- data/docs/PutApiKeyRequest.md +49 -0
- data/docs/SignupRequest.md +18 -0
- data/docs/SignupResponse.md +24 -0
- data/docs/SubItemMetadataResponse.md +22 -0
- data/docs/SubItemsExpiry.md +22 -0
- data/docs/TelemetryApi.md +80 -0
- data/docs/TelemetryObservation.md +20 -0
- data/docs/TelemetryRequest.md +22 -0
- data/docs/ValidationErrorResponseInner.md +22 -0
- data/docs/ValidationProblem.md +22 -0
- data/lib/metronome/api/access_management_api.rb +285 -0
- data/lib/metronome/api/data_expiry_api.rb +105 -0
- data/lib/metronome/api/item_access_api.rb +549 -0
- data/lib/metronome/api/policy_management_api.rb +348 -0
- data/lib/metronome/api/telemetry_api.rb +84 -0
- data/lib/metronome/api_client.rb +393 -0
- data/lib/metronome/api_error.rb +58 -0
- data/lib/metronome/configuration.rb +312 -0
- data/lib/metronome/models/access_type.rb +41 -0
- data/lib/metronome/models/aging_offset_unit.rb +41 -0
- data/lib/metronome/models/aging_strategy.rb +40 -0
- data/lib/metronome/models/api_key_data.rb +330 -0
- data/lib/metronome/models/api_key_data_list_response.rb +241 -0
- data/lib/metronome/models/api_key_list_response.rb +241 -0
- data/lib/metronome/models/create_api_key_request.rb +239 -0
- data/lib/metronome/models/create_or_modify_api_key_response.rb +255 -0
- data/lib/metronome/models/create_or_modify_policy_request.rb +293 -0
- data/lib/metronome/models/create_or_modify_policy_response.rb +240 -0
- data/lib/metronome/models/expire_item_response.rb +240 -0
- data/lib/metronome/models/expire_sub_item_response.rb +254 -0
- data/lib/metronome/models/expiry_response.rb +299 -0
- data/lib/metronome/models/expiry_response_pending_inner.rb +55 -0
- data/lib/metronome/models/get_many_api_keys200_response.rb +55 -0
- data/lib/metronome/models/get_many_policies200_response.rb +55 -0
- data/lib/metronome/models/item_expiry.rb +239 -0
- data/lib/metronome/models/item_metadata_response.rb +274 -0
- data/lib/metronome/models/item_or_sub_item_access_log.rb +337 -0
- data/lib/metronome/models/item_or_sub_item_policy_response.rb +245 -0
- data/lib/metronome/models/modify_api_key_request.rb +230 -0
- data/lib/metronome/models/permission.rb +45 -0
- data/lib/metronome/models/permission_denied_response.rb +338 -0
- data/lib/metronome/models/policy_data.rb +364 -0
- data/lib/metronome/models/policy_data_list_response.rb +286 -0
- data/lib/metronome/models/policy_list_response.rb +286 -0
- data/lib/metronome/models/put_api_key_request.rb +105 -0
- data/lib/metronome/models/signup_request.rb +225 -0
- data/lib/metronome/models/signup_response.rb +266 -0
- data/lib/metronome/models/sub_item_metadata_response.rb +245 -0
- data/lib/metronome/models/sub_items_expiry.rb +255 -0
- data/lib/metronome/models/telemetry_observation.rb +240 -0
- data/lib/metronome/models/telemetry_request.rb +259 -0
- data/lib/metronome/models/validation_error_response_inner.rb +254 -0
- data/lib/metronome/models/validation_problem.rb +254 -0
- data/lib/metronome/version.rb +15 -0
- data/lib/metronome.rb +80 -0
- data/shell.nix +6 -0
- data/spec/api/access_management_api_spec.rb +82 -0
- data/spec/api/data_expiry_api_spec.rb +46 -0
- data/spec/api/item_access_api_spec.rb +132 -0
- data/spec/api/policy_management_api_spec.rb +94 -0
- data/spec/api/telemetry_api_spec.rb +46 -0
- data/spec/api_client_spec.rb +228 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_type_spec.rb +28 -0
- data/spec/models/aging_offset_unit_spec.rb +28 -0
- data/spec/models/aging_strategy_spec.rb +28 -0
- data/spec/models/api_key_data_list_response_spec.rb +40 -0
- data/spec/models/api_key_data_spec.rb +68 -0
- data/spec/models/api_key_list_response_spec.rb +40 -0
- data/spec/models/create_api_key_request_spec.rb +46 -0
- data/spec/models/create_or_modify_api_key_response_spec.rb +46 -0
- data/spec/models/create_or_modify_policy_request_spec.rb +46 -0
- data/spec/models/create_or_modify_policy_response_spec.rb +40 -0
- data/spec/models/expire_item_response_spec.rb +40 -0
- data/spec/models/expire_sub_item_response_spec.rb +46 -0
- data/spec/models/expiry_response_pending_inner_spec.rb +43 -0
- data/spec/models/expiry_response_spec.rb +46 -0
- data/spec/models/get_many_api_keys200_response_spec.rb +43 -0
- data/spec/models/get_many_policies200_response_spec.rb +43 -0
- data/spec/models/item_expiry_spec.rb +40 -0
- data/spec/models/item_metadata_response_spec.rb +64 -0
- data/spec/models/item_or_sub_item_access_log_spec.rb +76 -0
- data/spec/models/item_or_sub_item_policy_response_spec.rb +46 -0
- data/spec/models/modify_api_key_request_spec.rb +40 -0
- data/spec/models/permission_denied_response_spec.rb +82 -0
- data/spec/models/permission_spec.rb +28 -0
- data/spec/models/policy_data_list_response_spec.rb +64 -0
- data/spec/models/policy_data_spec.rb +58 -0
- data/spec/models/policy_list_response_spec.rb +64 -0
- data/spec/models/put_api_key_request_spec.rb +31 -0
- data/spec/models/signup_request_spec.rb +34 -0
- data/spec/models/signup_response_spec.rb +52 -0
- data/spec/models/sub_item_metadata_response_spec.rb +46 -0
- data/spec/models/sub_items_expiry_spec.rb +46 -0
- data/spec/models/telemetry_observation_spec.rb +40 -0
- data/spec/models/telemetry_request_spec.rb +46 -0
- data/spec/models/validation_error_response_inner_spec.rb +46 -0
- data/spec/models/validation_problem_spec.rb +46 -0
- data/spec/spec_helper.rb +111 -0
- metadata +260 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for Metronome::PolicyManagementApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'PolicyManagementApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = Metronome::PolicyManagementApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of PolicyManagementApi' do
|
|
30
|
+
it 'should create an instance of PolicyManagementApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(Metronome::PolicyManagementApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for get_many_policies
|
|
36
|
+
# Read many policies alphanumerically sorted
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [String] :prefix
|
|
39
|
+
# @option opts [Integer] :offset The number of policies to drop from the start
|
|
40
|
+
# @option opts [Integer] :limit The number of policies to include
|
|
41
|
+
# @option opts [Boolean] :include_data Whether to include aging-strategy, aging-offset-amount, aging-offset-unit etc.
|
|
42
|
+
# @return [GetManyPolicies200Response]
|
|
43
|
+
describe 'get_many_policies test' do
|
|
44
|
+
it 'should work' do
|
|
45
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# unit tests for get_policy
|
|
50
|
+
# Read a specific policy
|
|
51
|
+
# @param policy_id
|
|
52
|
+
# @param [Hash] opts the optional parameters
|
|
53
|
+
# @return [PolicyData]
|
|
54
|
+
describe 'get_policy test' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# unit tests for get_policy_log
|
|
61
|
+
# Read a specific policy's access log
|
|
62
|
+
# @param policy_id
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [PolicyData]
|
|
65
|
+
describe 'get_policy_log test' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# unit tests for get_policy_members
|
|
72
|
+
# Read the items and sub-items that have been used for a specific policy
|
|
73
|
+
# @param policy_id
|
|
74
|
+
# @param [Hash] opts the optional parameters
|
|
75
|
+
# @return [PolicyData]
|
|
76
|
+
describe 'get_policy_members test' do
|
|
77
|
+
it 'should work' do
|
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# unit tests for put_policy
|
|
83
|
+
# Create or modify a policy
|
|
84
|
+
# @param policy_id The name of the policy to be created
|
|
85
|
+
# @param [Hash] opts the optional parameters
|
|
86
|
+
# @option opts [CreateOrModifyPolicyRequest] :create_or_modify_policy_request
|
|
87
|
+
# @return [CreateOrModifyPolicyResponse]
|
|
88
|
+
describe 'put_policy test' do
|
|
89
|
+
it 'should work' do
|
|
90
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for Metronome::TelemetryApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'TelemetryApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = Metronome::TelemetryApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of TelemetryApi' do
|
|
30
|
+
it 'should create an instance of TelemetryApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(Metronome::TelemetryApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for post_telemetry
|
|
36
|
+
# Read items and sub-items that will or have already been expired on the given date
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [TelemetryRequest] :telemetry_request
|
|
39
|
+
# @return [nil]
|
|
40
|
+
describe 'post_telemetry test' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
|
|
15
|
+
describe Metronome::ApiClient do
|
|
16
|
+
context 'initialization' do
|
|
17
|
+
context 'URL stuff' do
|
|
18
|
+
context 'host' do
|
|
19
|
+
it 'removes http from host' do
|
|
20
|
+
Metronome.configure { |c| c.host = 'http://example.com' }
|
|
21
|
+
expect(Metronome::Configuration.default.host).to eq('example.com')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'removes https from host' do
|
|
25
|
+
Metronome.configure { |c| c.host = 'https://wookiee.com' }
|
|
26
|
+
expect(Metronome::ApiClient.default.config.host).to eq('wookiee.com')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'removes trailing path from host' do
|
|
30
|
+
Metronome.configure { |c| c.host = 'hobo.com/v4' }
|
|
31
|
+
expect(Metronome::Configuration.default.host).to eq('hobo.com')
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
context 'base_path' do
|
|
36
|
+
it "prepends a slash to base_path" do
|
|
37
|
+
Metronome.configure { |c| c.base_path = 'v4/dog' }
|
|
38
|
+
expect(Metronome::Configuration.default.base_path).to eq('/v4/dog')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
|
42
|
+
Metronome.configure { |c| c.base_path = '/v4/dog' }
|
|
43
|
+
expect(Metronome::Configuration.default.base_path).to eq('/v4/dog')
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "ends up as a blank string if nil" do
|
|
47
|
+
Metronome.configure { |c| c.base_path = nil }
|
|
48
|
+
expect(Metronome::Configuration.default.base_path).to eq('')
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'params_encoding in #build_request' do
|
|
55
|
+
let(:config) { Metronome::Configuration.new }
|
|
56
|
+
let(:api_client) { Metronome::ApiClient.new(config) }
|
|
57
|
+
|
|
58
|
+
it 'defaults to nil' do
|
|
59
|
+
expect(Metronome::Configuration.default.params_encoding).to eq(nil)
|
|
60
|
+
expect(config.params_encoding).to eq(nil)
|
|
61
|
+
|
|
62
|
+
request = api_client.build_request(:get, '/test')
|
|
63
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'can be customized' do
|
|
67
|
+
config.params_encoding = :multi
|
|
68
|
+
request = api_client.build_request(:get, '/test')
|
|
69
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
describe 'timeout in #build_request' do
|
|
74
|
+
let(:config) { Metronome::Configuration.new }
|
|
75
|
+
let(:api_client) { Metronome::ApiClient.new(config) }
|
|
76
|
+
|
|
77
|
+
it 'defaults to 0' do
|
|
78
|
+
expect(Metronome::Configuration.default.timeout).to eq(0)
|
|
79
|
+
expect(config.timeout).to eq(0)
|
|
80
|
+
|
|
81
|
+
request = api_client.build_request(:get, '/test')
|
|
82
|
+
expect(request.options[:timeout]).to eq(0)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it 'can be customized' do
|
|
86
|
+
config.timeout = 100
|
|
87
|
+
request = api_client.build_request(:get, '/test')
|
|
88
|
+
expect(request.options[:timeout]).to eq(100)
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
describe '#deserialize' do
|
|
95
|
+
it "handles Array<Integer>" do
|
|
96
|
+
api_client = Metronome::ApiClient.new
|
|
97
|
+
headers = { 'Content-Type' => 'application/json' }
|
|
98
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
|
99
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
|
100
|
+
expect(data).to be_instance_of(Array)
|
|
101
|
+
expect(data).to eq([12, 34])
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
it 'handles Array<Array<Integer>>' do
|
|
105
|
+
api_client = Metronome::ApiClient.new
|
|
106
|
+
headers = { 'Content-Type' => 'application/json' }
|
|
107
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
|
108
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
|
109
|
+
expect(data).to be_instance_of(Array)
|
|
110
|
+
expect(data).to eq([[12, 34], [56]])
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
it 'handles Hash<String, String>' do
|
|
114
|
+
api_client = Metronome::ApiClient.new
|
|
115
|
+
headers = { 'Content-Type' => 'application/json' }
|
|
116
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
|
117
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
|
118
|
+
expect(data).to be_instance_of(Hash)
|
|
119
|
+
expect(data).to eq(:message => 'Hello')
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
describe "#object_to_hash" do
|
|
124
|
+
it 'ignores nils and includes empty arrays' do
|
|
125
|
+
# uncomment below to test object_to_hash for model
|
|
126
|
+
# api_client = Metronome::ApiClient.new
|
|
127
|
+
# _model = Metronome::ModelName.new
|
|
128
|
+
# update the model attribute below
|
|
129
|
+
# _model.id = 1
|
|
130
|
+
# update the expected value (hash) below
|
|
131
|
+
# expected = {id: 1, name: '', tags: []}
|
|
132
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
describe '#build_collection_param' do
|
|
137
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
|
138
|
+
let(:api_client) { Metronome::ApiClient.new }
|
|
139
|
+
|
|
140
|
+
it 'works for csv' do
|
|
141
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
it 'works for ssv' do
|
|
145
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
it 'works for tsv' do
|
|
149
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
it 'works for pipes' do
|
|
153
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
it 'works for multi' do
|
|
157
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
it 'fails for invalid collection format' do
|
|
161
|
+
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
describe '#json_mime?' do
|
|
166
|
+
let(:api_client) { Metronome::ApiClient.new }
|
|
167
|
+
|
|
168
|
+
it 'works' do
|
|
169
|
+
expect(api_client.json_mime?(nil)).to eq false
|
|
170
|
+
expect(api_client.json_mime?('')).to eq false
|
|
171
|
+
|
|
172
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
|
173
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
|
174
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
|
175
|
+
|
|
176
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
|
177
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
|
178
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
describe '#select_header_accept' do
|
|
183
|
+
let(:api_client) { Metronome::ApiClient.new }
|
|
184
|
+
|
|
185
|
+
it 'works' do
|
|
186
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
|
187
|
+
expect(api_client.select_header_accept([])).to be_nil
|
|
188
|
+
|
|
189
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
|
190
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
|
191
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
|
192
|
+
|
|
193
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
|
194
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
describe '#select_header_content_type' do
|
|
199
|
+
let(:api_client) { Metronome::ApiClient.new }
|
|
200
|
+
|
|
201
|
+
it 'works' do
|
|
202
|
+
expect(api_client.select_header_content_type(nil)).to be_nil
|
|
203
|
+
expect(api_client.select_header_content_type([])).to be_nil
|
|
204
|
+
|
|
205
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
|
206
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
|
207
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
|
208
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
|
209
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
describe '#sanitize_filename' do
|
|
214
|
+
let(:api_client) { Metronome::ApiClient.new }
|
|
215
|
+
|
|
216
|
+
it 'works' do
|
|
217
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
|
218
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
|
219
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
|
220
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
|
221
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
|
222
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
|
223
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
|
224
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
|
225
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
|
|
15
|
+
describe Metronome::Configuration do
|
|
16
|
+
let(:config) { Metronome::Configuration.default }
|
|
17
|
+
|
|
18
|
+
before(:each) do
|
|
19
|
+
# uncomment below to setup host and base_path
|
|
20
|
+
# require 'URI'
|
|
21
|
+
# uri = URI.parse("https://YOUR-CUSTOMER-ID.api.eu-north-1.privatedataservices.com")
|
|
22
|
+
# Metronome.configure do |c|
|
|
23
|
+
# c.host = uri.host
|
|
24
|
+
# c.base_path = uri.path
|
|
25
|
+
# end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe '#base_url' do
|
|
29
|
+
it 'should have the default value' do
|
|
30
|
+
# uncomment below to test default value of the base path
|
|
31
|
+
# expect(config.base_url).to eq("https://YOUR-CUSTOMER-ID.api.eu-north-1.privatedataservices.com")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'should remove trailing slashes' do
|
|
35
|
+
[nil, '', '/', '//'].each do |base_path|
|
|
36
|
+
config.base_path = base_path
|
|
37
|
+
# uncomment below to test trailing slashes
|
|
38
|
+
# expect(config.base_url).to eq("https://YOUR-CUSTOMER-ID.api.eu-north-1.privatedataservices.com")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Metronome::AccessType
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Metronome::AccessType do
|
|
21
|
+
let(:instance) { Metronome::AccessType.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of AccessType' do
|
|
24
|
+
it 'should create an instance of AccessType' do
|
|
25
|
+
expect(instance).to be_instance_of(Metronome::AccessType)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Metronome::AgingOffsetUnit
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Metronome::AgingOffsetUnit do
|
|
21
|
+
let(:instance) { Metronome::AgingOffsetUnit.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of AgingOffsetUnit' do
|
|
24
|
+
it 'should create an instance of AgingOffsetUnit' do
|
|
25
|
+
expect(instance).to be_instance_of(Metronome::AgingOffsetUnit)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Metronome::AgingStrategy
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Metronome::AgingStrategy do
|
|
21
|
+
let(:instance) { Metronome::AgingStrategy.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of AgingStrategy' do
|
|
24
|
+
it 'should create an instance of AgingStrategy' do
|
|
25
|
+
expect(instance).to be_instance_of(Metronome::AgingStrategy)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Metronome::ApiKeyDataListResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Metronome::ApiKeyDataListResponse do
|
|
21
|
+
let(:instance) { Metronome::ApiKeyDataListResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ApiKeyDataListResponse' do
|
|
24
|
+
it 'should create an instance of ApiKeyDataListResponse' do
|
|
25
|
+
expect(instance).to be_instance_of(Metronome::ApiKeyDataListResponse)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
describe 'test attribute "response_type"' do
|
|
29
|
+
it 'should work' do
|
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe 'test attribute "result"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Metronome::ApiKeyData
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Metronome::ApiKeyData do
|
|
21
|
+
let(:instance) { Metronome::ApiKeyData.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ApiKeyData' do
|
|
24
|
+
it 'should create an instance of ApiKeyData' do
|
|
25
|
+
expect(instance).to be_instance_of(Metronome::ApiKeyData)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
describe 'test attribute "id"' do
|
|
29
|
+
it 'should work' do
|
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe 'test attribute "name"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "description"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "value"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "status"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
55
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["enabled", "disabled"])
|
|
56
|
+
# validator.allowable_values.each do |value|
|
|
57
|
+
# expect { instance.status = value }.not_to raise_error
|
|
58
|
+
# end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
describe 'test attribute "permissions"' do
|
|
63
|
+
it 'should work' do
|
|
64
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Metronome API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: info@privatedataservices.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Metronome::ApiKeyListResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Metronome::ApiKeyListResponse do
|
|
21
|
+
let(:instance) { Metronome::ApiKeyListResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ApiKeyListResponse' do
|
|
24
|
+
it 'should create an instance of ApiKeyListResponse' do
|
|
25
|
+
expect(instance).to be_instance_of(Metronome::ApiKeyListResponse)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
describe 'test attribute "response_type"' do
|
|
29
|
+
it 'should work' do
|
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe 'test attribute "result"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|