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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8fd84b5890106a2b99012308694bbdc0b3e09fe0
4
+ data.tar.gz: 45c223e6b281f3ce816212b1eab03525de45743c
5
+ SHA512:
6
+ metadata.gz: 74a52d4c3793c630817418b78773912166062bcdd5e2bfc2046d36166c6a533da562569f619aac005d7cd163055cc944542ab4a4356985d48bdd10f28cc76669
7
+ data.tar.gz: 2355bb3291ff345bffdb7866a3aa8a904c318a48256dbc8b6289a24f002d6fd1f1f9be98f15207bf8bea539fd7993c096061fee3976f89f9f8228959b89c4365
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.3.3'
7
+ end
data/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # reliefweb-api
2
+
3
+ ReliefWebAPI - the Ruby gem for the The ReliefWeb API
4
+
5
+ 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.
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: v1
10
+ - Package version: 1.0.0
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
+ For more information, please visit [https://reliefweb.int/contact](https://reliefweb.int/contact)
13
+
14
+ ## Installation
15
+
16
+ ### Build a gem
17
+
18
+ To build the Ruby code into a gem:
19
+
20
+ ```shell
21
+ gem build reliefweb-api.gemspec
22
+ ```
23
+
24
+ Then either install the gem locally:
25
+
26
+ ```shell
27
+ gem install ./reliefweb-api-1.0.0.gem
28
+ ```
29
+ (for development, run `gem install --dev ./reliefweb-api-1.0.0.gem` to install the development dependencies)
30
+
31
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
+
33
+ Finally add this to the Gemfile:
34
+
35
+ gem 'reliefweb-api', '~> 1.0.0'
36
+
37
+ ### Install from Git
38
+
39
+ If the Ruby gem is hosted at a git repository: https://github.com/sriprasanna/reliefweb-api-ruby-client, then add the following in the Gemfile:
40
+
41
+ gem 'reliefweb-api', :git => 'https://github.com/sriprasanna/reliefweb-api-ruby-client.git'
42
+
43
+ ### Include the Ruby code directly
44
+
45
+ Include the Ruby code directly using `-I` as follows:
46
+
47
+ ```shell
48
+ ruby -Ilib script.rb
49
+ ```
50
+
51
+ ## Getting Started
52
+
53
+ Please follow the [installation](#installation) procedure and then run the following code:
54
+ ```ruby
55
+ # Load the gem
56
+ require 'reliefweb-api'
57
+
58
+ api_instance = ReliefWebAPI::CountriesApi.new
59
+
60
+ opts = {
61
+ query_value: 'query_value_example', # String | Specify the terms of your fuzzy search. The default is no query.
62
+ query_operator: 'query_operator_example', # String | Specify the operator by which your search query words will be combined.
63
+ query_fields: ['query_fields_example'], # Array<String> | Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation.
64
+ filter_field: 'filter_field_example', # String | Field to filter by. Every condition must contain either a <code>field</code> or <code>conditions</code> property.
65
+ filter_value: ['filter_value_example'], # Array<String> | 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.
66
+ filter_operator: 'filter_operator_example', # String | Operator by which filters will be combined.
67
+ filter_negate: true, # BOOLEAN | Reverse the filter to include those items that do not match.
68
+ filter_conditions: ['filter_conditions_example'], # Array<String> | 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.
69
+ facets_field: 'facets_field_example', # String | Field to facet by. May include dates, references or the status field.
70
+ facets_name: 'facets_name_example', # String | Identifier for resulting facet data. Useful when faceting multiple ways on the same field.
71
+ facets_limit: 56, # Integer | Limit the number of facets returned for non-date based facets.
72
+ facets_sort: 'facets_sort_example', # String | 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>.
73
+ facets_filter: ['facets_filter_example'], # Array<String> | Apply all the same capabilities of the filter parameter to the specific results of this facet request.
74
+ facets_interval: 'facets_interval_example', # String | 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.
75
+ fields_include: ['fields_include_example'], # Array<String> | Specify which fields to include for each item. Defaults to an item label.
76
+ fields_exclude: ['fields_exclude_example'] # Array<String> | Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
77
+ limit: 10, # Integer | The maximum number of items to return for a list query. The default is <code>10</code> and the maximum <code>1000</code>.
78
+ offset: 0, # Integer | The offset from which to return the items in a list query. Allows paging through all results. The default is <code>0</code>.
79
+ sort: ['sort_example'], # Array<String> | Sort the list results. Defaults to search relevance. Values in the form of <code>fieldname:(asc|desc)</code>.
80
+ profile: 'profile_example', # String | Pre-built standard selections of fields to return for ease of displaying lists or items.
81
+ preset: 'preset_example' # String | Pre-built standard configurations of queries, filters and sorts for common use cases.
82
+ }
83
+
84
+ begin
85
+ #List or search countries covered by ReliefWeb.
86
+ result = api_instance.get_countries(opts)
87
+ p result
88
+ rescue ReliefWebAPI::ApiError => e
89
+ puts "Exception when calling CountriesApi->get_countries: #{e}"
90
+ end
91
+
92
+ ```
93
+
94
+ ## Documentation for API Endpoints
95
+
96
+ All URIs are relative to *http://api.reliefweb.int/v1*
97
+
98
+ Class | Method | HTTP request | Description
99
+ ------------ | ------------- | ------------- | -------------
100
+ *ReliefWebAPI::CountriesApi* | [**get_countries**](docs/CountriesApi.md#get_countries) | **GET** /countries | List or search countries covered by ReliefWeb.
101
+ *ReliefWebAPI::CountriesApi* | [**get_country_by_id**](docs/CountriesApi.md#get_country_by_id) | **GET** /countries/{countryId} | Find country by its unique ID
102
+ *ReliefWebAPI::CountriesApi* | [**search_countries**](docs/CountriesApi.md#search_countries) | **POST** /countries | List or search countries covered by ReliefWeb.
103
+ *ReliefWebAPI::DisastersApi* | [**get_disaster_by_id**](docs/DisastersApi.md#get_disaster_by_id) | **GET** /disasters/{disasterId} | Find disaster by its unique ID
104
+ *ReliefWebAPI::DisastersApi* | [**get_disasters**](docs/DisastersApi.md#get_disasters) | **GET** /disasters | List or search disasters covered by ReliefWeb.
105
+ *ReliefWebAPI::DisastersApi* | [**search_disasters**](docs/DisastersApi.md#search_disasters) | **POST** /disasters | List or search disasters covered by ReliefWeb.
106
+ *ReliefWebAPI::DiscoveryApi* | [**discovery_resources**](docs/DiscoveryApi.md#discovery_resources) | **GET** / |
107
+ *ReliefWebAPI::DiscoveryApi* | [**discovery_versions**](docs/DiscoveryApi.md#discovery_versions) | **GET** /../ |
108
+ *ReliefWebAPI::JobsApi* | [**get_job_by_id**](docs/JobsApi.md#get_job_by_id) | **GET** /jobs/{jobId} | Find job by its unique ID
109
+ *ReliefWebAPI::JobsApi* | [**get_jobs**](docs/JobsApi.md#get_jobs) | **GET** /jobs | List or search humanitarian job offers.
110
+ *ReliefWebAPI::JobsApi* | [**search_jobs**](docs/JobsApi.md#search_jobs) | **POST** /jobs | List or search humanitarian job offers.
111
+ *ReliefWebAPI::ReportsApi* | [**get_report_by_id**](docs/ReportsApi.md#get_report_by_id) | **GET** /reports/{reportId} | Find report by its unique ID
112
+ *ReliefWebAPI::ReportsApi* | [**get_reports**](docs/ReportsApi.md#get_reports) | **GET** /reports | List or search updates, headlines or maps.
113
+ *ReliefWebAPI::ReportsApi* | [**search_reports**](docs/ReportsApi.md#search_reports) | **POST** /reports | List or search updates, headlines or maps.
114
+ *ReliefWebAPI::SourcesApi* | [**get_source_by_id**](docs/SourcesApi.md#get_source_by_id) | **GET** /sources/{sourceId} | Find source by its unique ID
115
+ *ReliefWebAPI::SourcesApi* | [**get_sources**](docs/SourcesApi.md#get_sources) | **GET** /sources | List or search organizations providing content to ReliefWeb.
116
+ *ReliefWebAPI::SourcesApi* | [**search_sources**](docs/SourcesApi.md#search_sources) | **POST** /sources | List or search organizations providing content to ReliefWeb.
117
+ *ReliefWebAPI::TrainingApi* | [**get_training**](docs/TrainingApi.md#get_training) | **GET** /training | List or search humanitarian learning opportunities.
118
+ *ReliefWebAPI::TrainingApi* | [**get_training_by_id**](docs/TrainingApi.md#get_training_by_id) | **GET** /training/{trainingId} | Find training by its unique ID
119
+ *ReliefWebAPI::TrainingApi* | [**search_training**](docs/TrainingApi.md#search_training) | **POST** /training | List or search humanitarian learning opportunities.
120
+
121
+
122
+ ## Documentation for Models
123
+
124
+ - [ReliefWebAPI::Category](docs/Category.md)
125
+ - [ReliefWebAPI::Country](docs/Country.md)
126
+ - [ReliefWebAPI::Date](docs/Date.md)
127
+ - [ReliefWebAPI::Disaster](docs/Disaster.md)
128
+ - [ReliefWebAPI::Error](docs/Error.md)
129
+ - [ReliefWebAPI::ErrorDefinition](docs/ErrorDefinition.md)
130
+ - [ReliefWebAPI::FacetsFieldPost](docs/FacetsFieldPost.md)
131
+ - [ReliefWebAPI::FacetsFilterPost](docs/FacetsFilterPost.md)
132
+ - [ReliefWebAPI::FacetsIntervalPost](docs/FacetsIntervalPost.md)
133
+ - [ReliefWebAPI::FacetsLimitPost](docs/FacetsLimitPost.md)
134
+ - [ReliefWebAPI::FacetsNamePost](docs/FacetsNamePost.md)
135
+ - [ReliefWebAPI::FacetsSortPost](docs/FacetsSortPost.md)
136
+ - [ReliefWebAPI::FieldsExcludePost](docs/FieldsExcludePost.md)
137
+ - [ReliefWebAPI::FieldsIncludePost](docs/FieldsIncludePost.md)
138
+ - [ReliefWebAPI::File](docs/File.md)
139
+ - [ReliefWebAPI::FilterConditionsPost](docs/FilterConditionsPost.md)
140
+ - [ReliefWebAPI::FilterFieldPost](docs/FilterFieldPost.md)
141
+ - [ReliefWebAPI::FilterNegatePost](docs/FilterNegatePost.md)
142
+ - [ReliefWebAPI::FilterOperatorPost](docs/FilterOperatorPost.md)
143
+ - [ReliefWebAPI::FilterValuePost](docs/FilterValuePost.md)
144
+ - [ReliefWebAPI::Job](docs/Job.md)
145
+ - [ReliefWebAPI::Language](docs/Language.md)
146
+ - [ReliefWebAPI::LimitPost](docs/LimitPost.md)
147
+ - [ReliefWebAPI::Location](docs/Location.md)
148
+ - [ReliefWebAPI::OffsetPost](docs/OffsetPost.md)
149
+ - [ReliefWebAPI::PostParams](docs/PostParams.md)
150
+ - [ReliefWebAPI::PresetPost](docs/PresetPost.md)
151
+ - [ReliefWebAPI::ProfilePost](docs/ProfilePost.md)
152
+ - [ReliefWebAPI::QueryFieldsPost](docs/QueryFieldsPost.md)
153
+ - [ReliefWebAPI::QueryOperatorPost](docs/QueryOperatorPost.md)
154
+ - [ReliefWebAPI::QueryValuePost](docs/QueryValuePost.md)
155
+ - [ReliefWebAPI::Report](docs/Report.md)
156
+ - [ReliefWebAPI::SortPost](docs/SortPost.md)
157
+ - [ReliefWebAPI::Source](docs/Source.md)
158
+ - [ReliefWebAPI::Training](docs/Training.md)
159
+
160
+
161
+ ## Documentation for Authorization
162
+
163
+ All endpoints do not require authorization.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
data/config.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "gemName": "reliefweb-api",
3
+ "moduleName": "ReliefWebAPI",
4
+ "gemVersion": "1.0.0",
5
+ "gemLicense": "MIT",
6
+ "gemHomepage": "https://apidoc.rwlabs.org/",
7
+ "gemAuthor": "Sri Prasanna Karuppapillai"
8
+ }
data/docs/Category.md ADDED
@@ -0,0 +1,9 @@
1
+ # ReliefWebAPI::Category
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | | [optional]
7
+ **name** | **String** | | [optional]
8
+
9
+
@@ -0,0 +1,202 @@
1
+ # ReliefWebAPI::CountriesApi
2
+
3
+ All URIs are relative to *http://api.reliefweb.int/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_countries**](CountriesApi.md#get_countries) | **GET** /countries | List or search countries covered by ReliefWeb.
8
+ [**get_country_by_id**](CountriesApi.md#get_country_by_id) | **GET** /countries/{countryId} | Find country by its unique ID
9
+ [**search_countries**](CountriesApi.md#search_countries) | **POST** /countries | List or search countries covered by ReliefWeb.
10
+
11
+
12
+ # **get_countries**
13
+ > Country get_countries(opts)
14
+
15
+ List or search countries covered by ReliefWeb.
16
+
17
+
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'reliefweb-api'
23
+
24
+ api_instance = ReliefWebAPI::CountriesApi.new
25
+
26
+ opts = {
27
+ query_value: 'query_value_example', # String | Specify the terms of your fuzzy search. The default is no query.
28
+ query_operator: 'query_operator_example', # String | Specify the operator by which your search query words will be combined.
29
+ query_fields: ['query_fields_example'], # Array<String> | Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation.
30
+ filter_field: 'filter_field_example', # String | Field to filter by. Every condition must contain either a <code>field</code> or <code>conditions</code> property.
31
+ filter_value: ['filter_value_example'], # Array<String> | 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.
32
+ filter_operator: 'filter_operator_example', # String | Operator by which filters will be combined.
33
+ filter_negate: true, # BOOLEAN | Reverse the filter to include those items that do not match.
34
+ filter_conditions: ['filter_conditions_example'], # Array<String> | 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.
35
+ facets_field: 'facets_field_example', # String | Field to facet by. May include dates, references or the status field.
36
+ facets_name: 'facets_name_example', # String | Identifier for resulting facet data. Useful when faceting multiple ways on the same field.
37
+ facets_limit: 56, # Integer | Limit the number of facets returned for non-date based facets.
38
+ facets_sort: 'facets_sort_example', # String | 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>.
39
+ facets_filter: ['facets_filter_example'], # Array<String> | Apply all the same capabilities of the filter parameter to the specific results of this facet request.
40
+ facets_interval: 'facets_interval_example', # String | 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.
41
+ fields_include: ['fields_include_example'], # Array<String> | Specify which fields to include for each item. Defaults to an item label.
42
+ fields_exclude: ['fields_exclude_example'] # Array<String> | Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
43
+ limit: 10, # Integer | The maximum number of items to return for a list query. The default is <code>10</code> and the maximum <code>1000</code>.
44
+ offset: 0, # Integer | The offset from which to return the items in a list query. Allows paging through all results. The default is <code>0</code>.
45
+ sort: ['sort_example'], # Array<String> | Sort the list results. Defaults to search relevance. Values in the form of <code>fieldname:(asc|desc)</code>.
46
+ profile: 'profile_example', # String | Pre-built standard selections of fields to return for ease of displaying lists or items.
47
+ preset: 'preset_example' # String | Pre-built standard configurations of queries, filters and sorts for common use cases.
48
+ }
49
+
50
+ begin
51
+ #List or search countries covered by ReliefWeb.
52
+ result = api_instance.get_countries(opts)
53
+ p result
54
+ rescue ReliefWebAPI::ApiError => e
55
+ puts "Exception when calling CountriesApi->get_countries: #{e}"
56
+ end
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ Name | Type | Description | Notes
62
+ ------------- | ------------- | ------------- | -------------
63
+ **query_value** | **String**| Specify the terms of your fuzzy search. The default is no query. | [optional]
64
+ **query_operator** | **String**| Specify the operator by which your search query words will be combined. | [optional]
65
+ **query_fields** | [**Array&lt;String&gt;**](String.md)| Specify which fields to target with your search. You may use boost syntax here, see the Advanced API Usage documentation. | [optional]
66
+ **filter_field** | **String**| 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. | [optional]
67
+ **filter_value** | [**Array&lt;String&gt;**](String.md)| 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. | [optional]
68
+ **filter_operator** | **String**| Operator by which filters will be combined. | [optional]
69
+ **filter_negate** | **BOOLEAN**| Reverse the filter to include those items that do not match. | [optional]
70
+ **filter_conditions** | [**Array&lt;String&gt;**](String.md)| 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. | [optional]
71
+ **facets_field** | **String**| Field to facet by. May include dates, references or the status field. | [optional]
72
+ **facets_name** | **String**| Identifier for resulting facet data. Useful when faceting multiple ways on the same field. | [optional]
73
+ **facets_limit** | **Integer**| Limit the number of facets returned for non-date based facets. | [optional]
74
+ **facets_sort** | **String**| 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;. | [optional]
75
+ **facets_filter** | [**Array&lt;String&gt;**](String.md)| Apply all the same capabilities of the filter parameter to the specific results of this facet request. | [optional]
76
+ **facets_interval** | **String**| 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. | [optional]
77
+ **fields_include** | [**Array&lt;String&gt;**](String.md)| Specify which fields to include for each item. Defaults to an item label. | [optional]
78
+ **fields_exclude** | [**Array&lt;String&gt;**](String.md)| 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;. | [optional]
79
+ **limit** | **Integer**| 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;. | [optional] [default to 10]
80
+ **offset** | **Integer**| 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;. | [optional] [default to 0]
81
+ **sort** | [**Array&lt;String&gt;**](String.md)| Sort the list results. Defaults to search relevance. Values in the form of &lt;code&gt;fieldname:(asc|desc)&lt;/code&gt;. | [optional]
82
+ **profile** | **String**| Pre-built standard selections of fields to return for ease of displaying lists or items. | [optional]
83
+ **preset** | **String**| Pre-built standard configurations of queries, filters and sorts for common use cases. | [optional]
84
+
85
+ ### Return type
86
+
87
+ [**Country**](Country.md)
88
+
89
+ ### Authorization
90
+
91
+ No authorization required
92
+
93
+ ### HTTP request headers
94
+
95
+ - **Content-Type**: text/plain; charset=utf-8
96
+ - **Accept**: application/json
97
+
98
+
99
+
100
+ # **get_country_by_id**
101
+ > Country get_country_by_id(country_id, opts)
102
+
103
+ Find country by its unique ID
104
+
105
+ Individual countries
106
+
107
+ ### Example
108
+ ```ruby
109
+ # load the gem
110
+ require 'reliefweb-api'
111
+
112
+ api_instance = ReliefWebAPI::CountriesApi.new
113
+
114
+ country_id = 'country_id_example' # String | The identifier of the country
115
+
116
+ opts = {
117
+ profile: 'profile_example', # String | Pre-built standard selections of fields to return for ease of displaying lists or items.
118
+ fields_include: ['fields_include_example'], # Array<String> | Specify which fields to include for each item. Defaults to an item label.
119
+ fields_exclude: ['fields_exclude_example'] # Array<String> | Specify sub-fields to exclude from overall results. For example, if you include <code>date</code> you may exclude <code>date.changed</code>.
120
+ }
121
+
122
+ begin
123
+ #Find country by its unique ID
124
+ result = api_instance.get_country_by_id(country_id, opts)
125
+ p result
126
+ rescue ReliefWebAPI::ApiError => e
127
+ puts "Exception when calling CountriesApi->get_country_by_id: #{e}"
128
+ end
129
+ ```
130
+
131
+ ### Parameters
132
+
133
+ Name | Type | Description | Notes
134
+ ------------- | ------------- | ------------- | -------------
135
+ **country_id** | **String**| The identifier of the country |
136
+ **profile** | **String**| Pre-built standard selections of fields to return for ease of displaying lists or items. | [optional]
137
+ **fields_include** | [**Array&lt;String&gt;**](String.md)| Specify which fields to include for each item. Defaults to an item label. | [optional]
138
+ **fields_exclude** | [**Array&lt;String&gt;**](String.md)| 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;. | [optional]
139
+
140
+ ### Return type
141
+
142
+ [**Country**](Country.md)
143
+
144
+ ### Authorization
145
+
146
+ No authorization required
147
+
148
+ ### HTTP request headers
149
+
150
+ - **Content-Type**: text/plain; charset=utf-8, application/json
151
+ - **Accept**: application/json
152
+
153
+
154
+
155
+ # **search_countries**
156
+ > Country search_countries(opts)
157
+
158
+ List or search countries covered by ReliefWeb.
159
+
160
+
161
+
162
+ ### Example
163
+ ```ruby
164
+ # load the gem
165
+ require 'reliefweb-api'
166
+
167
+ api_instance = ReliefWebAPI::CountriesApi.new
168
+
169
+ opts = {
170
+ fields: ReliefWebAPI::PostParams.new # PostParams | Returned fields
171
+ }
172
+
173
+ begin
174
+ #List or search countries covered by ReliefWeb.
175
+ result = api_instance.search_countries(opts)
176
+ p result
177
+ rescue ReliefWebAPI::ApiError => e
178
+ puts "Exception when calling CountriesApi->search_countries: #{e}"
179
+ end
180
+ ```
181
+
182
+ ### Parameters
183
+
184
+ Name | Type | Description | Notes
185
+ ------------- | ------------- | ------------- | -------------
186
+ **fields** | [**PostParams**](PostParams.md)| Returned fields | [optional]
187
+
188
+ ### Return type
189
+
190
+ [**Country**](Country.md)
191
+
192
+ ### Authorization
193
+
194
+ No authorization required
195
+
196
+ ### HTTP request headers
197
+
198
+ - **Content-Type**: application/json
199
+ - **Accept**: application/json
200
+
201
+
202
+
data/docs/Country.md ADDED
@@ -0,0 +1,12 @@
1
+ # ReliefWebAPI::Country
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | | [optional]
7
+ **iso3** | **String** | | [optional]
8
+ **name** | **String** | | [optional]
9
+ **primary** | **BOOLEAN** | | [optional]
10
+ **shortname** | **String** | | [optional]
11
+
12
+
data/docs/Date.md ADDED
@@ -0,0 +1,10 @@
1
+ # ReliefWebAPI::Date
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **changed** | **String** | | [optional]
7
+ **created** | **String** | | [optional]
8
+ **original** | **String** | | [optional]
9
+
10
+
data/docs/Disaster.md ADDED
@@ -0,0 +1,20 @@
1
+ # ReliefWebAPI::Disaster
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **category** | [**Array&lt;Category&gt;**](Category.md) | | [optional]
7
+ **category_primary** | [**Category**](Category.md) | | [optional]
8
+ **country** | [**Array&lt;Country&gt;**](Country.md) | Countries impacted by this disaster. | [optional]
9
+ **current** | **BOOLEAN** | Ongoing disaster | [optional]
10
+ **description** | **String** | | [optional]
11
+ **description_html** | **String** | | [optional]
12
+ **featured** | **BOOLEAN** | Receiving special attention. | [optional]
13
+ **glide** | **String** | [Glide number](http://glidenumber.net) | [optional]
14
+ **id** | **Integer** | | [optional]
15
+ **link** | **String** | | [optional]
16
+ **name** | **String** | | [optional]
17
+ **primary_country** | [**Country**](Country.md) | | [optional]
18
+ **type** | **String** | | [optional]
19
+
20
+