reliefweb-api 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/README.md +163 -0
- data/Rakefile +8 -0
- data/config.json +8 -0
- data/docs/Category.md +9 -0
- data/docs/CountriesApi.md +202 -0
- data/docs/Country.md +12 -0
- data/docs/Date.md +10 -0
- data/docs/Disaster.md +20 -0
- data/docs/DisastersApi.md +202 -0
- data/docs/DiscoveryApi.md +88 -0
- data/docs/Error.md +9 -0
- data/docs/ErrorDefinition.md +7 -0
- data/docs/FacetsFieldPost.md +7 -0
- data/docs/FacetsFilterPost.md +7 -0
- data/docs/FacetsIntervalPost.md +7 -0
- data/docs/FacetsLimitPost.md +7 -0
- data/docs/FacetsNamePost.md +7 -0
- data/docs/FacetsSortPost.md +7 -0
- data/docs/FieldsExcludePost.md +7 -0
- data/docs/FieldsIncludePost.md +7 -0
- data/docs/File.md +12 -0
- data/docs/FilterConditionsPost.md +7 -0
- data/docs/FilterFieldPost.md +7 -0
- data/docs/FilterNegatePost.md +7 -0
- data/docs/FilterOperatorPost.md +7 -0
- data/docs/FilterValuePost.md +7 -0
- data/docs/Job.md +23 -0
- data/docs/JobsApi.md +202 -0
- data/docs/Language.md +10 -0
- data/docs/LimitPost.md +7 -0
- data/docs/Location.md +8 -0
- data/docs/OffsetPost.md +7 -0
- data/docs/PostParams.md +28 -0
- data/docs/PresetPost.md +7 -0
- data/docs/ProfilePost.md +7 -0
- data/docs/QueryFieldsPost.md +7 -0
- data/docs/QueryOperatorPost.md +7 -0
- data/docs/QueryValuePost.md +7 -0
- data/docs/Report.md +19 -0
- data/docs/ReportsApi.md +202 -0
- data/docs/SortPost.md +7 -0
- data/docs/Source.md +14 -0
- data/docs/SourcesApi.md +202 -0
- data/docs/Training.md +23 -0
- data/docs/TrainingApi.md +202 -0
- data/git_push.sh +55 -0
- data/lib/reliefweb-api.rb +81 -0
- data/lib/reliefweb-api/api/countries_api.rb +277 -0
- data/lib/reliefweb-api/api/disasters_api.rb +277 -0
- data/lib/reliefweb-api/api/discovery_api.rb +113 -0
- data/lib/reliefweb-api/api/jobs_api.rb +277 -0
- data/lib/reliefweb-api/api/reports_api.rb +277 -0
- data/lib/reliefweb-api/api/sources_api.rb +277 -0
- data/lib/reliefweb-api/api/training_api.rb +277 -0
- data/lib/reliefweb-api/api_client.rb +388 -0
- data/lib/reliefweb-api/api_error.rb +38 -0
- data/lib/reliefweb-api/configuration.rb +202 -0
- data/lib/reliefweb-api/models/category.rb +192 -0
- data/lib/reliefweb-api/models/country.rb +220 -0
- data/lib/reliefweb-api/models/date.rb +202 -0
- data/lib/reliefweb-api/models/disaster.rb +299 -0
- data/lib/reliefweb-api/models/error.rb +192 -0
- data/lib/reliefweb-api/models/error_definition.rb +174 -0
- data/lib/reliefweb-api/models/facets_field_post.rb +175 -0
- data/lib/reliefweb-api/models/facets_filter_post.rb +175 -0
- data/lib/reliefweb-api/models/facets_interval_post.rb +32 -0
- data/lib/reliefweb-api/models/facets_limit_post.rb +175 -0
- data/lib/reliefweb-api/models/facets_name_post.rb +175 -0
- data/lib/reliefweb-api/models/facets_sort_post.rb +175 -0
- data/lib/reliefweb-api/models/fields_exclude_post.rb +175 -0
- data/lib/reliefweb-api/models/fields_include_post.rb +175 -0
- data/lib/reliefweb-api/models/file.rb +219 -0
- data/lib/reliefweb-api/models/filter_conditions_post.rb +175 -0
- data/lib/reliefweb-api/models/filter_field_post.rb +175 -0
- data/lib/reliefweb-api/models/filter_negate_post.rb +175 -0
- data/lib/reliefweb-api/models/filter_operator_post.rb +30 -0
- data/lib/reliefweb-api/models/filter_value_post.rb +175 -0
- data/lib/reliefweb-api/models/job.rb +330 -0
- data/lib/reliefweb-api/models/language.rb +201 -0
- data/lib/reliefweb-api/models/limit_post.rb +175 -0
- data/lib/reliefweb-api/models/location.rb +183 -0
- data/lib/reliefweb-api/models/offset_post.rb +175 -0
- data/lib/reliefweb-api/models/post_params.rb +363 -0
- data/lib/reliefweb-api/models/preset_post.rb +31 -0
- data/lib/reliefweb-api/models/profile_post.rb +31 -0
- data/lib/reliefweb-api/models/query_fields_post.rb +175 -0
- data/lib/reliefweb-api/models/query_operator_post.rb +30 -0
- data/lib/reliefweb-api/models/query_value_post.rb +175 -0
- data/lib/reliefweb-api/models/report.rb +293 -0
- data/lib/reliefweb-api/models/sort_post.rb +175 -0
- data/lib/reliefweb-api/models/source.rb +237 -0
- data/lib/reliefweb-api/models/training.rb +330 -0
- data/lib/reliefweb-api/version.rb +15 -0
- data/reliefweb-api.gemspec +45 -0
- data/spec/api/countries_api_spec.rb +94 -0
- data/spec/api/disasters_api_spec.rb +94 -0
- data/spec/api/discovery_api_spec.rb +55 -0
- data/spec/api/jobs_api_spec.rb +94 -0
- data/spec/api/reports_api_spec.rb +94 -0
- data/spec/api/sources_api_spec.rb +94 -0
- data/spec/api/training_api_spec.rb +94 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/category_spec.rb +47 -0
- data/spec/models/country_spec.rb +65 -0
- data/spec/models/date_spec.rb +53 -0
- data/spec/models/disaster_spec.rb +113 -0
- data/spec/models/error_definition_spec.rb +35 -0
- data/spec/models/error_spec.rb +47 -0
- data/spec/models/facets_field_post_spec.rb +35 -0
- data/spec/models/facets_filter_post_spec.rb +35 -0
- data/spec/models/facets_interval_post_spec.rb +35 -0
- data/spec/models/facets_limit_post_spec.rb +35 -0
- data/spec/models/facets_name_post_spec.rb +35 -0
- data/spec/models/facets_sort_post_spec.rb +35 -0
- data/spec/models/fields_exclude_post_spec.rb +35 -0
- data/spec/models/fields_include_post_spec.rb +35 -0
- data/spec/models/file_spec.rb +65 -0
- data/spec/models/filter_conditions_post_spec.rb +35 -0
- data/spec/models/filter_field_post_spec.rb +35 -0
- data/spec/models/filter_negate_post_spec.rb +35 -0
- data/spec/models/filter_operator_post_spec.rb +35 -0
- data/spec/models/filter_value_post_spec.rb +35 -0
- data/spec/models/job_spec.rb +131 -0
- data/spec/models/language_spec.rb +53 -0
- data/spec/models/limit_post_spec.rb +35 -0
- data/spec/models/location_spec.rb +41 -0
- data/spec/models/offset_post_spec.rb +35 -0
- data/spec/models/post_params_spec.rb +161 -0
- data/spec/models/preset_post_spec.rb +35 -0
- data/spec/models/profile_post_spec.rb +35 -0
- data/spec/models/query_fields_post_spec.rb +35 -0
- data/spec/models/query_operator_post_spec.rb +35 -0
- data/spec/models/query_value_post_spec.rb +35 -0
- data/spec/models/report_spec.rb +107 -0
- data/spec/models/sort_post_spec.rb +35 -0
- data/spec/models/source_spec.rb +77 -0
- data/spec/models/training_spec.rb +131 -0
- data/spec/spec_helper.rb +111 -0
- metadata +416 -0
@@ -0,0 +1,277 @@
|
|
1
|
+
=begin
|
2
|
+
#The ReliefWeb API
|
3
|
+
|
4
|
+
#Interactive API documentation for the data API of Reliefweb.int. ReliefWeb is a leading source of information on global crises and disasters.<br><br> Our continuous coverage and archive going back to the 1970s makes ReliefWeb an unparalleled resource for both current and historical data on humanitarian response.<br><br> The vast majority of content on ReliefWeb has been contributed by humanitarian partners. We owe it to the community to make data more accessible and reusable, so that developers can build tools that increase exposure for valuable content and facilitate analysis for better decisions.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
Contact: api@reliefweb.int
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.12
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module ReliefWebAPI
|
16
|
+
class SourcesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Find source by its unique ID
|
23
|
+
# Individual sources.
|
24
|
+
# @param source_id The identifier of the source
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
27
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
28
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
29
|
+
# @return [Source]
|
30
|
+
def get_source_by_id(source_id, opts = {})
|
31
|
+
data, _status_code, _headers = get_source_by_id_with_http_info(source_id, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Find source by its unique ID
|
36
|
+
# Individual sources.
|
37
|
+
# @param source_id The identifier of the source
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
40
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
41
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
42
|
+
# @return [Array<(Source, Fixnum, Hash)>] Source data, response status code and response headers
|
43
|
+
def get_source_by_id_with_http_info(source_id, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: SourcesApi.get_source_by_id ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'source_id' is set
|
48
|
+
if @api_client.config.client_side_validation && source_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'source_id' when calling SourcesApi.get_source_by_id"
|
50
|
+
end
|
51
|
+
if @api_client.config.client_side_validation && opts[:'profile'] && !['full', 'list', 'minimal'].include?(opts[:'profile'])
|
52
|
+
fail ArgumentError, 'invalid value for "profile", must be one of full, list, minimal'
|
53
|
+
end
|
54
|
+
# resource path
|
55
|
+
local_var_path = '/sources/{sourceId}'.sub('{' + 'sourceId' + '}', source_id.to_s)
|
56
|
+
|
57
|
+
# query parameters
|
58
|
+
query_params = {}
|
59
|
+
query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
60
|
+
query_params[:'fields[include][]'] = @api_client.build_collection_param(opts[:'fields_include'], :csv) if !opts[:'fields_include'].nil?
|
61
|
+
query_params[:'fields[exclude][]'] = @api_client.build_collection_param(opts[:'fields_exclude'], :csv) if !opts[:'fields_exclude'].nil?
|
62
|
+
|
63
|
+
# header parameters
|
64
|
+
header_params = {}
|
65
|
+
# HTTP header 'Accept' (if needed)
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
67
|
+
# HTTP header 'Content-Type'
|
68
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain; charset=utf-8', 'application/json'])
|
69
|
+
|
70
|
+
# form parameters
|
71
|
+
form_params = {}
|
72
|
+
|
73
|
+
# http body (model)
|
74
|
+
post_body = nil
|
75
|
+
auth_names = []
|
76
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => 'Source')
|
83
|
+
if @api_client.config.debugging
|
84
|
+
@api_client.config.logger.debug "API called: SourcesApi#get_source_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
85
|
+
end
|
86
|
+
return data, status_code, headers
|
87
|
+
end
|
88
|
+
# List or search organizations providing content to ReliefWeb.
|
89
|
+
#
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @option opts [String] :query_value Specify the terms of your fuzzy search. The default is no query.
|
92
|
+
# @option opts [String] :query_operator Specify the operator by which your search query words will be combined.
|
93
|
+
# @option opts [Array<String>] :query_fields Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation.
|
94
|
+
# @option opts [String] :filter_field Field to filter by. Every condition must contain either a <code>field</code> or <code>conditions</code> property.
|
95
|
+
# @option opts [Array<String>] :filter_value Value for the field being filtered. Leave blank to require existence of the field, must be present for <code>range</code> and <code>value</code> conditions.
|
96
|
+
# @option opts [String] :filter_operator Operator by which filters will be combined.
|
97
|
+
# @option opts [BOOLEAN] :filter_negate Reverse the filter to include those items that do not match.
|
98
|
+
# @option opts [Array<String>] :filter_conditions This property is used to combine conditions with a logical connector (the <code>operator</code> property). Every condition must contain one of the <code>field</code> or <code>conditions</code> properties.
|
99
|
+
# @option opts [String] :facets_field Field to facet by. May include dates, references or the status field.
|
100
|
+
# @option opts [String] :facets_name Identifier for resulting facet data. Useful when faceting multiple ways on the same field.
|
101
|
+
# @option opts [Integer] :facets_limit Limit the number of facets returned for non-date based facets.
|
102
|
+
# @option opts [String] :facets_sort The sort order of non-date facets. Sorting may be by <code>value</code> or <code>count</code> of terms, and ascending or descending. <code>count</code> defaults to <code>desc</code>, <code>value</code> defaults to <code>asc</code>.
|
103
|
+
# @option opts [Array<String>] :facets_filter Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
104
|
+
# @option opts [String] :facets_interval Round date information to the nearest interval unit. Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
105
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
106
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
107
|
+
# @option opts [Integer] :limit The maximum number of items to return for a list query. The default is <code>10</code> and the maximum <code>1000</code>. (default to 10)
|
108
|
+
# @option opts [Integer] :offset The offset from which to return the items in a list query. Allows paging through all results. The default is <code>0</code>. (default to 0)
|
109
|
+
# @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of <code>fieldname:(asc|desc)</code>.
|
110
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
111
|
+
# @option opts [String] :preset Pre-built standard configurations of queries, filters and sorts for common use cases.
|
112
|
+
# @return [Source]
|
113
|
+
def get_sources(opts = {})
|
114
|
+
data, _status_code, _headers = get_sources_with_http_info(opts)
|
115
|
+
data
|
116
|
+
end
|
117
|
+
|
118
|
+
# List or search organizations providing content to ReliefWeb.
|
119
|
+
#
|
120
|
+
# @param [Hash] opts the optional parameters
|
121
|
+
# @option opts [String] :query_value Specify the terms of your fuzzy search. The default is no query.
|
122
|
+
# @option opts [String] :query_operator Specify the operator by which your search query words will be combined.
|
123
|
+
# @option opts [Array<String>] :query_fields Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation.
|
124
|
+
# @option opts [String] :filter_field Field to filter by. Every condition must contain either a <code>field</code> or <code>conditions</code> property.
|
125
|
+
# @option opts [Array<String>] :filter_value Value for the field being filtered. Leave blank to require existence of the field, must be present for <code>range</code> and <code>value</code> conditions.
|
126
|
+
# @option opts [String] :filter_operator Operator by which filters will be combined.
|
127
|
+
# @option opts [BOOLEAN] :filter_negate Reverse the filter to include those items that do not match.
|
128
|
+
# @option opts [Array<String>] :filter_conditions This property is used to combine conditions with a logical connector (the <code>operator</code> property). Every condition must contain one of the <code>field</code> or <code>conditions</code> properties.
|
129
|
+
# @option opts [String] :facets_field Field to facet by. May include dates, references or the status field.
|
130
|
+
# @option opts [String] :facets_name Identifier for resulting facet data. Useful when faceting multiple ways on the same field.
|
131
|
+
# @option opts [Integer] :facets_limit Limit the number of facets returned for non-date based facets.
|
132
|
+
# @option opts [String] :facets_sort The sort order of non-date facets. Sorting may be by <code>value</code> or <code>count</code> of terms, and ascending or descending. <code>count</code> defaults to <code>desc</code>, <code>value</code> defaults to <code>asc</code>.
|
133
|
+
# @option opts [Array<String>] :facets_filter Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
134
|
+
# @option opts [String] :facets_interval Round date information to the nearest interval unit. Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
135
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
136
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
137
|
+
# @option opts [Integer] :limit The maximum number of items to return for a list query. The default is <code>10</code> and the maximum <code>1000</code>.
|
138
|
+
# @option opts [Integer] :offset The offset from which to return the items in a list query. Allows paging through all results. The default is <code>0</code>.
|
139
|
+
# @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of <code>fieldname:(asc|desc)</code>.
|
140
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
141
|
+
# @option opts [String] :preset Pre-built standard configurations of queries, filters and sorts for common use cases.
|
142
|
+
# @return [Array<(Source, Fixnum, Hash)>] Source data, response status code and response headers
|
143
|
+
def get_sources_with_http_info(opts = {})
|
144
|
+
if @api_client.config.debugging
|
145
|
+
@api_client.config.logger.debug 'Calling API: SourcesApi.get_sources ...'
|
146
|
+
end
|
147
|
+
if @api_client.config.client_side_validation && opts[:'query_operator'] && !['AND', 'OR'].include?(opts[:'query_operator'])
|
148
|
+
fail ArgumentError, 'invalid value for "query_operator", must be one of AND, OR'
|
149
|
+
end
|
150
|
+
if @api_client.config.client_side_validation && opts[:'filter_operator'] && !['AND', 'OR'].include?(opts[:'filter_operator'])
|
151
|
+
fail ArgumentError, 'invalid value for "filter_operator", must be one of AND, OR'
|
152
|
+
end
|
153
|
+
if @api_client.config.client_side_validation && opts[:'facets_interval'] && !['year', 'month', 'week', 'day'].include?(opts[:'facets_interval'])
|
154
|
+
fail ArgumentError, 'invalid value for "facets_interval", must be one of year, month, week, day'
|
155
|
+
end
|
156
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
157
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SourcesApi.get_sources, must be smaller than or equal to 1000.'
|
158
|
+
end
|
159
|
+
|
160
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
161
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SourcesApi.get_sources, must be greater than or equal to 1.'
|
162
|
+
end
|
163
|
+
|
164
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
165
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SourcesApi.get_sources, must be greater than or equal to 0.'
|
166
|
+
end
|
167
|
+
|
168
|
+
if @api_client.config.client_side_validation && opts[:'profile'] && !['full', 'list', 'minimal'].include?(opts[:'profile'])
|
169
|
+
fail ArgumentError, 'invalid value for "profile", must be one of full, list, minimal'
|
170
|
+
end
|
171
|
+
if @api_client.config.client_side_validation && opts[:'preset'] && !['analysis', 'latest', 'minimal'].include?(opts[:'preset'])
|
172
|
+
fail ArgumentError, 'invalid value for "preset", must be one of analysis, latest, minimal'
|
173
|
+
end
|
174
|
+
# resource path
|
175
|
+
local_var_path = '/sources'
|
176
|
+
|
177
|
+
# query parameters
|
178
|
+
query_params = {}
|
179
|
+
query_params[:'query[value]'] = opts[:'query_value'] if !opts[:'query_value'].nil?
|
180
|
+
query_params[:'query[operator]'] = opts[:'query_operator'] if !opts[:'query_operator'].nil?
|
181
|
+
query_params[:'query[fields][]'] = @api_client.build_collection_param(opts[:'query_fields'], :csv) if !opts[:'query_fields'].nil?
|
182
|
+
query_params[:'filter[field]'] = opts[:'filter_field'] if !opts[:'filter_field'].nil?
|
183
|
+
query_params[:'filter[value][]'] = @api_client.build_collection_param(opts[:'filter_value'], :csv) if !opts[:'filter_value'].nil?
|
184
|
+
query_params[:'filter[operator]'] = opts[:'filter_operator'] if !opts[:'filter_operator'].nil?
|
185
|
+
query_params[:'filter[negate]'] = opts[:'filter_negate'] if !opts[:'filter_negate'].nil?
|
186
|
+
query_params[:'filter[conditions][]'] = @api_client.build_collection_param(opts[:'filter_conditions'], :csv) if !opts[:'filter_conditions'].nil?
|
187
|
+
query_params[:'facets[field]'] = opts[:'facets_field'] if !opts[:'facets_field'].nil?
|
188
|
+
query_params[:'facets[name]'] = opts[:'facets_name'] if !opts[:'facets_name'].nil?
|
189
|
+
query_params[:'facets[limit]'] = opts[:'facets_limit'] if !opts[:'facets_limit'].nil?
|
190
|
+
query_params[:'facets[sort]'] = opts[:'facets_sort'] if !opts[:'facets_sort'].nil?
|
191
|
+
query_params[:'facets[filter][]'] = @api_client.build_collection_param(opts[:'facets_filter'], :csv) if !opts[:'facets_filter'].nil?
|
192
|
+
query_params[:'facets[interval]'] = opts[:'facets_interval'] if !opts[:'facets_interval'].nil?
|
193
|
+
query_params[:'fields[include][]'] = @api_client.build_collection_param(opts[:'fields_include'], :csv) if !opts[:'fields_include'].nil?
|
194
|
+
query_params[:'fields[exclude][]'] = @api_client.build_collection_param(opts[:'fields_exclude'], :csv) if !opts[:'fields_exclude'].nil?
|
195
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
196
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
197
|
+
query_params[:'sort[]'] = @api_client.build_collection_param(opts[:'sort'], :csv) if !opts[:'sort'].nil?
|
198
|
+
query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
199
|
+
query_params[:'preset'] = opts[:'preset'] if !opts[:'preset'].nil?
|
200
|
+
|
201
|
+
# header parameters
|
202
|
+
header_params = {}
|
203
|
+
# HTTP header 'Accept' (if needed)
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
205
|
+
# HTTP header 'Content-Type'
|
206
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain; charset=utf-8'])
|
207
|
+
|
208
|
+
# form parameters
|
209
|
+
form_params = {}
|
210
|
+
|
211
|
+
# http body (model)
|
212
|
+
post_body = nil
|
213
|
+
auth_names = []
|
214
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
215
|
+
:header_params => header_params,
|
216
|
+
:query_params => query_params,
|
217
|
+
:form_params => form_params,
|
218
|
+
:body => post_body,
|
219
|
+
:auth_names => auth_names,
|
220
|
+
:return_type => 'Source')
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug "API called: SourcesApi#get_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
223
|
+
end
|
224
|
+
return data, status_code, headers
|
225
|
+
end
|
226
|
+
# List or search organizations providing content to ReliefWeb.
|
227
|
+
#
|
228
|
+
# @param [Hash] opts the optional parameters
|
229
|
+
# @option opts [PostParams] :fields Returned fields
|
230
|
+
# @return [Source]
|
231
|
+
def search_sources(opts = {})
|
232
|
+
data, _status_code, _headers = search_sources_with_http_info(opts)
|
233
|
+
data
|
234
|
+
end
|
235
|
+
|
236
|
+
# List or search organizations providing content to ReliefWeb.
|
237
|
+
#
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @option opts [PostParams] :fields Returned fields
|
240
|
+
# @return [Array<(Source, Fixnum, Hash)>] Source data, response status code and response headers
|
241
|
+
def search_sources_with_http_info(opts = {})
|
242
|
+
if @api_client.config.debugging
|
243
|
+
@api_client.config.logger.debug 'Calling API: SourcesApi.search_sources ...'
|
244
|
+
end
|
245
|
+
# resource path
|
246
|
+
local_var_path = '/sources'
|
247
|
+
|
248
|
+
# query parameters
|
249
|
+
query_params = {}
|
250
|
+
|
251
|
+
# header parameters
|
252
|
+
header_params = {}
|
253
|
+
# HTTP header 'Accept' (if needed)
|
254
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
255
|
+
# HTTP header 'Content-Type'
|
256
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
257
|
+
|
258
|
+
# form parameters
|
259
|
+
form_params = {}
|
260
|
+
|
261
|
+
# http body (model)
|
262
|
+
post_body = @api_client.object_to_http_body(opts[:'fields'])
|
263
|
+
auth_names = []
|
264
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
265
|
+
:header_params => header_params,
|
266
|
+
:query_params => query_params,
|
267
|
+
:form_params => form_params,
|
268
|
+
:body => post_body,
|
269
|
+
:auth_names => auth_names,
|
270
|
+
:return_type => 'Source')
|
271
|
+
if @api_client.config.debugging
|
272
|
+
@api_client.config.logger.debug "API called: SourcesApi#search_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
273
|
+
end
|
274
|
+
return data, status_code, headers
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
@@ -0,0 +1,277 @@
|
|
1
|
+
=begin
|
2
|
+
#The ReliefWeb API
|
3
|
+
|
4
|
+
#Interactive API documentation for the data API of Reliefweb.int. ReliefWeb is a leading source of information on global crises and disasters.<br><br> Our continuous coverage and archive going back to the 1970s makes ReliefWeb an unparalleled resource for both current and historical data on humanitarian response.<br><br> The vast majority of content on ReliefWeb has been contributed by humanitarian partners. We owe it to the community to make data more accessible and reusable, so that developers can build tools that increase exposure for valuable content and facilitate analysis for better decisions.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
Contact: api@reliefweb.int
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.12
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module ReliefWebAPI
|
16
|
+
class TrainingApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List or search humanitarian learning opportunities.
|
23
|
+
#
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :query_value Specify the terms of your fuzzy search. The default is no query.
|
26
|
+
# @option opts [String] :query_operator Specify the operator by which your search query words will be combined.
|
27
|
+
# @option opts [Array<String>] :query_fields Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation.
|
28
|
+
# @option opts [String] :filter_field Field to filter by. Every condition must contain either a <code>field</code> or <code>conditions</code> property.
|
29
|
+
# @option opts [Array<String>] :filter_value Value for the field being filtered. Leave blank to require existence of the field, must be present for <code>range</code> and <code>value</code> conditions.
|
30
|
+
# @option opts [String] :filter_operator Operator by which filters will be combined.
|
31
|
+
# @option opts [BOOLEAN] :filter_negate Reverse the filter to include those items that do not match.
|
32
|
+
# @option opts [Array<String>] :filter_conditions This property is used to combine conditions with a logical connector (the <code>operator</code> property). Every condition must contain one of the <code>field</code> or <code>conditions</code> properties.
|
33
|
+
# @option opts [String] :facets_field Field to facet by. May include dates, references or the status field.
|
34
|
+
# @option opts [String] :facets_name Identifier for resulting facet data. Useful when faceting multiple ways on the same field.
|
35
|
+
# @option opts [Integer] :facets_limit Limit the number of facets returned for non-date based facets.
|
36
|
+
# @option opts [String] :facets_sort The sort order of non-date facets. Sorting may be by <code>value</code> or <code>count</code> of terms, and ascending or descending. <code>count</code> defaults to <code>desc</code>, <code>value</code> defaults to <code>asc</code>.
|
37
|
+
# @option opts [Array<String>] :facets_filter Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
38
|
+
# @option opts [String] :facets_interval Round date information to the nearest interval unit. Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
39
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
40
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
41
|
+
# @option opts [Integer] :limit The maximum number of items to return for a list query. The default is <code>10</code> and the maximum <code>1000</code>. (default to 10)
|
42
|
+
# @option opts [Integer] :offset The offset from which to return the items in a list query. Allows paging through all results. The default is <code>0</code>. (default to 0)
|
43
|
+
# @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of <code>fieldname:(asc|desc)</code>.
|
44
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
45
|
+
# @option opts [String] :preset Pre-built standard configurations of queries, filters and sorts for common use cases.
|
46
|
+
# @return [Training]
|
47
|
+
def get_training(opts = {})
|
48
|
+
data, _status_code, _headers = get_training_with_http_info(opts)
|
49
|
+
data
|
50
|
+
end
|
51
|
+
|
52
|
+
# List or search humanitarian learning opportunities.
|
53
|
+
#
|
54
|
+
# @param [Hash] opts the optional parameters
|
55
|
+
# @option opts [String] :query_value Specify the terms of your fuzzy search. The default is no query.
|
56
|
+
# @option opts [String] :query_operator Specify the operator by which your search query words will be combined.
|
57
|
+
# @option opts [Array<String>] :query_fields Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation.
|
58
|
+
# @option opts [String] :filter_field Field to filter by. Every condition must contain either a <code>field</code> or <code>conditions</code> property.
|
59
|
+
# @option opts [Array<String>] :filter_value Value for the field being filtered. Leave blank to require existence of the field, must be present for <code>range</code> and <code>value</code> conditions.
|
60
|
+
# @option opts [String] :filter_operator Operator by which filters will be combined.
|
61
|
+
# @option opts [BOOLEAN] :filter_negate Reverse the filter to include those items that do not match.
|
62
|
+
# @option opts [Array<String>] :filter_conditions This property is used to combine conditions with a logical connector (the <code>operator</code> property). Every condition must contain one of the <code>field</code> or <code>conditions</code> properties.
|
63
|
+
# @option opts [String] :facets_field Field to facet by. May include dates, references or the status field.
|
64
|
+
# @option opts [String] :facets_name Identifier for resulting facet data. Useful when faceting multiple ways on the same field.
|
65
|
+
# @option opts [Integer] :facets_limit Limit the number of facets returned for non-date based facets.
|
66
|
+
# @option opts [String] :facets_sort The sort order of non-date facets. Sorting may be by <code>value</code> or <code>count</code> of terms, and ascending or descending. <code>count</code> defaults to <code>desc</code>, <code>value</code> defaults to <code>asc</code>.
|
67
|
+
# @option opts [Array<String>] :facets_filter Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
68
|
+
# @option opts [String] :facets_interval Round date information to the nearest interval unit. Apply all the same capabilities of the filter parameter to the specific results of this facet request.
|
69
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
70
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
71
|
+
# @option opts [Integer] :limit The maximum number of items to return for a list query. The default is <code>10</code> and the maximum <code>1000</code>.
|
72
|
+
# @option opts [Integer] :offset The offset from which to return the items in a list query. Allows paging through all results. The default is <code>0</code>.
|
73
|
+
# @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of <code>fieldname:(asc|desc)</code>.
|
74
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
75
|
+
# @option opts [String] :preset Pre-built standard configurations of queries, filters and sorts for common use cases.
|
76
|
+
# @return [Array<(Training, Fixnum, Hash)>] Training data, response status code and response headers
|
77
|
+
def get_training_with_http_info(opts = {})
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug 'Calling API: TrainingApi.get_training ...'
|
80
|
+
end
|
81
|
+
if @api_client.config.client_side_validation && opts[:'query_operator'] && !['AND', 'OR'].include?(opts[:'query_operator'])
|
82
|
+
fail ArgumentError, 'invalid value for "query_operator", must be one of AND, OR'
|
83
|
+
end
|
84
|
+
if @api_client.config.client_side_validation && opts[:'filter_operator'] && !['AND', 'OR'].include?(opts[:'filter_operator'])
|
85
|
+
fail ArgumentError, 'invalid value for "filter_operator", must be one of AND, OR'
|
86
|
+
end
|
87
|
+
if @api_client.config.client_side_validation && opts[:'facets_interval'] && !['year', 'month', 'week', 'day'].include?(opts[:'facets_interval'])
|
88
|
+
fail ArgumentError, 'invalid value for "facets_interval", must be one of year, month, week, day'
|
89
|
+
end
|
90
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
91
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TrainingApi.get_training, must be smaller than or equal to 1000.'
|
92
|
+
end
|
93
|
+
|
94
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
95
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TrainingApi.get_training, must be greater than or equal to 1.'
|
96
|
+
end
|
97
|
+
|
98
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
99
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TrainingApi.get_training, must be greater than or equal to 0.'
|
100
|
+
end
|
101
|
+
|
102
|
+
if @api_client.config.client_side_validation && opts[:'profile'] && !['full', 'list', 'minimal'].include?(opts[:'profile'])
|
103
|
+
fail ArgumentError, 'invalid value for "profile", must be one of full, list, minimal'
|
104
|
+
end
|
105
|
+
if @api_client.config.client_side_validation && opts[:'preset'] && !['analysis', 'latest', 'minimal'].include?(opts[:'preset'])
|
106
|
+
fail ArgumentError, 'invalid value for "preset", must be one of analysis, latest, minimal'
|
107
|
+
end
|
108
|
+
# resource path
|
109
|
+
local_var_path = '/training'
|
110
|
+
|
111
|
+
# query parameters
|
112
|
+
query_params = {}
|
113
|
+
query_params[:'query[value]'] = opts[:'query_value'] if !opts[:'query_value'].nil?
|
114
|
+
query_params[:'query[operator]'] = opts[:'query_operator'] if !opts[:'query_operator'].nil?
|
115
|
+
query_params[:'query[fields][]'] = @api_client.build_collection_param(opts[:'query_fields'], :csv) if !opts[:'query_fields'].nil?
|
116
|
+
query_params[:'filter[field]'] = opts[:'filter_field'] if !opts[:'filter_field'].nil?
|
117
|
+
query_params[:'filter[value][]'] = @api_client.build_collection_param(opts[:'filter_value'], :csv) if !opts[:'filter_value'].nil?
|
118
|
+
query_params[:'filter[operator]'] = opts[:'filter_operator'] if !opts[:'filter_operator'].nil?
|
119
|
+
query_params[:'filter[negate]'] = opts[:'filter_negate'] if !opts[:'filter_negate'].nil?
|
120
|
+
query_params[:'filter[conditions][]'] = @api_client.build_collection_param(opts[:'filter_conditions'], :csv) if !opts[:'filter_conditions'].nil?
|
121
|
+
query_params[:'facets[field]'] = opts[:'facets_field'] if !opts[:'facets_field'].nil?
|
122
|
+
query_params[:'facets[name]'] = opts[:'facets_name'] if !opts[:'facets_name'].nil?
|
123
|
+
query_params[:'facets[limit]'] = opts[:'facets_limit'] if !opts[:'facets_limit'].nil?
|
124
|
+
query_params[:'facets[sort]'] = opts[:'facets_sort'] if !opts[:'facets_sort'].nil?
|
125
|
+
query_params[:'facets[filter][]'] = @api_client.build_collection_param(opts[:'facets_filter'], :csv) if !opts[:'facets_filter'].nil?
|
126
|
+
query_params[:'facets[interval]'] = opts[:'facets_interval'] if !opts[:'facets_interval'].nil?
|
127
|
+
query_params[:'fields[include][]'] = @api_client.build_collection_param(opts[:'fields_include'], :csv) if !opts[:'fields_include'].nil?
|
128
|
+
query_params[:'fields[exclude][]'] = @api_client.build_collection_param(opts[:'fields_exclude'], :csv) if !opts[:'fields_exclude'].nil?
|
129
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
130
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
131
|
+
query_params[:'sort[]'] = @api_client.build_collection_param(opts[:'sort'], :csv) if !opts[:'sort'].nil?
|
132
|
+
query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
133
|
+
query_params[:'preset'] = opts[:'preset'] if !opts[:'preset'].nil?
|
134
|
+
|
135
|
+
# header parameters
|
136
|
+
header_params = {}
|
137
|
+
# HTTP header 'Accept' (if needed)
|
138
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
139
|
+
# HTTP header 'Content-Type'
|
140
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain; charset=utf-8'])
|
141
|
+
|
142
|
+
# form parameters
|
143
|
+
form_params = {}
|
144
|
+
|
145
|
+
# http body (model)
|
146
|
+
post_body = nil
|
147
|
+
auth_names = []
|
148
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
149
|
+
:header_params => header_params,
|
150
|
+
:query_params => query_params,
|
151
|
+
:form_params => form_params,
|
152
|
+
:body => post_body,
|
153
|
+
:auth_names => auth_names,
|
154
|
+
:return_type => 'Training')
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug "API called: TrainingApi#get_training\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
+
end
|
158
|
+
return data, status_code, headers
|
159
|
+
end
|
160
|
+
# Find training by its unique ID
|
161
|
+
# Individual training opportunities.
|
162
|
+
# @param training_id The identifier of the training opportunity.
|
163
|
+
# @param [Hash] opts the optional parameters
|
164
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
165
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
166
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
167
|
+
# @return [Training]
|
168
|
+
def get_training_by_id(training_id, opts = {})
|
169
|
+
data, _status_code, _headers = get_training_by_id_with_http_info(training_id, opts)
|
170
|
+
data
|
171
|
+
end
|
172
|
+
|
173
|
+
# Find training by its unique ID
|
174
|
+
# Individual training opportunities.
|
175
|
+
# @param training_id The identifier of the training opportunity.
|
176
|
+
# @param [Hash] opts the optional parameters
|
177
|
+
# @option opts [String] :profile Pre-built standard selections of fields to return for ease of displaying lists or items.
|
178
|
+
# @option opts [Array<String>] :fields_include Specify which fields to include for each item. Defaults to an item label.
|
179
|
+
# @option opts [Array<String>] :fields_exclude Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
|
180
|
+
# @return [Array<(Training, Fixnum, Hash)>] Training data, response status code and response headers
|
181
|
+
def get_training_by_id_with_http_info(training_id, opts = {})
|
182
|
+
if @api_client.config.debugging
|
183
|
+
@api_client.config.logger.debug 'Calling API: TrainingApi.get_training_by_id ...'
|
184
|
+
end
|
185
|
+
# verify the required parameter 'training_id' is set
|
186
|
+
if @api_client.config.client_side_validation && training_id.nil?
|
187
|
+
fail ArgumentError, "Missing the required parameter 'training_id' when calling TrainingApi.get_training_by_id"
|
188
|
+
end
|
189
|
+
if @api_client.config.client_side_validation && opts[:'profile'] && !['full', 'list', 'minimal'].include?(opts[:'profile'])
|
190
|
+
fail ArgumentError, 'invalid value for "profile", must be one of full, list, minimal'
|
191
|
+
end
|
192
|
+
# resource path
|
193
|
+
local_var_path = '/training/{trainingId}'.sub('{' + 'trainingId' + '}', training_id.to_s)
|
194
|
+
|
195
|
+
# query parameters
|
196
|
+
query_params = {}
|
197
|
+
query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil?
|
198
|
+
query_params[:'fields[include][]'] = @api_client.build_collection_param(opts[:'fields_include'], :csv) if !opts[:'fields_include'].nil?
|
199
|
+
query_params[:'fields[exclude][]'] = @api_client.build_collection_param(opts[:'fields_exclude'], :csv) if !opts[:'fields_exclude'].nil?
|
200
|
+
|
201
|
+
# header parameters
|
202
|
+
header_params = {}
|
203
|
+
# HTTP header 'Accept' (if needed)
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
205
|
+
# HTTP header 'Content-Type'
|
206
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain; charset=utf-8', 'application/json'])
|
207
|
+
|
208
|
+
# form parameters
|
209
|
+
form_params = {}
|
210
|
+
|
211
|
+
# http body (model)
|
212
|
+
post_body = nil
|
213
|
+
auth_names = []
|
214
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
215
|
+
:header_params => header_params,
|
216
|
+
:query_params => query_params,
|
217
|
+
:form_params => form_params,
|
218
|
+
:body => post_body,
|
219
|
+
:auth_names => auth_names,
|
220
|
+
:return_type => 'Training')
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug "API called: TrainingApi#get_training_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
223
|
+
end
|
224
|
+
return data, status_code, headers
|
225
|
+
end
|
226
|
+
# List or search humanitarian learning opportunities.
|
227
|
+
#
|
228
|
+
# @param [Hash] opts the optional parameters
|
229
|
+
# @option opts [PostParams] :fields Returned fields
|
230
|
+
# @return [Training]
|
231
|
+
def search_training(opts = {})
|
232
|
+
data, _status_code, _headers = search_training_with_http_info(opts)
|
233
|
+
data
|
234
|
+
end
|
235
|
+
|
236
|
+
# List or search humanitarian learning opportunities.
|
237
|
+
#
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @option opts [PostParams] :fields Returned fields
|
240
|
+
# @return [Array<(Training, Fixnum, Hash)>] Training data, response status code and response headers
|
241
|
+
def search_training_with_http_info(opts = {})
|
242
|
+
if @api_client.config.debugging
|
243
|
+
@api_client.config.logger.debug 'Calling API: TrainingApi.search_training ...'
|
244
|
+
end
|
245
|
+
# resource path
|
246
|
+
local_var_path = '/training'
|
247
|
+
|
248
|
+
# query parameters
|
249
|
+
query_params = {}
|
250
|
+
|
251
|
+
# header parameters
|
252
|
+
header_params = {}
|
253
|
+
# HTTP header 'Accept' (if needed)
|
254
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
255
|
+
# HTTP header 'Content-Type'
|
256
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
257
|
+
|
258
|
+
# form parameters
|
259
|
+
form_params = {}
|
260
|
+
|
261
|
+
# http body (model)
|
262
|
+
post_body = @api_client.object_to_http_body(opts[:'fields'])
|
263
|
+
auth_names = []
|
264
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
265
|
+
:header_params => header_params,
|
266
|
+
:query_params => query_params,
|
267
|
+
:form_params => form_params,
|
268
|
+
:body => post_body,
|
269
|
+
:auth_names => auth_names,
|
270
|
+
:return_type => 'Training')
|
271
|
+
if @api_client.config.debugging
|
272
|
+
@api_client.config.logger.debug "API called: TrainingApi#search_training\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
273
|
+
end
|
274
|
+
return data, status_code, headers
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|