samplify_api_client 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 +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
data/examples/auth.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'samplify_api_client'
|
2
|
+
|
3
|
+
api_instance = SwaggerClient::AuthApi.new
|
4
|
+
|
5
|
+
payload = SwaggerClient::TokenPayload.new # TokenPayload |
|
6
|
+
payload.client_id = 'api'
|
7
|
+
payload.username = 'samplifyweb'
|
8
|
+
payload.password = 'samplifyweb'
|
9
|
+
|
10
|
+
|
11
|
+
begin
|
12
|
+
result = api_instance.auth_password(payload, {})
|
13
|
+
|
14
|
+
cmd = "export API_ACCESS_TOKEN=#{result.access_token}"
|
15
|
+
p cmd
|
16
|
+
rescue SwaggerClient::ApiError => e
|
17
|
+
puts "Exception when calling AuthApi->auth_password: #{e}"
|
18
|
+
end
|
data/git_push.sh
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
4
|
+
#
|
5
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
6
|
+
#
|
7
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
8
|
+
|
9
|
+
git_user_id=$1
|
10
|
+
git_repo_id=$2
|
11
|
+
release_note=$3
|
12
|
+
|
13
|
+
if [ "$git_user_id" = "" ]; then
|
14
|
+
git_user_id=""
|
15
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
16
|
+
fi
|
17
|
+
|
18
|
+
if [ "$git_repo_id" = "" ]; then
|
19
|
+
git_repo_id=""
|
20
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
21
|
+
fi
|
22
|
+
|
23
|
+
if [ "$release_note" = "" ]; then
|
24
|
+
release_note=""
|
25
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
26
|
+
fi
|
27
|
+
|
28
|
+
# Initialize the local directory as a Git repository
|
29
|
+
git init
|
30
|
+
|
31
|
+
# Adds the files in the local repository and stages them for commit.
|
32
|
+
git add .
|
33
|
+
|
34
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
35
|
+
git commit -m "$release_note"
|
36
|
+
|
37
|
+
# Sets the new remote
|
38
|
+
git_remote=`git remote`
|
39
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
40
|
+
|
41
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
42
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
43
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
44
|
+
else
|
45
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
46
|
+
fi
|
47
|
+
|
48
|
+
fi
|
49
|
+
|
50
|
+
git pull origin master
|
51
|
+
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
53
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
55
|
+
|
@@ -0,0 +1,111 @@
|
|
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 'uri'
|
14
|
+
|
15
|
+
module SamplifyAPIClient
|
16
|
+
class AttributesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# list attributes
|
23
|
+
# @param country_iso_code Country ISO code
|
24
|
+
# @param language_iso_code Language ISO code
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [String] :id Only return attributes with the given id
|
27
|
+
# @option opts [Integer] :limit Maximum number of attributes to return (default to 10)
|
28
|
+
# @option opts [String] :name Only return attributes with the given name
|
29
|
+
# @option opts [Integer] :offset The first zero-based offset attribute to return (default to 0)
|
30
|
+
# @option opts [Array<String>] :sort Sort the attributes by the given key(s)
|
31
|
+
# @option opts [String] :text Only return attributes with the given text
|
32
|
+
# @return [Attributes]
|
33
|
+
def attributes_list(country_iso_code, language_iso_code, opts = {})
|
34
|
+
data, _status_code, _headers = attributes_list_with_http_info(country_iso_code, language_iso_code, opts)
|
35
|
+
data
|
36
|
+
end
|
37
|
+
|
38
|
+
# list attributes
|
39
|
+
# @param country_iso_code Country ISO code
|
40
|
+
# @param language_iso_code Language ISO code
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @option opts [String] :id Only return attributes with the given id
|
43
|
+
# @option opts [Integer] :limit Maximum number of attributes to return
|
44
|
+
# @option opts [String] :name Only return attributes with the given name
|
45
|
+
# @option opts [Integer] :offset The first zero-based offset attribute to return
|
46
|
+
# @option opts [Array<String>] :sort Sort the attributes by the given key(s)
|
47
|
+
# @option opts [String] :text Only return attributes with the given text
|
48
|
+
# @return [Array<(Attributes, Fixnum, Hash)>] Attributes data, response status code and response headers
|
49
|
+
def attributes_list_with_http_info(country_iso_code, language_iso_code, opts = {})
|
50
|
+
if @api_client.config.debugging
|
51
|
+
@api_client.config.logger.debug 'Calling API: AttributesApi.attributes_list ...'
|
52
|
+
end
|
53
|
+
# verify the required parameter 'country_iso_code' is set
|
54
|
+
if @api_client.config.client_side_validation && country_iso_code.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'country_iso_code' when calling AttributesApi.attributes_list"
|
56
|
+
end
|
57
|
+
# verify the required parameter 'language_iso_code' is set
|
58
|
+
if @api_client.config.client_side_validation && language_iso_code.nil?
|
59
|
+
fail ArgumentError, "Missing the required parameter 'language_iso_code' when calling AttributesApi.attributes_list"
|
60
|
+
end
|
61
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
62
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AttributesApi.attributes_list, must be smaller than or equal to 1000.'
|
63
|
+
end
|
64
|
+
|
65
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
66
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AttributesApi.attributes_list, must be greater than or equal to 1.'
|
67
|
+
end
|
68
|
+
|
69
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
70
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling AttributesApi.attributes_list, must be greater than or equal to 0.'
|
71
|
+
end
|
72
|
+
|
73
|
+
# resource path
|
74
|
+
local_var_path = '/sample/v1/attributes/{countryIsoCode}/{languageIsoCode}'.sub('{' + 'countryIsoCode' + '}', country_iso_code.to_s).sub('{' + 'languageIsoCode' + '}', language_iso_code.to_s)
|
75
|
+
|
76
|
+
# query parameters
|
77
|
+
query_params = {}
|
78
|
+
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
|
79
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
80
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
81
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
82
|
+
query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
|
83
|
+
query_params[:'text'] = opts[:'text'] if !opts[:'text'].nil?
|
84
|
+
|
85
|
+
# header parameters
|
86
|
+
header_params = {}
|
87
|
+
# HTTP header 'Accept' (if needed)
|
88
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.attributes+json'])
|
89
|
+
# HTTP header 'Content-Type'
|
90
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])
|
91
|
+
|
92
|
+
# form parameters
|
93
|
+
form_params = {}
|
94
|
+
|
95
|
+
# http body (model)
|
96
|
+
post_body = nil
|
97
|
+
auth_names = ['jwt']
|
98
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
99
|
+
:header_params => header_params,
|
100
|
+
:query_params => query_params,
|
101
|
+
:form_params => form_params,
|
102
|
+
:body => post_body,
|
103
|
+
:auth_names => auth_names,
|
104
|
+
:return_type => 'Attributes')
|
105
|
+
if @api_client.config.debugging
|
106
|
+
@api_client.config.logger.debug "API called: AttributesApi#attributes_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
107
|
+
end
|
108
|
+
return data, status_code, headers
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,230 @@
|
|
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 'uri'
|
14
|
+
|
15
|
+
module SamplifyAPIClient
|
16
|
+
class AuthApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# code auth
|
23
|
+
# @param payload
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [TokenMedia]
|
26
|
+
def auth_code(payload, opts = {})
|
27
|
+
data, _status_code, _headers = auth_code_with_http_info(payload, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# code auth
|
32
|
+
# @param payload
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(TokenMedia, Fixnum, Hash)>] TokenMedia data, response status code and response headers
|
35
|
+
def auth_code_with_http_info(payload, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.auth_code ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'payload' is set
|
40
|
+
if @api_client.config.client_side_validation && payload.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling AuthApi.auth_code"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/auth/v1/token/code'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.auth.error+json', 'application/vnd.token+json'])
|
53
|
+
# HTTP header 'Content-Type'
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = @api_client.object_to_http_body(payload)
|
61
|
+
auth_names = []
|
62
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => 'TokenMedia')
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug "API called: AuthApi#auth_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
|
+
end
|
72
|
+
return data, status_code, headers
|
73
|
+
end
|
74
|
+
# logout auth
|
75
|
+
# @param payload
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @return [nil]
|
78
|
+
def auth_logout(payload, opts = {})
|
79
|
+
auth_logout_with_http_info(payload, opts)
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
|
83
|
+
# logout auth
|
84
|
+
# @param payload
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
87
|
+
def auth_logout_with_http_info(payload, opts = {})
|
88
|
+
if @api_client.config.debugging
|
89
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.auth_logout ...'
|
90
|
+
end
|
91
|
+
# verify the required parameter 'payload' is set
|
92
|
+
if @api_client.config.client_side_validation && payload.nil?
|
93
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling AuthApi.auth_logout"
|
94
|
+
end
|
95
|
+
# resource path
|
96
|
+
local_var_path = '/auth/v1/logout'
|
97
|
+
|
98
|
+
# query parameters
|
99
|
+
query_params = {}
|
100
|
+
|
101
|
+
# header parameters
|
102
|
+
header_params = {}
|
103
|
+
# HTTP header 'Accept' (if needed)
|
104
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.auth.error+json'])
|
105
|
+
# HTTP header 'Content-Type'
|
106
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])
|
107
|
+
|
108
|
+
# form parameters
|
109
|
+
form_params = {}
|
110
|
+
|
111
|
+
# http body (model)
|
112
|
+
post_body = @api_client.object_to_http_body(payload)
|
113
|
+
auth_names = []
|
114
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
115
|
+
:header_params => header_params,
|
116
|
+
:query_params => query_params,
|
117
|
+
:form_params => form_params,
|
118
|
+
:body => post_body,
|
119
|
+
:auth_names => auth_names)
|
120
|
+
if @api_client.config.debugging
|
121
|
+
@api_client.config.logger.debug "API called: AuthApi#auth_logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
122
|
+
end
|
123
|
+
return data, status_code, headers
|
124
|
+
end
|
125
|
+
# password auth
|
126
|
+
# @param payload
|
127
|
+
# @param [Hash] opts the optional parameters
|
128
|
+
# @return [TokenMedia]
|
129
|
+
def auth_password(payload, opts = {})
|
130
|
+
data, _status_code, _headers = auth_password_with_http_info(payload, opts)
|
131
|
+
data
|
132
|
+
end
|
133
|
+
|
134
|
+
# password auth
|
135
|
+
# @param payload
|
136
|
+
# @param [Hash] opts the optional parameters
|
137
|
+
# @return [Array<(TokenMedia, Fixnum, Hash)>] TokenMedia data, response status code and response headers
|
138
|
+
def auth_password_with_http_info(payload, opts = {})
|
139
|
+
if @api_client.config.debugging
|
140
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.auth_password ...'
|
141
|
+
end
|
142
|
+
# verify the required parameter 'payload' is set
|
143
|
+
if @api_client.config.client_side_validation && payload.nil?
|
144
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling AuthApi.auth_password"
|
145
|
+
end
|
146
|
+
# resource path
|
147
|
+
local_var_path = '/auth/v1/token/password'
|
148
|
+
|
149
|
+
# query parameters
|
150
|
+
query_params = {}
|
151
|
+
|
152
|
+
# header parameters
|
153
|
+
header_params = {}
|
154
|
+
# HTTP header 'Accept' (if needed)
|
155
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.auth.error+json', 'application/vnd.token+json'])
|
156
|
+
# HTTP header 'Content-Type'
|
157
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])
|
158
|
+
|
159
|
+
# form parameters
|
160
|
+
form_params = {}
|
161
|
+
|
162
|
+
# http body (model)
|
163
|
+
post_body = @api_client.object_to_http_body(payload)
|
164
|
+
auth_names = []
|
165
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
166
|
+
:header_params => header_params,
|
167
|
+
:query_params => query_params,
|
168
|
+
:form_params => form_params,
|
169
|
+
:body => post_body,
|
170
|
+
:auth_names => auth_names,
|
171
|
+
:return_type => 'TokenMedia')
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug "API called: AuthApi#auth_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
174
|
+
end
|
175
|
+
return data, status_code, headers
|
176
|
+
end
|
177
|
+
# refresh auth
|
178
|
+
# @param payload
|
179
|
+
# @param [Hash] opts the optional parameters
|
180
|
+
# @return [TokenMedia]
|
181
|
+
def auth_refresh(payload, opts = {})
|
182
|
+
data, _status_code, _headers = auth_refresh_with_http_info(payload, opts)
|
183
|
+
data
|
184
|
+
end
|
185
|
+
|
186
|
+
# refresh auth
|
187
|
+
# @param payload
|
188
|
+
# @param [Hash] opts the optional parameters
|
189
|
+
# @return [Array<(TokenMedia, Fixnum, Hash)>] TokenMedia data, response status code and response headers
|
190
|
+
def auth_refresh_with_http_info(payload, opts = {})
|
191
|
+
if @api_client.config.debugging
|
192
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.auth_refresh ...'
|
193
|
+
end
|
194
|
+
# verify the required parameter 'payload' is set
|
195
|
+
if @api_client.config.client_side_validation && payload.nil?
|
196
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling AuthApi.auth_refresh"
|
197
|
+
end
|
198
|
+
# resource path
|
199
|
+
local_var_path = '/auth/v1/token/refresh'
|
200
|
+
|
201
|
+
# query parameters
|
202
|
+
query_params = {}
|
203
|
+
|
204
|
+
# header parameters
|
205
|
+
header_params = {}
|
206
|
+
# HTTP header 'Accept' (if needed)
|
207
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.auth.error+json', 'application/vnd.token+json'])
|
208
|
+
# HTTP header 'Content-Type'
|
209
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])
|
210
|
+
|
211
|
+
# form parameters
|
212
|
+
form_params = {}
|
213
|
+
|
214
|
+
# http body (model)
|
215
|
+
post_body = @api_client.object_to_http_body(payload)
|
216
|
+
auth_names = []
|
217
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
218
|
+
:header_params => header_params,
|
219
|
+
:query_params => query_params,
|
220
|
+
:form_params => form_params,
|
221
|
+
:body => post_body,
|
222
|
+
:auth_names => auth_names,
|
223
|
+
:return_type => 'TokenMedia')
|
224
|
+
if @api_client.config.debugging
|
225
|
+
@api_client.config.logger.debug "API called: AuthApi#auth_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
226
|
+
end
|
227
|
+
return data, status_code, headers
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
@@ -0,0 +1,99 @@
|
|
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 'uri'
|
14
|
+
|
15
|
+
module SamplifyAPIClient
|
16
|
+
class CategoriesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# list categories
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [String] :description Only return categories with the given description
|
25
|
+
# @option opts [String] :id Only return categories with the given id
|
26
|
+
# @option opts [Integer] :limit Maximum number of categories to return (default to 10)
|
27
|
+
# @option opts [String] :name Only return categories with the given name
|
28
|
+
# @option opts [Integer] :offset The first zero-based offset category to return (default to 0)
|
29
|
+
# @option opts [Array<String>] :sort Sort the categories by the given key(s)
|
30
|
+
# @return [Categories]
|
31
|
+
def categories_list(opts = {})
|
32
|
+
data, _status_code, _headers = categories_list_with_http_info(opts)
|
33
|
+
data
|
34
|
+
end
|
35
|
+
|
36
|
+
# list categories
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :description Only return categories with the given description
|
39
|
+
# @option opts [String] :id Only return categories with the given id
|
40
|
+
# @option opts [Integer] :limit Maximum number of categories to return
|
41
|
+
# @option opts [String] :name Only return categories with the given name
|
42
|
+
# @option opts [Integer] :offset The first zero-based offset category to return
|
43
|
+
# @option opts [Array<String>] :sort Sort the categories by the given key(s)
|
44
|
+
# @return [Array<(Categories, Fixnum, Hash)>] Categories data, response status code and response headers
|
45
|
+
def categories_list_with_http_info(opts = {})
|
46
|
+
if @api_client.config.debugging
|
47
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_list ...'
|
48
|
+
end
|
49
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
50
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CategoriesApi.categories_list, must be smaller than or equal to 1000.'
|
51
|
+
end
|
52
|
+
|
53
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
54
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CategoriesApi.categories_list, must be greater than or equal to 1.'
|
55
|
+
end
|
56
|
+
|
57
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
58
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CategoriesApi.categories_list, must be greater than or equal to 0.'
|
59
|
+
end
|
60
|
+
|
61
|
+
# resource path
|
62
|
+
local_var_path = '/sample/v1/categories/surveyTopics'
|
63
|
+
|
64
|
+
# query parameters
|
65
|
+
query_params = {}
|
66
|
+
query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?
|
67
|
+
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
|
68
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
69
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
70
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
71
|
+
query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
|
72
|
+
|
73
|
+
# header parameters
|
74
|
+
header_params = {}
|
75
|
+
# HTTP header 'Accept' (if needed)
|
76
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.categories+json'])
|
77
|
+
# HTTP header 'Content-Type'
|
78
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])
|
79
|
+
|
80
|
+
# form parameters
|
81
|
+
form_params = {}
|
82
|
+
|
83
|
+
# http body (model)
|
84
|
+
post_body = nil
|
85
|
+
auth_names = ['jwt']
|
86
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
87
|
+
:header_params => header_params,
|
88
|
+
:query_params => query_params,
|
89
|
+
:form_params => form_params,
|
90
|
+
:body => post_body,
|
91
|
+
:auth_names => auth_names,
|
92
|
+
:return_type => 'Categories')
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
95
|
+
end
|
96
|
+
return data, status_code, headers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|