notifo-io-easierlife 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +167 -0
- data/Rakefile +10 -0
- data/docs/AddAllowedTopicDto.md +18 -0
- data/docs/AddContributorDto.md +20 -0
- data/docs/AppContributorDto.md +22 -0
- data/docs/AppDetailsDto.md +48 -0
- data/docs/AppDto.md +28 -0
- data/docs/AppsApi.md +646 -0
- data/docs/ConfigsApi.md +127 -0
- data/docs/ConfirmMode.md +15 -0
- data/docs/CreateEmailTemplateDto.md +18 -0
- data/docs/EmailTemplateDto.md +22 -0
- data/docs/EmailVerificationStatus.md +15 -0
- data/docs/ErrorDto.md +26 -0
- data/docs/EventDto.md +40 -0
- data/docs/EventsApi.md +142 -0
- data/docs/IsoDayOfWeek.md +15 -0
- data/docs/ListResponseDtoOfEventDto.md +20 -0
- data/docs/ListResponseDtoOfLogEntryDto.md +20 -0
- data/docs/ListResponseDtoOfMediaDto.md +20 -0
- data/docs/ListResponseDtoOfSubscriptionDto.md +20 -0
- data/docs/ListResponseDtoOfTemplateDto.md +20 -0
- data/docs/ListResponseDtoOfTopicDto.md +20 -0
- data/docs/ListResponseDtoOfUserDto.md +20 -0
- data/docs/LogEntryDto.md +24 -0
- data/docs/LogsApi.md +78 -0
- data/docs/MediaApi.md +382 -0
- data/docs/MediaDto.md +30 -0
- data/docs/MediaType.md +15 -0
- data/docs/NotificationFormattingDto.md +32 -0
- data/docs/NotificationSend.md +15 -0
- data/docs/NotificationSettingDto.md +20 -0
- data/docs/ProfileDto.md +32 -0
- data/docs/PublishDto.md +36 -0
- data/docs/PublishManyDto.md +18 -0
- data/docs/ResizeMode.md +15 -0
- data/docs/SchedulingDto.md +24 -0
- data/docs/SchedulingType.md +15 -0
- data/docs/SubscriptionDto.md +20 -0
- data/docs/TemplateDto.md +22 -0
- data/docs/TemplatesApi.md +208 -0
- data/docs/TopicDto.md +22 -0
- data/docs/TopicsApi.md +78 -0
- data/docs/UpdateProfileDto.md +28 -0
- data/docs/UpsertAppDto.md +36 -0
- data/docs/UpsertTemplateDto.md +22 -0
- data/docs/UpsertTemplatesDto.md +18 -0
- data/docs/UpsertUserDto.md +32 -0
- data/docs/UpsertUsersDto.md +18 -0
- data/docs/UserApi.md +323 -0
- data/docs/UserDto.md +36 -0
- data/docs/UsersApi.md +610 -0
- data/git_push.sh +58 -0
- data/lib/notifo.rb +89 -0
- data/lib/notifo/api/apps_api.rb +678 -0
- data/lib/notifo/api/configs_api.rb +132 -0
- data/lib/notifo/api/events_api.rb +161 -0
- data/lib/notifo/api/logs_api.rb +92 -0
- data/lib/notifo/api/media_api.rb +419 -0
- data/lib/notifo/api/templates_api.rb +228 -0
- data/lib/notifo/api/topics_api.rb +92 -0
- data/lib/notifo/api/user_api.rb +331 -0
- data/lib/notifo/api/users_api.rb +667 -0
- data/lib/notifo/api_client.rb +389 -0
- data/lib/notifo/api_error.rb +57 -0
- data/lib/notifo/configuration.rb +270 -0
- data/lib/notifo/models/add_allowed_topic_dto.rb +243 -0
- data/lib/notifo/models/add_contributor_dto.rb +277 -0
- data/lib/notifo/models/app_contributor_dto.rb +311 -0
- data/lib/notifo/models/app_details_dto.rb +489 -0
- data/lib/notifo/models/app_dto.rb +362 -0
- data/lib/notifo/models/confirm_mode.rb +38 -0
- data/lib/notifo/models/create_email_template_dto.rb +243 -0
- data/lib/notifo/models/email_template_dto.rb +288 -0
- data/lib/notifo/models/email_verification_status.rb +39 -0
- data/lib/notifo/models/error_dto.rb +265 -0
- data/lib/notifo/models/event_dto.rb +456 -0
- data/lib/notifo/models/iso_day_of_week.rb +43 -0
- data/lib/notifo/models/list_response_dto_of_event_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_log_entry_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_media_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_subscription_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_template_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_topic_dto.rb +241 -0
- data/lib/notifo/models/list_response_dto_of_user_dto.rb +241 -0
- data/lib/notifo/models/log_entry_dto.rb +326 -0
- data/lib/notifo/models/media_dto.rb +390 -0
- data/lib/notifo/models/media_type.rb +39 -0
- data/lib/notifo/models/notification_formatting_dto.rb +305 -0
- data/lib/notifo/models/notification_send.rb +39 -0
- data/lib/notifo/models/notification_setting_dto.rb +234 -0
- data/lib/notifo/models/profile_dto.rb +361 -0
- data/lib/notifo/models/publish_dto.rb +338 -0
- data/lib/notifo/models/publish_many_dto.rb +226 -0
- data/lib/notifo/models/resize_mode.rb +42 -0
- data/lib/notifo/models/scheduling_dto.rb +248 -0
- data/lib/notifo/models/scheduling_type.rb +37 -0
- data/lib/notifo/models/subscription_dto.rb +256 -0
- data/lib/notifo/models/template_dto.rb +274 -0
- data/lib/notifo/models/topic_dto.rb +294 -0
- data/lib/notifo/models/update_profile_dto.rb +277 -0
- data/lib/notifo/models/upsert_app_dto.rb +321 -0
- data/lib/notifo/models/upsert_template_dto.rb +270 -0
- data/lib/notifo/models/upsert_templates_dto.rb +226 -0
- data/lib/notifo/models/upsert_user_dto.rb +299 -0
- data/lib/notifo/models/upsert_users_dto.rb +226 -0
- data/lib/notifo/models/user_dto.rb +381 -0
- data/lib/notifo/version.rb +15 -0
- data/notifo-io-1.0.0.gem +0 -0
- data/notifo.gemspec +38 -0
- data/spec/api/apps_api_spec.rb +151 -0
- data/spec/api/configs_api_spec.rb +55 -0
- data/spec/api/events_api_spec.rb +61 -0
- data/spec/api/logs_api_spec.rb +49 -0
- data/spec/api/media_api_spec.rb +117 -0
- data/spec/api/templates_api_spec.rb +73 -0
- data/spec/api/topics_api_spec.rb +49 -0
- data/spec/api/user_api_spec.rb +92 -0
- data/spec/api/users_api_spec.rb +152 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/add_allowed_topic_dto_spec.rb +34 -0
- data/spec/models/add_contributor_dto_spec.rb +40 -0
- data/spec/models/app_contributor_dto_spec.rb +46 -0
- data/spec/models/app_details_dto_spec.rb +124 -0
- data/spec/models/app_dto_spec.rb +64 -0
- data/spec/models/confirm_mode_spec.rb +28 -0
- data/spec/models/create_email_template_dto_spec.rb +34 -0
- data/spec/models/email_template_dto_spec.rb +46 -0
- data/spec/models/email_verification_status_spec.rb +28 -0
- data/spec/models/error_dto_spec.rb +58 -0
- data/spec/models/event_dto_spec.rb +100 -0
- data/spec/models/iso_day_of_week_spec.rb +28 -0
- data/spec/models/list_response_dto_of_event_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_log_entry_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_media_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_subscription_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_template_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_topic_dto_spec.rb +40 -0
- data/spec/models/list_response_dto_of_user_dto_spec.rb +40 -0
- data/spec/models/log_entry_dto_spec.rb +52 -0
- data/spec/models/media_dto_spec.rb +70 -0
- data/spec/models/media_type_spec.rb +28 -0
- data/spec/models/notification_formatting_dto_spec.rb +76 -0
- data/spec/models/notification_send_spec.rb +28 -0
- data/spec/models/notification_setting_dto_spec.rb +40 -0
- data/spec/models/profile_dto_spec.rb +76 -0
- data/spec/models/publish_dto_spec.rb +88 -0
- data/spec/models/publish_many_dto_spec.rb +34 -0
- data/spec/models/resize_mode_spec.rb +28 -0
- data/spec/models/scheduling_dto_spec.rb +52 -0
- data/spec/models/scheduling_type_spec.rb +28 -0
- data/spec/models/subscription_dto_spec.rb +40 -0
- data/spec/models/template_dto_spec.rb +46 -0
- data/spec/models/topic_dto_spec.rb +46 -0
- data/spec/models/update_profile_dto_spec.rb +64 -0
- data/spec/models/upsert_app_dto_spec.rb +88 -0
- data/spec/models/upsert_template_dto_spec.rb +46 -0
- data/spec/models/upsert_templates_dto_spec.rb +34 -0
- data/spec/models/upsert_user_dto_spec.rb +76 -0
- data/spec/models/upsert_users_dto_spec.rb +34 -0
- data/spec/models/user_dto_spec.rb +88 -0
- data/spec/spec_helper.rb +111 -0
- metadata +301 -0
@@ -0,0 +1,152 @@
|
|
1
|
+
=begin
|
2
|
+
#Notifo 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
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Notifo::UsersApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'UsersApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Notifo::UsersApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of UsersApi' do
|
30
|
+
it 'should create an instance of UsersApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Notifo::UsersApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for users_delete_allowed_topic
|
36
|
+
# Remove an allowed topic.
|
37
|
+
# @param app_id The app where the users belong to.
|
38
|
+
# @param id The user id.
|
39
|
+
# @param prefix The topic prefix.
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @return [nil]
|
42
|
+
describe 'users_delete_allowed_topic test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for users_delete_subscription
|
49
|
+
# Remove a user subscriptions.
|
50
|
+
# @param app_id The app where the user belongs to.
|
51
|
+
# @param id The user id.
|
52
|
+
# @param prefix The topic prefix.
|
53
|
+
# @param [Hash] opts the optional parameters
|
54
|
+
# @return [nil]
|
55
|
+
describe 'users_delete_subscription test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# unit tests for users_delete_user
|
62
|
+
# Delete a user.
|
63
|
+
# @param app_id The app where the users belongs to.
|
64
|
+
# @param id The user id to delete.
|
65
|
+
# @param [Hash] opts the optional parameters
|
66
|
+
# @return [ListResponseDtoOfUserDto]
|
67
|
+
describe 'users_delete_user test' do
|
68
|
+
it 'should work' do
|
69
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# unit tests for users_get_subscriptions
|
74
|
+
# Query user subscriptions.
|
75
|
+
# @param app_id The app where the user belongs to.
|
76
|
+
# @param id The user id.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @option opts [String] :query The optional query to search for items.
|
79
|
+
# @option opts [Integer] :take The number of items to return.
|
80
|
+
# @option opts [Integer] :skip The number of items to skip.
|
81
|
+
# @return [ListResponseDtoOfSubscriptionDto]
|
82
|
+
describe 'users_get_subscriptions test' do
|
83
|
+
it 'should work' do
|
84
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# unit tests for users_get_user
|
89
|
+
# Get a user.
|
90
|
+
# @param app_id The app where the user belongs to.
|
91
|
+
# @param id The user id.
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [ListResponseDtoOfUserDto]
|
94
|
+
describe 'users_get_user test' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# unit tests for users_get_users
|
101
|
+
# Query users.
|
102
|
+
# @param app_id The app where the users belongs to.
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [String] :query The optional query to search for items.
|
105
|
+
# @option opts [Integer] :take The number of items to return.
|
106
|
+
# @option opts [Integer] :skip The number of items to skip.
|
107
|
+
# @return [ListResponseDtoOfUserDto]
|
108
|
+
describe 'users_get_users test' do
|
109
|
+
it 'should work' do
|
110
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# unit tests for users_post_allowed_topic
|
115
|
+
# Add an allowed topic.
|
116
|
+
# @param app_id The app where the users belong to.
|
117
|
+
# @param id The user id.
|
118
|
+
# @param add_allowed_topic_dto The upsert request.
|
119
|
+
# @param [Hash] opts the optional parameters
|
120
|
+
# @return [nil]
|
121
|
+
describe 'users_post_allowed_topic test' do
|
122
|
+
it 'should work' do
|
123
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# unit tests for users_post_subscription
|
128
|
+
# Upsert a user subscriptions.
|
129
|
+
# @param app_id The app where the user belongs to.
|
130
|
+
# @param id The user id.
|
131
|
+
# @param subscription_dto The subscription object.
|
132
|
+
# @param [Hash] opts the optional parameters
|
133
|
+
# @return [nil]
|
134
|
+
describe 'users_post_subscription test' do
|
135
|
+
it 'should work' do
|
136
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# unit tests for users_post_users
|
141
|
+
# Upsert users.
|
142
|
+
# @param app_id The app where the users belong to.
|
143
|
+
# @param upsert_users_dto The upsert request.
|
144
|
+
# @param [Hash] opts the optional parameters
|
145
|
+
# @return [Array<UserDto>]
|
146
|
+
describe 'users_post_users test' do
|
147
|
+
it 'should work' do
|
148
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
=begin
|
2
|
+
#Notifo 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
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe Notifo::ApiClient do
|
16
|
+
context 'initialization' do
|
17
|
+
context 'URL stuff' do
|
18
|
+
context 'host' do
|
19
|
+
it 'removes http from host' do
|
20
|
+
Notifo.configure { |c| c.host = 'http://example.com' }
|
21
|
+
expect(Notifo::Configuration.default.host).to eq('example.com')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'removes https from host' do
|
25
|
+
Notifo.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
+
expect(Notifo::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'removes trailing path from host' do
|
30
|
+
Notifo.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
+
expect(Notifo::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
|
+
Notifo.configure { |c| c.base_path = 'v4/dog' }
|
38
|
+
expect(Notifo::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
|
+
Notifo.configure { |c| c.base_path = '/v4/dog' }
|
43
|
+
expect(Notifo::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
+
end
|
45
|
+
|
46
|
+
it "ends up as a blank string if nil" do
|
47
|
+
Notifo.configure { |c| c.base_path = nil }
|
48
|
+
expect(Notifo::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) { Notifo::Configuration.new }
|
56
|
+
let(:api_client) { Notifo::ApiClient.new(config) }
|
57
|
+
|
58
|
+
it 'defaults to nil' do
|
59
|
+
expect(Notifo::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) { Notifo::Configuration.new }
|
75
|
+
let(:api_client) { Notifo::ApiClient.new(config) }
|
76
|
+
|
77
|
+
it 'defaults to 0' do
|
78
|
+
expect(Notifo::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
|
+
describe '#deserialize' do
|
93
|
+
it "handles Array<Integer>" do
|
94
|
+
api_client = Notifo::ApiClient.new
|
95
|
+
headers = { 'Content-Type' => 'application/json' }
|
96
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
97
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
98
|
+
expect(data).to be_instance_of(Array)
|
99
|
+
expect(data).to eq([12, 34])
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'handles Array<Array<Integer>>' do
|
103
|
+
api_client = Notifo::ApiClient.new
|
104
|
+
headers = { 'Content-Type' => 'application/json' }
|
105
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
|
+
expect(data).to be_instance_of(Array)
|
108
|
+
expect(data).to eq([[12, 34], [56]])
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'handles Hash<String, String>' do
|
112
|
+
api_client = Notifo::ApiClient.new
|
113
|
+
headers = { 'Content-Type' => 'application/json' }
|
114
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
|
+
expect(data).to be_instance_of(Hash)
|
117
|
+
expect(data).to eq(:message => 'Hello')
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "#object_to_hash" do
|
122
|
+
it 'ignores nils and includes empty arrays' do
|
123
|
+
# uncomment below to test object_to_hash for model
|
124
|
+
# api_client = Notifo::ApiClient.new
|
125
|
+
# _model = Notifo::ModelName.new
|
126
|
+
# update the model attribute below
|
127
|
+
# _model.id = 1
|
128
|
+
# update the expected value (hash) below
|
129
|
+
# expected = {id: 1, name: '', tags: []}
|
130
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe '#build_collection_param' do
|
135
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
136
|
+
let(:api_client) { Notifo::ApiClient.new }
|
137
|
+
|
138
|
+
it 'works for csv' do
|
139
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'works for ssv' do
|
143
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'works for tsv' do
|
147
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'works for pipes' do
|
151
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'works for multi' do
|
155
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
|
+
end
|
157
|
+
|
158
|
+
it 'fails for invalid collection format' do
|
159
|
+
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe '#json_mime?' do
|
164
|
+
let(:api_client) { Notifo::ApiClient.new }
|
165
|
+
|
166
|
+
it 'works' do
|
167
|
+
expect(api_client.json_mime?(nil)).to eq false
|
168
|
+
expect(api_client.json_mime?('')).to eq false
|
169
|
+
|
170
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
171
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
172
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
173
|
+
|
174
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
175
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
176
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
describe '#select_header_accept' do
|
181
|
+
let(:api_client) { Notifo::ApiClient.new }
|
182
|
+
|
183
|
+
it 'works' do
|
184
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
185
|
+
expect(api_client.select_header_accept([])).to be_nil
|
186
|
+
|
187
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
188
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
189
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
190
|
+
|
191
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
192
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
describe '#select_header_content_type' do
|
197
|
+
let(:api_client) { Notifo::ApiClient.new }
|
198
|
+
|
199
|
+
it 'works' do
|
200
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
202
|
+
|
203
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
204
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
205
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
206
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
207
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
describe '#sanitize_filename' do
|
212
|
+
let(:api_client) { Notifo::ApiClient.new }
|
213
|
+
|
214
|
+
it 'works' do
|
215
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
218
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
219
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
220
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
221
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
222
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
223
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
#Notifo 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
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe Notifo::Configuration do
|
16
|
+
let(:config) { Notifo::Configuration.default }
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
# uncomment below to setup host and base_path
|
20
|
+
# require 'URI'
|
21
|
+
# uri = URI.parse("https://notifo.easierlife.com")
|
22
|
+
# Notifo.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://notifo.easierlife.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://notifo.easierlife.com")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
#Notifo 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
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Notifo::AddAllowedTopicDto
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe Notifo::AddAllowedTopicDto do
|
21
|
+
let(:instance) { Notifo::AddAllowedTopicDto.new }
|
22
|
+
|
23
|
+
describe 'test an instance of AddAllowedTopicDto' do
|
24
|
+
it 'should create an instance of AddAllowedTopicDto' do
|
25
|
+
expect(instance).to be_instance_of(Notifo::AddAllowedTopicDto)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "prefix"' 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
|
+
end
|