samplify_api_client 1.0.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 +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +221 -0
- data/Rakefile +8 -0
- data/docs/AppError.md +10 -0
- data/docs/ApplicationItemData.md +11 -0
- data/docs/AttributeData.md +16 -0
- data/docs/AttributeOption.md +10 -0
- data/docs/Attributes.md +10 -0
- data/docs/AttributesApi.md +78 -0
- data/docs/AuthApi.md +191 -0
- data/docs/AuthError.md +9 -0
- data/docs/Author.md +10 -0
- data/docs/BuyProject.md +10 -0
- data/docs/BuyProjectItem.md +12 -0
- data/docs/BuyProjectResponse.md +9 -0
- data/docs/BuyProjectsPayload.md +7 -0
- data/docs/Categories.md +10 -0
- data/docs/CategoriesApi.md +72 -0
- data/docs/CategoryData.md +9 -0
- data/docs/CodePayload.md +11 -0
- data/docs/Countries.md +10 -0
- data/docs/CountriesApi.md +72 -0
- data/docs/CountryData.md +11 -0
- data/docs/CreateLineItem.md +10 -0
- data/docs/DefaultApi.md +88 -0
- data/docs/EndLinks.md +13 -0
- data/docs/ErrorType.md +9 -0
- data/docs/Event.md +10 -0
- data/docs/EventData.md +15 -0
- data/docs/EventListData.md +15 -0
- data/docs/Events.md +10 -0
- data/docs/EventsApi.md +287 -0
- data/docs/ExclusionData.md +9 -0
- data/docs/Feasibility.md +10 -0
- data/docs/FeasibilityApi.md +61 -0
- data/docs/FeasibilityData.md +14 -0
- data/docs/FeasibilityResponseData.md +9 -0
- data/docs/LineItemActionResponse.md +14 -0
- data/docs/LineItemData.md +22 -0
- data/docs/LineItemItemData.md +17 -0
- data/docs/LineItemReportData.md +25 -0
- data/docs/LineItemResponseData.md +27 -0
- data/docs/LineItems.md +10 -0
- data/docs/LineItemsApi.md +420 -0
- data/docs/Links.md +12 -0
- data/docs/LogoutPayload.md +10 -0
- data/docs/Meta.md +10 -0
- data/docs/Project.md +14 -0
- data/docs/ProjectAction.md +10 -0
- data/docs/ProjectActionResponse.md +13 -0
- data/docs/ProjectCategoryData.md +8 -0
- data/docs/ProjectItemData.md +14 -0
- data/docs/ProjectReport.md +10 -0
- data/docs/ProjectReportData.md +21 -0
- data/docs/ProjectReports.md +10 -0
- data/docs/ProjectResponse.md +10 -0
- data/docs/ProjectResponseData.md +19 -0
- data/docs/ProjectSurveyEndLinks.md +10 -0
- data/docs/ProjectSurveyEndLinksData.md +12 -0
- data/docs/Projects.md +10 -0
- data/docs/ProjectsApi.md +620 -0
- data/docs/QuotaCell.md +10 -0
- data/docs/QuotaCellFeasibility.md +9 -0
- data/docs/QuotaGroupData.md +9 -0
- data/docs/QuotaGroupFeasibility.md +8 -0
- data/docs/QuotaPlanData.md +9 -0
- data/docs/Reconcile.md +10 -0
- data/docs/ReconcileData.md +7 -0
- data/docs/RefreshTokenPayload.md +10 -0
- data/docs/Reprice.md +10 -0
- data/docs/RepriceData.md +22 -0
- data/docs/RepricePayload.md +20 -0
- data/docs/RespondentApi.md +86 -0
- data/docs/Status.md +9 -0
- data/docs/SupportedLanguage.md +10 -0
- data/docs/SurveyEndLinks.md +10 -0
- data/docs/SurveyTestId.md +10 -0
- data/docs/SurveyTestLink.md +9 -0
- data/docs/Target.md +11 -0
- data/docs/TargetingAttribute.md +10 -0
- data/docs/TokenMedia.md +11 -0
- data/docs/TokenPayload.md +11 -0
- data/docs/URLParam.md +9 -0
- data/docs/UpdateLineItem.md +21 -0
- data/docs/UpdateProjectData.md +13 -0
- data/docs/UpdateProjectLineItem.md +22 -0
- data/docs/UserInfo.md +10 -0
- data/docs/UserInfoResponseData.md +10 -0
- data/docs/UsersApi.md +68 -0
- data/examples/auth.rb +18 -0
- data/git_push.sh +55 -0
- data/lib/samplify_api_client/api/attributes_api.rb +111 -0
- data/lib/samplify_api_client/api/auth_api.rb +230 -0
- data/lib/samplify_api_client/api/categories_api.rb +99 -0
- data/lib/samplify_api_client/api/countries_api.rb +99 -0
- data/lib/samplify_api_client/api/default_api.rb +115 -0
- data/lib/samplify_api_client/api/events_api.rb +317 -0
- data/lib/samplify_api_client/api/feasibility_api.rb +75 -0
- data/lib/samplify_api_client/api/line_items_api.rb +468 -0
- data/lib/samplify_api_client/api/projects_api.rb +660 -0
- data/lib/samplify_api_client/api/respondent_api.rb +113 -0
- data/lib/samplify_api_client/api/users_api.rb +81 -0
- data/lib/samplify_api_client/api_client.rb +389 -0
- data/lib/samplify_api_client/api_error.rb +38 -0
- data/lib/samplify_api_client/configuration.rb +209 -0
- data/lib/samplify_api_client/models/app_error.rb +218 -0
- data/lib/samplify_api_client/models/application_item_data.rb +234 -0
- data/lib/samplify_api_client/models/attribute_data.rb +334 -0
- data/lib/samplify_api_client/models/attribute_option.rb +219 -0
- data/lib/samplify_api_client/models/attributes.rb +219 -0
- data/lib/samplify_api_client/models/auth_error.rb +205 -0
- data/lib/samplify_api_client/models/author.rb +253 -0
- data/lib/samplify_api_client/models/buy_project.rb +219 -0
- data/lib/samplify_api_client/models/buy_project_item.rb +243 -0
- data/lib/samplify_api_client/models/buy_project_response.rb +194 -0
- data/lib/samplify_api_client/models/buy_projects_payload.rb +174 -0
- data/lib/samplify_api_client/models/categories.rb +219 -0
- data/lib/samplify_api_client/models/category_data.rb +204 -0
- data/lib/samplify_api_client/models/code_payload.rb +229 -0
- data/lib/samplify_api_client/models/countries.rb +219 -0
- data/lib/samplify_api_client/models/country_data.rb +230 -0
- data/lib/samplify_api_client/models/create_line_item.rb +217 -0
- data/lib/samplify_api_client/models/end_links.rb +288 -0
- data/lib/samplify_api_client/models/error_type.rb +204 -0
- data/lib/samplify_api_client/models/event.rb +217 -0
- data/lib/samplify_api_client/models/event_data.rb +289 -0
- data/lib/samplify_api_client/models/event_list_data.rb +289 -0
- data/lib/samplify_api_client/models/events.rb +219 -0
- data/lib/samplify_api_client/models/exclusion_data.rb +206 -0
- data/lib/samplify_api_client/models/feasibility.rb +219 -0
- data/lib/samplify_api_client/models/feasibility_data.rb +255 -0
- data/lib/samplify_api_client/models/feasibility_response_data.rb +193 -0
- data/lib/samplify_api_client/models/line_item_action_response.rb +244 -0
- data/lib/samplify_api_client/models/line_item_data.rb +398 -0
- data/lib/samplify_api_client/models/line_item_item_data.rb +358 -0
- data/lib/samplify_api_client/models/line_item_report_data.rb +478 -0
- data/lib/samplify_api_client/models/line_item_response_data.rb +408 -0
- data/lib/samplify_api_client/models/line_items.rb +219 -0
- data/lib/samplify_api_client/models/links.rb +219 -0
- data/lib/samplify_api_client/models/logout_payload.rb +219 -0
- data/lib/samplify_api_client/models/meta.rb +203 -0
- data/lib/samplify_api_client/models/project.rb +273 -0
- data/lib/samplify_api_client/models/project_action.rb +217 -0
- data/lib/samplify_api_client/models/project_action_response.rb +236 -0
- data/lib/samplify_api_client/models/project_category_data.rb +191 -0
- data/lib/samplify_api_client/models/project_item_data.rb +307 -0
- data/lib/samplify_api_client/models/project_report.rb +217 -0
- data/lib/samplify_api_client/models/project_report_data.rb +414 -0
- data/lib/samplify_api_client/models/project_reports.rb +219 -0
- data/lib/samplify_api_client/models/project_response.rb +217 -0
- data/lib/samplify_api_client/models/project_response_data.rb +347 -0
- data/lib/samplify_api_client/models/project_survey_end_links.rb +217 -0
- data/lib/samplify_api_client/models/project_survey_end_links_data.rb +272 -0
- data/lib/samplify_api_client/models/projects.rb +219 -0
- data/lib/samplify_api_client/models/quota_cell.rb +206 -0
- data/lib/samplify_api_client/models/quota_cell_feasibility.rb +204 -0
- data/lib/samplify_api_client/models/quota_group_data.rb +201 -0
- data/lib/samplify_api_client/models/quota_group_feasibility.rb +185 -0
- data/lib/samplify_api_client/models/quota_plan_data.rb +198 -0
- data/lib/samplify_api_client/models/reconcile.rb +217 -0
- data/lib/samplify_api_client/models/reconcile_data.rb +174 -0
- data/lib/samplify_api_client/models/refresh_token_payload.rb +214 -0
- data/lib/samplify_api_client/models/reprice.rb +217 -0
- data/lib/samplify_api_client/models/reprice_data.rb +399 -0
- data/lib/samplify_api_client/models/reprice_payload.rb +369 -0
- data/lib/samplify_api_client/models/status.rb +206 -0
- data/lib/samplify_api_client/models/supported_language.rb +219 -0
- data/lib/samplify_api_client/models/survey_end_links.rb +216 -0
- data/lib/samplify_api_client/models/survey_test_id.rb +219 -0
- data/lib/samplify_api_client/models/survey_test_link.rb +206 -0
- data/lib/samplify_api_client/models/target.rb +258 -0
- data/lib/samplify_api_client/models/targeting_attribute.rb +216 -0
- data/lib/samplify_api_client/models/token_media.rb +235 -0
- data/lib/samplify_api_client/models/token_payload.rb +229 -0
- data/lib/samplify_api_client/models/update_line_item.rb +353 -0
- data/lib/samplify_api_client/models/update_project_data.rb +238 -0
- data/lib/samplify_api_client/models/update_project_line_item.rb +368 -0
- data/lib/samplify_api_client/models/url_param.rb +204 -0
- data/lib/samplify_api_client/models/user_info.rb +217 -0
- data/lib/samplify_api_client/models/user_info_response_data.rb +221 -0
- data/lib/samplify_api_client/version.rb +15 -0
- data/lib/samplify_api_client.rb +125 -0
- data/samplify_api_client.gemspec +45 -0
- data/spec/api/attributes_api_spec.rb +53 -0
- data/spec/api/auth_api_spec.rb +79 -0
- data/spec/api/categories_api_spec.rb +51 -0
- data/spec/api/countries_api_spec.rb +51 -0
- data/spec/api/default_api_spec.rb +55 -0
- data/spec/api/events_api_spec.rb +100 -0
- data/spec/api/feasibility_api_spec.rb +46 -0
- data/spec/api/line_items_api_spec.rb +128 -0
- data/spec/api/projects_api_spec.rb +168 -0
- data/spec/api/respondent_api_spec.rb +55 -0
- data/spec/api/users_api_spec.rb +49 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/app_error_spec.rb +53 -0
- data/spec/models/application_item_data_spec.rb +59 -0
- data/spec/models/attribute_data_spec.rb +93 -0
- data/spec/models/attribute_option_spec.rb +53 -0
- data/spec/models/attributes_spec.rb +53 -0
- data/spec/models/auth_error_spec.rb +47 -0
- data/spec/models/author_spec.rb +57 -0
- data/spec/models/buy_project_item_spec.rb +65 -0
- data/spec/models/buy_project_response_spec.rb +47 -0
- data/spec/models/buy_project_spec.rb +53 -0
- data/spec/models/buy_projects_payload_spec.rb +35 -0
- data/spec/models/categories_spec.rb +53 -0
- data/spec/models/category_data_spec.rb +47 -0
- data/spec/models/code_payload_spec.rb +59 -0
- data/spec/models/countries_spec.rb +53 -0
- data/spec/models/country_data_spec.rb +59 -0
- data/spec/models/create_line_item_spec.rb +53 -0
- data/spec/models/end_links_spec.rb +75 -0
- data/spec/models/error_type_spec.rb +47 -0
- data/spec/models/event_data_spec.rb +83 -0
- data/spec/models/event_list_data_spec.rb +83 -0
- data/spec/models/event_spec.rb +53 -0
- data/spec/models/events_spec.rb +53 -0
- data/spec/models/exclusion_data_spec.rb +47 -0
- data/spec/models/feasibility_data_spec.rb +77 -0
- data/spec/models/feasibility_response_data_spec.rb +47 -0
- data/spec/models/feasibility_spec.rb +53 -0
- data/spec/models/line_item_action_response_spec.rb +77 -0
- data/spec/models/line_item_data_spec.rb +129 -0
- data/spec/models/line_item_item_data_spec.rb +99 -0
- data/spec/models/line_item_report_data_spec.rb +147 -0
- data/spec/models/line_item_response_data_spec.rb +159 -0
- data/spec/models/line_items_spec.rb +53 -0
- data/spec/models/links_spec.rb +65 -0
- data/spec/models/logout_payload_spec.rb +53 -0
- data/spec/models/meta_spec.rb +53 -0
- data/spec/models/project_action_response_spec.rb +71 -0
- data/spec/models/project_action_spec.rb +53 -0
- data/spec/models/project_category_data_spec.rb +41 -0
- data/spec/models/project_item_data_spec.rb +81 -0
- data/spec/models/project_report_data_spec.rb +123 -0
- data/spec/models/project_report_spec.rb +53 -0
- data/spec/models/project_reports_spec.rb +53 -0
- data/spec/models/project_response_data_spec.rb +107 -0
- data/spec/models/project_response_spec.rb +53 -0
- data/spec/models/project_spec.rb +77 -0
- data/spec/models/project_survey_end_links_data_spec.rb +69 -0
- data/spec/models/project_survey_end_links_spec.rb +53 -0
- data/spec/models/projects_spec.rb +53 -0
- data/spec/models/quota_cell_feasibility_spec.rb +47 -0
- data/spec/models/quota_cell_spec.rb +53 -0
- data/spec/models/quota_group_data_spec.rb +47 -0
- data/spec/models/quota_group_feasibility_spec.rb +41 -0
- data/spec/models/quota_plan_data_spec.rb +47 -0
- data/spec/models/reconcile_data_spec.rb +35 -0
- data/spec/models/reconcile_spec.rb +53 -0
- data/spec/models/refresh_token_payload_spec.rb +53 -0
- data/spec/models/reprice_data_spec.rb +125 -0
- data/spec/models/reprice_payload_spec.rb +113 -0
- data/spec/models/reprice_spec.rb +53 -0
- data/spec/models/status_spec.rb +47 -0
- data/spec/models/supported_language_spec.rb +53 -0
- data/spec/models/survey_end_links_spec.rb +53 -0
- data/spec/models/survey_test_id_spec.rb +53 -0
- data/spec/models/survey_test_link_spec.rb +47 -0
- data/spec/models/target_spec.rb +63 -0
- data/spec/models/targeting_attribute_spec.rb +53 -0
- data/spec/models/token_media_spec.rb +59 -0
- data/spec/models/token_payload_spec.rb +59 -0
- data/spec/models/update_line_item_spec.rb +123 -0
- data/spec/models/update_project_data_spec.rb +71 -0
- data/spec/models/update_project_line_item_spec.rb +129 -0
- data/spec/models/url_param_spec.rb +47 -0
- data/spec/models/user_info_response_data_spec.rb +53 -0
- data/spec/models/user_info_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +585 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for SamplifyAPIClient::UsersApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'UsersApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = SamplifyAPIClient::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(@instance).to be_instance_of(SamplifyAPIClient::UsersApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for users_get_user_info
|
|
36
|
+
# getUserInfo users
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [Integer] :app_id Only return apps with the given id
|
|
39
|
+
# @option opts [BOOLEAN] :current Only return current app for the user id
|
|
40
|
+
# @option opts [BOOLEAN] :default Only return default app for the user id
|
|
41
|
+
# @option opts [String] :name Only return apps with the given name
|
|
42
|
+
# @return [UserInfo]
|
|
43
|
+
describe 'users_get_user_info 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
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
|
|
15
|
+
describe SamplifyAPIClient::ApiClient do
|
|
16
|
+
context 'initialization' do
|
|
17
|
+
context 'URL stuff' do
|
|
18
|
+
context 'host' do
|
|
19
|
+
it 'removes http from host' do
|
|
20
|
+
SamplifyAPIClient.configure { |c| c.host = 'http://example.com' }
|
|
21
|
+
expect(SamplifyAPIClient::Configuration.default.host).to eq('example.com')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'removes https from host' do
|
|
25
|
+
SamplifyAPIClient.configure { |c| c.host = 'https://wookiee.com' }
|
|
26
|
+
expect(SamplifyAPIClient::ApiClient.default.config.host).to eq('wookiee.com')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'removes trailing path from host' do
|
|
30
|
+
SamplifyAPIClient.configure { |c| c.host = 'hobo.com/v4' }
|
|
31
|
+
expect(SamplifyAPIClient::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
|
+
SamplifyAPIClient.configure { |c| c.base_path = 'v4/dog' }
|
|
38
|
+
expect(SamplifyAPIClient::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
|
+
SamplifyAPIClient.configure { |c| c.base_path = '/v4/dog' }
|
|
43
|
+
expect(SamplifyAPIClient::Configuration.default.base_path).to eq('/v4/dog')
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "ends up as a blank string if nil" do
|
|
47
|
+
SamplifyAPIClient.configure { |c| c.base_path = nil }
|
|
48
|
+
expect(SamplifyAPIClient::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) { SamplifyAPIClient::Configuration.new }
|
|
56
|
+
let(:api_client) { SamplifyAPIClient::ApiClient.new(config) }
|
|
57
|
+
|
|
58
|
+
it 'defaults to nil' do
|
|
59
|
+
expect(SamplifyAPIClient::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) { SamplifyAPIClient::Configuration.new }
|
|
75
|
+
let(:api_client) { SamplifyAPIClient::ApiClient.new(config) }
|
|
76
|
+
|
|
77
|
+
it 'defaults to 0' do
|
|
78
|
+
expect(SamplifyAPIClient::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 = SamplifyAPIClient::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 = SamplifyAPIClient::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 = SamplifyAPIClient::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 = SamplifyAPIClient::ApiClient.new
|
|
125
|
+
# _model = SamplifyAPIClient::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) { SamplifyAPIClient::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(proc { 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) { SamplifyAPIClient::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) { SamplifyAPIClient::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) { SamplifyAPIClient::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) { SamplifyAPIClient::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
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
|
|
15
|
+
describe SamplifyAPIClient::Configuration do
|
|
16
|
+
let(:config) { SamplifyAPIClient::Configuration.default }
|
|
17
|
+
|
|
18
|
+
before(:each) do
|
|
19
|
+
# uncomment below to setup host and base_path
|
|
20
|
+
# require 'URI'
|
|
21
|
+
# uri = URI.parse("https://api.uat.pe.researchnow.com")
|
|
22
|
+
# SamplifyAPIClient.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://api.uat.pe.researchnow.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://api.uat.pe.researchnow.com")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for SamplifyAPIClient::AppError
|
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe 'AppError' do
|
|
21
|
+
before do
|
|
22
|
+
# run before each test
|
|
23
|
+
@instance = SamplifyAPIClient::AppError.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after do
|
|
27
|
+
# run after each test
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test an instance of AppError' do
|
|
31
|
+
it 'should create an instance of AppError' do
|
|
32
|
+
expect(@instance).to be_instance_of(SamplifyAPIClient::AppError)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
describe 'test attribute "data"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe 'test attribute "meta"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'test attribute "status"' do
|
|
48
|
+
it 'should work' do
|
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for SamplifyAPIClient::ApplicationItemData
|
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe 'ApplicationItemData' do
|
|
21
|
+
before do
|
|
22
|
+
# run before each test
|
|
23
|
+
@instance = SamplifyAPIClient::ApplicationItemData.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after do
|
|
27
|
+
# run after each test
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test an instance of ApplicationItemData' do
|
|
31
|
+
it 'should create an instance of ApplicationItemData' do
|
|
32
|
+
expect(@instance).to be_instance_of(SamplifyAPIClient::ApplicationItemData)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
describe 'test attribute "app_id"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe 'test attribute "current"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'test attribute "default"' do
|
|
48
|
+
it 'should work' do
|
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe 'test attribute "name"' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Samplify API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for SamplifyAPIClient::AttributeData
|
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe 'AttributeData' do
|
|
21
|
+
before do
|
|
22
|
+
# run before each test
|
|
23
|
+
@instance = SamplifyAPIClient::AttributeData.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after do
|
|
27
|
+
# run after each test
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test an instance of AttributeData' do
|
|
31
|
+
it 'should create an instance of AttributeData' do
|
|
32
|
+
expect(@instance).to be_instance_of(SamplifyAPIClient::AttributeData)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
describe 'test attribute "format"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe 'test attribute "id"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'test attribute "is_allowed_in_filters"' do
|
|
48
|
+
it 'should work' do
|
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe 'test attribute "is_allowed_in_quotas"' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
describe 'test attribute "localized_text"' do
|
|
60
|
+
it 'should work' do
|
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe 'test attribute "name"' 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
|
+
describe 'test attribute "options"' do
|
|
72
|
+
it 'should work' do
|
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
describe 'test attribute "text"' do
|
|
78
|
+
it 'should work' do
|
|
79
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
describe 'test attribute "type"' do
|
|
84
|
+
it 'should work' do
|
|
85
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
86
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["LIST", "INTEGER", "STRING", "INTEGER_RANGE"])
|
|
87
|
+
# validator.allowable_values.each do |value|
|
|
88
|
+
# expect { @instance.type = value }.not_to raise_error
|
|
89
|
+
# end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
end
|