reliefweb-api 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +163 -0
  4. data/Rakefile +8 -0
  5. data/config.json +8 -0
  6. data/docs/Category.md +9 -0
  7. data/docs/CountriesApi.md +202 -0
  8. data/docs/Country.md +12 -0
  9. data/docs/Date.md +10 -0
  10. data/docs/Disaster.md +20 -0
  11. data/docs/DisastersApi.md +202 -0
  12. data/docs/DiscoveryApi.md +88 -0
  13. data/docs/Error.md +9 -0
  14. data/docs/ErrorDefinition.md +7 -0
  15. data/docs/FacetsFieldPost.md +7 -0
  16. data/docs/FacetsFilterPost.md +7 -0
  17. data/docs/FacetsIntervalPost.md +7 -0
  18. data/docs/FacetsLimitPost.md +7 -0
  19. data/docs/FacetsNamePost.md +7 -0
  20. data/docs/FacetsSortPost.md +7 -0
  21. data/docs/FieldsExcludePost.md +7 -0
  22. data/docs/FieldsIncludePost.md +7 -0
  23. data/docs/File.md +12 -0
  24. data/docs/FilterConditionsPost.md +7 -0
  25. data/docs/FilterFieldPost.md +7 -0
  26. data/docs/FilterNegatePost.md +7 -0
  27. data/docs/FilterOperatorPost.md +7 -0
  28. data/docs/FilterValuePost.md +7 -0
  29. data/docs/Job.md +23 -0
  30. data/docs/JobsApi.md +202 -0
  31. data/docs/Language.md +10 -0
  32. data/docs/LimitPost.md +7 -0
  33. data/docs/Location.md +8 -0
  34. data/docs/OffsetPost.md +7 -0
  35. data/docs/PostParams.md +28 -0
  36. data/docs/PresetPost.md +7 -0
  37. data/docs/ProfilePost.md +7 -0
  38. data/docs/QueryFieldsPost.md +7 -0
  39. data/docs/QueryOperatorPost.md +7 -0
  40. data/docs/QueryValuePost.md +7 -0
  41. data/docs/Report.md +19 -0
  42. data/docs/ReportsApi.md +202 -0
  43. data/docs/SortPost.md +7 -0
  44. data/docs/Source.md +14 -0
  45. data/docs/SourcesApi.md +202 -0
  46. data/docs/Training.md +23 -0
  47. data/docs/TrainingApi.md +202 -0
  48. data/git_push.sh +55 -0
  49. data/lib/reliefweb-api.rb +81 -0
  50. data/lib/reliefweb-api/api/countries_api.rb +277 -0
  51. data/lib/reliefweb-api/api/disasters_api.rb +277 -0
  52. data/lib/reliefweb-api/api/discovery_api.rb +113 -0
  53. data/lib/reliefweb-api/api/jobs_api.rb +277 -0
  54. data/lib/reliefweb-api/api/reports_api.rb +277 -0
  55. data/lib/reliefweb-api/api/sources_api.rb +277 -0
  56. data/lib/reliefweb-api/api/training_api.rb +277 -0
  57. data/lib/reliefweb-api/api_client.rb +388 -0
  58. data/lib/reliefweb-api/api_error.rb +38 -0
  59. data/lib/reliefweb-api/configuration.rb +202 -0
  60. data/lib/reliefweb-api/models/category.rb +192 -0
  61. data/lib/reliefweb-api/models/country.rb +220 -0
  62. data/lib/reliefweb-api/models/date.rb +202 -0
  63. data/lib/reliefweb-api/models/disaster.rb +299 -0
  64. data/lib/reliefweb-api/models/error.rb +192 -0
  65. data/lib/reliefweb-api/models/error_definition.rb +174 -0
  66. data/lib/reliefweb-api/models/facets_field_post.rb +175 -0
  67. data/lib/reliefweb-api/models/facets_filter_post.rb +175 -0
  68. data/lib/reliefweb-api/models/facets_interval_post.rb +32 -0
  69. data/lib/reliefweb-api/models/facets_limit_post.rb +175 -0
  70. data/lib/reliefweb-api/models/facets_name_post.rb +175 -0
  71. data/lib/reliefweb-api/models/facets_sort_post.rb +175 -0
  72. data/lib/reliefweb-api/models/fields_exclude_post.rb +175 -0
  73. data/lib/reliefweb-api/models/fields_include_post.rb +175 -0
  74. data/lib/reliefweb-api/models/file.rb +219 -0
  75. data/lib/reliefweb-api/models/filter_conditions_post.rb +175 -0
  76. data/lib/reliefweb-api/models/filter_field_post.rb +175 -0
  77. data/lib/reliefweb-api/models/filter_negate_post.rb +175 -0
  78. data/lib/reliefweb-api/models/filter_operator_post.rb +30 -0
  79. data/lib/reliefweb-api/models/filter_value_post.rb +175 -0
  80. data/lib/reliefweb-api/models/job.rb +330 -0
  81. data/lib/reliefweb-api/models/language.rb +201 -0
  82. data/lib/reliefweb-api/models/limit_post.rb +175 -0
  83. data/lib/reliefweb-api/models/location.rb +183 -0
  84. data/lib/reliefweb-api/models/offset_post.rb +175 -0
  85. data/lib/reliefweb-api/models/post_params.rb +363 -0
  86. data/lib/reliefweb-api/models/preset_post.rb +31 -0
  87. data/lib/reliefweb-api/models/profile_post.rb +31 -0
  88. data/lib/reliefweb-api/models/query_fields_post.rb +175 -0
  89. data/lib/reliefweb-api/models/query_operator_post.rb +30 -0
  90. data/lib/reliefweb-api/models/query_value_post.rb +175 -0
  91. data/lib/reliefweb-api/models/report.rb +293 -0
  92. data/lib/reliefweb-api/models/sort_post.rb +175 -0
  93. data/lib/reliefweb-api/models/source.rb +237 -0
  94. data/lib/reliefweb-api/models/training.rb +330 -0
  95. data/lib/reliefweb-api/version.rb +15 -0
  96. data/reliefweb-api.gemspec +45 -0
  97. data/spec/api/countries_api_spec.rb +94 -0
  98. data/spec/api/disasters_api_spec.rb +94 -0
  99. data/spec/api/discovery_api_spec.rb +55 -0
  100. data/spec/api/jobs_api_spec.rb +94 -0
  101. data/spec/api/reports_api_spec.rb +94 -0
  102. data/spec/api/sources_api_spec.rb +94 -0
  103. data/spec/api/training_api_spec.rb +94 -0
  104. data/spec/api_client_spec.rb +226 -0
  105. data/spec/configuration_spec.rb +42 -0
  106. data/spec/models/category_spec.rb +47 -0
  107. data/spec/models/country_spec.rb +65 -0
  108. data/spec/models/date_spec.rb +53 -0
  109. data/spec/models/disaster_spec.rb +113 -0
  110. data/spec/models/error_definition_spec.rb +35 -0
  111. data/spec/models/error_spec.rb +47 -0
  112. data/spec/models/facets_field_post_spec.rb +35 -0
  113. data/spec/models/facets_filter_post_spec.rb +35 -0
  114. data/spec/models/facets_interval_post_spec.rb +35 -0
  115. data/spec/models/facets_limit_post_spec.rb +35 -0
  116. data/spec/models/facets_name_post_spec.rb +35 -0
  117. data/spec/models/facets_sort_post_spec.rb +35 -0
  118. data/spec/models/fields_exclude_post_spec.rb +35 -0
  119. data/spec/models/fields_include_post_spec.rb +35 -0
  120. data/spec/models/file_spec.rb +65 -0
  121. data/spec/models/filter_conditions_post_spec.rb +35 -0
  122. data/spec/models/filter_field_post_spec.rb +35 -0
  123. data/spec/models/filter_negate_post_spec.rb +35 -0
  124. data/spec/models/filter_operator_post_spec.rb +35 -0
  125. data/spec/models/filter_value_post_spec.rb +35 -0
  126. data/spec/models/job_spec.rb +131 -0
  127. data/spec/models/language_spec.rb +53 -0
  128. data/spec/models/limit_post_spec.rb +35 -0
  129. data/spec/models/location_spec.rb +41 -0
  130. data/spec/models/offset_post_spec.rb +35 -0
  131. data/spec/models/post_params_spec.rb +161 -0
  132. data/spec/models/preset_post_spec.rb +35 -0
  133. data/spec/models/profile_post_spec.rb +35 -0
  134. data/spec/models/query_fields_post_spec.rb +35 -0
  135. data/spec/models/query_operator_post_spec.rb +35 -0
  136. data/spec/models/query_value_post_spec.rb +35 -0
  137. data/spec/models/report_spec.rb +107 -0
  138. data/spec/models/sort_post_spec.rb +35 -0
  139. data/spec/models/source_spec.rb +77 -0
  140. data/spec/models/training_spec.rb +131 -0
  141. data/spec/spec_helper.rb +111 -0
  142. metadata +416 -0
@@ -0,0 +1,113 @@
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 DiscoveryApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Review list of main entrypoints and top-level resources.
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [nil]
25
+ def discovery_resources(opts = {})
26
+ discovery_resources_with_http_info(opts)
27
+ nil
28
+ end
29
+
30
+ # Review list of main entrypoints and top-level resources.
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
33
+ def discovery_resources_with_http_info(opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: DiscoveryApi.discovery_resources ...'
36
+ end
37
+ # resource path
38
+ local_var_path = '/'
39
+
40
+ # query parameters
41
+ query_params = {}
42
+
43
+ # header parameters
44
+ header_params = {}
45
+ # HTTP header 'Accept' (if needed)
46
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
47
+ # HTTP header 'Content-Type'
48
+ header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain; charset=utf-8'])
49
+
50
+ # form parameters
51
+ form_params = {}
52
+
53
+ # http body (model)
54
+ post_body = nil
55
+ auth_names = []
56
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
57
+ :header_params => header_params,
58
+ :query_params => query_params,
59
+ :form_params => form_params,
60
+ :body => post_body,
61
+ :auth_names => auth_names)
62
+ if @api_client.config.debugging
63
+ @api_client.config.logger.debug "API called: DiscoveryApi#discovery_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
64
+ end
65
+ return data, status_code, headers
66
+ end
67
+ # Review location and status of all versions.
68
+ # @param [Hash] opts the optional parameters
69
+ # @return [nil]
70
+ def discovery_versions(opts = {})
71
+ discovery_versions_with_http_info(opts)
72
+ nil
73
+ end
74
+
75
+ # Review location and status of all versions.
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
78
+ def discovery_versions_with_http_info(opts = {})
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug 'Calling API: DiscoveryApi.discovery_versions ...'
81
+ end
82
+ # resource path
83
+ local_var_path = '/../'
84
+
85
+ # query parameters
86
+ query_params = {}
87
+
88
+ # header parameters
89
+ header_params = {}
90
+ # HTTP header 'Accept' (if needed)
91
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
92
+ # HTTP header 'Content-Type'
93
+ header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain; charset=utf-8'])
94
+
95
+ # form parameters
96
+ form_params = {}
97
+
98
+ # http body (model)
99
+ post_body = nil
100
+ auth_names = []
101
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
102
+ :header_params => header_params,
103
+ :query_params => query_params,
104
+ :form_params => form_params,
105
+ :body => post_body,
106
+ :auth_names => auth_names)
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug "API called: DiscoveryApi#discovery_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
109
+ end
110
+ return data, status_code, headers
111
+ end
112
+ end
113
+ 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 JobsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Find job by its unique ID
23
+ # Individual jobs.
24
+ # @param job_id The identifier of the job.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
29
+ # @return [Job]
30
+ def get_job_by_id(job_id, opts = {})
31
+ data, _status_code, _headers = get_job_by_id_with_http_info(job_id, opts)
32
+ data
33
+ end
34
+
35
+ # Find job by its unique ID
36
+ # Individual jobs.
37
+ # @param job_id The identifier of the job.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
42
+ # @return [Array<(Job, Fixnum, Hash)>] Job data, response status code and response headers
43
+ def get_job_by_id_with_http_info(job_id, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: JobsApi.get_job_by_id ...'
46
+ end
47
+ # verify the required parameter 'job_id' is set
48
+ if @api_client.config.client_side_validation && job_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.get_job_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 = '/jobs/{jobId}'.sub('{' + 'jobId' + '}', job_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 => 'Job')
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: JobsApi#get_job_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 humanitarian job offers.
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 &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;range&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt; 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 &lt;code&gt;operator&lt;/code&gt; property). Every condition must contain one of the &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;count&lt;/code&gt; of terms, and ascending or descending. &lt;code&gt;count&lt;/code&gt; defaults to &lt;code&gt;desc&lt;/code&gt;, &lt;code&gt;value&lt;/code&gt; defaults to &lt;code&gt;asc&lt;/code&gt;.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
107
+ # @option opts [Integer] :limit The maximum number of items to return for a list query. The default is &lt;code&gt;10&lt;/code&gt; and the maximum &lt;code&gt;1000&lt;/code&gt;. (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 &lt;code&gt;0&lt;/code&gt;. (default to 0)
109
+ # @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of &lt;code&gt;fieldname:(asc|desc)&lt;/code&gt;.
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 [Job]
113
+ def get_jobs(opts = {})
114
+ data, _status_code, _headers = get_jobs_with_http_info(opts)
115
+ data
116
+ end
117
+
118
+ # List or search humanitarian job offers.
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 &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;range&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt; 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 &lt;code&gt;operator&lt;/code&gt; property). Every condition must contain one of the &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;count&lt;/code&gt; of terms, and ascending or descending. &lt;code&gt;count&lt;/code&gt; defaults to &lt;code&gt;desc&lt;/code&gt;, &lt;code&gt;value&lt;/code&gt; defaults to &lt;code&gt;asc&lt;/code&gt;.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
137
+ # @option opts [Integer] :limit The maximum number of items to return for a list query. The default is &lt;code&gt;10&lt;/code&gt; and the maximum &lt;code&gt;1000&lt;/code&gt;.
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 &lt;code&gt;0&lt;/code&gt;.
139
+ # @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of &lt;code&gt;fieldname:(asc|desc)&lt;/code&gt;.
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<(Job, Fixnum, Hash)>] Job data, response status code and response headers
143
+ def get_jobs_with_http_info(opts = {})
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug 'Calling API: JobsApi.get_jobs ...'
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 JobsApi.get_jobs, 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 JobsApi.get_jobs, 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 JobsApi.get_jobs, 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 = '/jobs'
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 => 'Job')
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: JobsApi#get_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+ # List or search humanitarian job offers.
227
+ # <iframe width=\"100%\" height=\"300px\" src=\"http://reliefweb.int/help/api/field-definitions#jobs\"></iframe>
228
+ # @param [Hash] opts the optional parameters
229
+ # @option opts [PostParams] :fields Returned fields
230
+ # @return [Job]
231
+ def search_jobs(opts = {})
232
+ data, _status_code, _headers = search_jobs_with_http_info(opts)
233
+ data
234
+ end
235
+
236
+ # List or search humanitarian job offers.
237
+ # &lt;iframe width&#x3D;\&quot;100%\&quot; height&#x3D;\&quot;300px\&quot; src&#x3D;\&quot;http://reliefweb.int/help/api/field-definitions#jobs\&quot;&gt;&lt;/iframe&gt;
238
+ # @param [Hash] opts the optional parameters
239
+ # @option opts [PostParams] :fields Returned fields
240
+ # @return [Array<(Job, Fixnum, Hash)>] Job data, response status code and response headers
241
+ def search_jobs_with_http_info(opts = {})
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: JobsApi.search_jobs ...'
244
+ end
245
+ # resource path
246
+ local_var_path = '/jobs'
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 => 'Job')
271
+ if @api_client.config.debugging
272
+ @api_client.config.logger.debug "API called: JobsApi#search_jobs\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 ReportsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Find report by its unique ID
23
+ # Individual reports.
24
+ # @param report_id The identifier of the report.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
29
+ # @return [Report]
30
+ def get_report_by_id(report_id, opts = {})
31
+ data, _status_code, _headers = get_report_by_id_with_http_info(report_id, opts)
32
+ data
33
+ end
34
+
35
+ # Find report by its unique ID
36
+ # Individual reports.
37
+ # @param report_id The identifier of the report.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
42
+ # @return [Array<(Report, Fixnum, Hash)>] Report data, response status code and response headers
43
+ def get_report_by_id_with_http_info(report_id, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_report_by_id ...'
46
+ end
47
+ # verify the required parameter 'report_id' is set
48
+ if @api_client.config.client_side_validation && report_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'report_id' when calling ReportsApi.get_report_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 = '/reports/{reportId}'.sub('{' + 'reportId' + '}', report_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 => 'Report')
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: ReportsApi#get_report_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 updates, headlines or maps.
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 &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;range&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt; 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 &lt;code&gt;operator&lt;/code&gt; property). Every condition must contain one of the &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;count&lt;/code&gt; of terms, and ascending or descending. &lt;code&gt;count&lt;/code&gt; defaults to &lt;code&gt;desc&lt;/code&gt;, &lt;code&gt;value&lt;/code&gt; defaults to &lt;code&gt;asc&lt;/code&gt;.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
107
+ # @option opts [Integer] :limit The maximum number of items to return for a list query. The default is &lt;code&gt;10&lt;/code&gt; and the maximum &lt;code&gt;1000&lt;/code&gt;. (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 &lt;code&gt;0&lt;/code&gt;. (default to 0)
109
+ # @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of &lt;code&gt;fieldname:(asc|desc)&lt;/code&gt;.
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 [Report]
113
+ def get_reports(opts = {})
114
+ data, _status_code, _headers = get_reports_with_http_info(opts)
115
+ data
116
+ end
117
+
118
+ # List or search updates, headlines or maps.
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 &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;range&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt; 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 &lt;code&gt;operator&lt;/code&gt; property). Every condition must contain one of the &lt;code&gt;field&lt;/code&gt; or &lt;code&gt;conditions&lt;/code&gt; 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 &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;count&lt;/code&gt; of terms, and ascending or descending. &lt;code&gt;count&lt;/code&gt; defaults to &lt;code&gt;desc&lt;/code&gt;, &lt;code&gt;value&lt;/code&gt; defaults to &lt;code&gt;asc&lt;/code&gt;.
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 &lt;code&gt;date&lt;/code&gt; you may exclude &lt;code&gt;date.changed&lt;/code&gt;.
137
+ # @option opts [Integer] :limit The maximum number of items to return for a list query. The default is &lt;code&gt;10&lt;/code&gt; and the maximum &lt;code&gt;1000&lt;/code&gt;.
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 &lt;code&gt;0&lt;/code&gt;.
139
+ # @option opts [Array<String>] :sort Sort the list results. Defaults to search relevance. Values in the form of &lt;code&gt;fieldname:(asc|desc)&lt;/code&gt;.
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<(Report, Fixnum, Hash)>] Report data, response status code and response headers
143
+ def get_reports_with_http_info(opts = {})
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug 'Calling API: ReportsApi.get_reports ...'
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 ReportsApi.get_reports, 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 ReportsApi.get_reports, 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 ReportsApi.get_reports, 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 = '/reports'
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 => 'Report')
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: ReportsApi#get_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+ # List or search updates, headlines or maps.
227
+ # <div id=\"reports-fields\"></div>
228
+ # @param [Hash] opts the optional parameters
229
+ # @option opts [PostParams] :fields Returned fields
230
+ # @return [Report]
231
+ def search_reports(opts = {})
232
+ data, _status_code, _headers = search_reports_with_http_info(opts)
233
+ data
234
+ end
235
+
236
+ # List or search updates, headlines or maps.
237
+ # &lt;div id&#x3D;\&quot;reports-fields\&quot;&gt;&lt;/div&gt;
238
+ # @param [Hash] opts the optional parameters
239
+ # @option opts [PostParams] :fields Returned fields
240
+ # @return [Array<(Report, Fixnum, Hash)>] Report data, response status code and response headers
241
+ def search_reports_with_http_info(opts = {})
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: ReportsApi.search_reports ...'
244
+ end
245
+ # resource path
246
+ local_var_path = '/reports'
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 => 'Report')
271
+ if @api_client.config.debugging
272
+ @api_client.config.logger.debug "API called: ReportsApi#search_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
273
+ end
274
+ return data, status_code, headers
275
+ end
276
+ end
277
+ end