scrapebadger 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +548 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +76 -0
- data/docs/AccountInfo.md +28 -0
- data/docs/AmazonApi.md +1244 -0
- data/docs/ApartmentsApi.md +373 -0
- data/docs/BaiduApi.md +447 -0
- data/docs/BillingLogListResponse.md +24 -0
- data/docs/BillingLogResponse.md +32 -0
- data/docs/BingApi.md +610 -0
- data/docs/ChatGPTApi.md +521 -0
- data/docs/DepopApi.md +542 -0
- data/docs/DuckDuckGoApi.md +700 -0
- data/docs/EBayApi.md +1019 -0
- data/docs/FacebookApi.md +1671 -0
- data/docs/FilterRuleCreate.md +28 -0
- data/docs/FilterRuleDeliveryLogListResponse.md +24 -0
- data/docs/FilterRuleDeliveryLogResponse.md +44 -0
- data/docs/FilterRuleListResponse.md +24 -0
- data/docs/FilterRuleResponse.md +40 -0
- data/docs/FilterRuleUpdate.md +30 -0
- data/docs/FilterRuleValidateRequest.md +18 -0
- data/docs/FilterRuleValidateResponse.md +22 -0
- data/docs/GoogleApi.md +3175 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/IdealistaApi.md +822 -0
- data/docs/ImmobiliareApi.md +773 -0
- data/docs/InstagramApi.md +1673 -0
- data/docs/LeboncoinApi.md +884 -0
- data/docs/LinkedInApi.md +925 -0
- data/docs/LoopNetApi.md +529 -0
- data/docs/PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse.md +20 -0
- data/docs/RealtorApi.md +474 -0
- data/docs/RedditApi.md +1677 -0
- data/docs/RedfinApi.md +616 -0
- data/docs/StreamMonitorCreate.md +26 -0
- data/docs/StreamMonitorListResponse.md +24 -0
- data/docs/StreamMonitorResponse.md +42 -0
- data/docs/StreamMonitorUpdate.md +28 -0
- data/docs/SubscriptionInfo.md +40 -0
- data/docs/TikTokApi.md +2104 -0
- data/docs/TweetDeliveryLogListResponse.md +24 -0
- data/docs/TweetDeliveryLogResponse.md +44 -0
- data/docs/TwitterApi.md +4091 -0
- data/docs/ValidationError.md +22 -0
- data/docs/ValidationErrorLocInner.md +15 -0
- data/docs/VintedApi.md +766 -0
- data/docs/WalmartApi.md +904 -0
- data/docs/WebApi.md +634 -0
- data/docs/WebhookCreate.md +22 -0
- data/docs/WebhookListItem.md +28 -0
- data/docs/WebhookListResponse.md +20 -0
- data/docs/WebhookResponse.md +26 -0
- data/docs/WebhookTestRequest.md +18 -0
- data/docs/WebhookTestResponse.md +24 -0
- data/docs/YahooApi.md +602 -0
- data/docs/YandexApi.md +450 -0
- data/docs/YouTubeApi.md +2872 -0
- data/docs/ZillowApi.md +622 -0
- data/git_push.sh +57 -0
- data/lib/scrapebadger/api/account_api.rb +79 -0
- data/lib/scrapebadger/api/amazon_api.rb +1165 -0
- data/lib/scrapebadger/api/apartments_api.rb +377 -0
- data/lib/scrapebadger/api/baidu_api.rb +436 -0
- data/lib/scrapebadger/api/bing_api.rb +580 -0
- data/lib/scrapebadger/api/chat_gpt_api.rb +466 -0
- data/lib/scrapebadger/api/depop_api.rb +518 -0
- data/lib/scrapebadger/api/duck_duck_go_api.rb +675 -0
- data/lib/scrapebadger/api/e_bay_api.rb +1029 -0
- data/lib/scrapebadger/api/facebook_api.rb +1492 -0
- data/lib/scrapebadger/api/google_api.rb +3191 -0
- data/lib/scrapebadger/api/idealista_api.rb +864 -0
- data/lib/scrapebadger/api/immobiliare_api.rb +734 -0
- data/lib/scrapebadger/api/instagram_api.rb +1555 -0
- data/lib/scrapebadger/api/leboncoin_api.rb +818 -0
- data/lib/scrapebadger/api/linked_in_api.rb +832 -0
- data/lib/scrapebadger/api/loop_net_api.rb +503 -0
- data/lib/scrapebadger/api/realtor_api.rb +481 -0
- data/lib/scrapebadger/api/reddit_api.rb +1601 -0
- data/lib/scrapebadger/api/redfin_api.rb +625 -0
- data/lib/scrapebadger/api/tik_tok_api.rb +2029 -0
- data/lib/scrapebadger/api/twitter_api.rb +3696 -0
- data/lib/scrapebadger/api/vinted_api.rb +705 -0
- data/lib/scrapebadger/api/walmart_api.rb +876 -0
- data/lib/scrapebadger/api/web_api.rb +547 -0
- data/lib/scrapebadger/api/yahoo_api.rb +560 -0
- data/lib/scrapebadger/api/yandex_api.rb +422 -0
- data/lib/scrapebadger/api/you_tube_api.rb +2520 -0
- data/lib/scrapebadger/api/zillow_api.rb +634 -0
- data/lib/scrapebadger/api_client.rb +394 -0
- data/lib/scrapebadger/api_error.rb +58 -0
- data/lib/scrapebadger/configuration.rb +308 -0
- data/lib/scrapebadger/models/account_info.rb +288 -0
- data/lib/scrapebadger/models/billing_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/billing_log_response.rb +334 -0
- data/lib/scrapebadger/models/filter_rule_create.rb +427 -0
- data/lib/scrapebadger/models/filter_rule_delivery_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/filter_rule_delivery_log_response.rb +422 -0
- data/lib/scrapebadger/models/filter_rule_list_response.rb +272 -0
- data/lib/scrapebadger/models/filter_rule_response.rb +390 -0
- data/lib/scrapebadger/models/filter_rule_update.rb +389 -0
- data/lib/scrapebadger/models/filter_rule_validate_request.rb +250 -0
- data/lib/scrapebadger/models/filter_rule_validate_response.rb +248 -0
- data/lib/scrapebadger/models/http_validation_error.rb +216 -0
- data/lib/scrapebadger/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response.rb +238 -0
- data/lib/scrapebadger/models/stream_monitor_create.rb +373 -0
- data/lib/scrapebadger/models/stream_monitor_list_response.rb +272 -0
- data/lib/scrapebadger/models/stream_monitor_response.rb +406 -0
- data/lib/scrapebadger/models/stream_monitor_update.rb +335 -0
- data/lib/scrapebadger/models/subscription_info.rb +352 -0
- data/lib/scrapebadger/models/tweet_delivery_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/tweet_delivery_log_response.rb +422 -0
- data/lib/scrapebadger/models/validation_error.rb +255 -0
- data/lib/scrapebadger/models/validation_error_loc_inner.rb +104 -0
- data/lib/scrapebadger/models/webhook_create.rb +282 -0
- data/lib/scrapebadger/models/webhook_list_item.rb +302 -0
- data/lib/scrapebadger/models/webhook_list_response.rb +240 -0
- data/lib/scrapebadger/models/webhook_response.rb +286 -0
- data/lib/scrapebadger/models/webhook_test_request.rb +223 -0
- data/lib/scrapebadger/models/webhook_test_response.rb +259 -0
- data/lib/scrapebadger/version.rb +15 -0
- data/lib/scrapebadger.rb +96 -0
- data/scrapebadger.gemspec +39 -0
- data/spec/api/account_api_spec.rb +46 -0
- data/spec/api/amazon_api_spec.rb +258 -0
- data/spec/api/apartments_api_spec.rb +98 -0
- data/spec/api/baidu_api_spec.rb +109 -0
- data/spec/api/bing_api_spec.rb +141 -0
- data/spec/api/chat_gpt_api_spec.rb +123 -0
- data/spec/api/depop_api_spec.rb +132 -0
- data/spec/api/duck_duck_go_api_spec.rb +162 -0
- data/spec/api/e_bay_api_spec.rb +222 -0
- data/spec/api/facebook_api_spec.rb +326 -0
- data/spec/api/google_api_spec.rb +649 -0
- data/spec/api/idealista_api_spec.rb +197 -0
- data/spec/api/immobiliare_api_spec.rb +174 -0
- data/spec/api/instagram_api_spec.rb +309 -0
- data/spec/api/leboncoin_api_spec.rb +184 -0
- data/spec/api/linked_in_api_spec.rb +197 -0
- data/spec/api/loop_net_api_spec.rb +127 -0
- data/spec/api/realtor_api_spec.rb +123 -0
- data/spec/api/reddit_api_spec.rb +331 -0
- data/spec/api/redfin_api_spec.rb +147 -0
- data/spec/api/tik_tok_api_spec.rb +413 -0
- data/spec/api/twitter_api_spec.rb +735 -0
- data/spec/api/vinted_api_spec.rb +169 -0
- data/spec/api/walmart_api_spec.rb +192 -0
- data/spec/api/web_api_spec.rb +136 -0
- data/spec/api/yahoo_api_spec.rb +137 -0
- data/spec/api/yandex_api_spec.rb +111 -0
- data/spec/api/you_tube_api_spec.rb +500 -0
- data/spec/api/zillow_api_spec.rb +150 -0
- data/spec/models/account_info_spec.rb +66 -0
- data/spec/models/billing_log_list_response_spec.rb +54 -0
- data/spec/models/billing_log_response_spec.rb +78 -0
- data/spec/models/filter_rule_create_spec.rb +66 -0
- data/spec/models/filter_rule_delivery_log_list_response_spec.rb +54 -0
- data/spec/models/filter_rule_delivery_log_response_spec.rb +114 -0
- data/spec/models/filter_rule_list_response_spec.rb +54 -0
- data/spec/models/filter_rule_response_spec.rb +102 -0
- data/spec/models/filter_rule_update_spec.rb +72 -0
- data/spec/models/filter_rule_validate_request_spec.rb +36 -0
- data/spec/models/filter_rule_validate_response_spec.rb +48 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response_spec.rb +42 -0
- data/spec/models/stream_monitor_create_spec.rb +60 -0
- data/spec/models/stream_monitor_list_response_spec.rb +54 -0
- data/spec/models/stream_monitor_response_spec.rb +108 -0
- data/spec/models/stream_monitor_update_spec.rb +66 -0
- data/spec/models/subscription_info_spec.rb +102 -0
- data/spec/models/tweet_delivery_log_list_response_spec.rb +54 -0
- data/spec/models/tweet_delivery_log_response_spec.rb +114 -0
- data/spec/models/validation_error_loc_inner_spec.rb +21 -0
- data/spec/models/validation_error_spec.rb +48 -0
- data/spec/models/webhook_create_spec.rb +48 -0
- data/spec/models/webhook_list_item_spec.rb +66 -0
- data/spec/models/webhook_list_response_spec.rb +42 -0
- data/spec/models/webhook_response_spec.rb +60 -0
- data/spec/models/webhook_test_request_spec.rb +36 -0
- data/spec/models/webhook_test_response_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +324 -0
|
@@ -0,0 +1,1601 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ScrapeBadger API
|
|
3
|
+
|
|
4
|
+
#Unified credit-based scraping API. https://docs.scrapebadger.com
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module ScrapeBadger
|
|
16
|
+
class RedditApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get cross-posts
|
|
23
|
+
# Get cross-posts and duplicates of a Reddit post.
|
|
24
|
+
# @param post_id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [Integer] :limit (default to 25)
|
|
27
|
+
# @option opts [String] :after
|
|
28
|
+
# @return [Object]
|
|
29
|
+
def reddit_get_cross_posts(post_id, opts = {})
|
|
30
|
+
data, _status_code, _headers = reddit_get_cross_posts_with_http_info(post_id, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Get cross-posts
|
|
35
|
+
# Get cross-posts and duplicates of a Reddit post.
|
|
36
|
+
# @param post_id [String]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [Integer] :limit (default to 25)
|
|
39
|
+
# @option opts [String] :after
|
|
40
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
41
|
+
def reddit_get_cross_posts_with_http_info(post_id, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_cross_posts ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'post_id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && post_id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'post_id' when calling RedditApi.reddit_get_cross_posts"
|
|
48
|
+
end
|
|
49
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
50
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_cross_posts, must be smaller than or equal to 100.'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
54
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_cross_posts, must be greater than or equal to 1.'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# resource path
|
|
58
|
+
local_var_path = '/v1/reddit/posts/{post_id}/duplicates'.sub('{' + 'post_id' + '}', CGI.escape(post_id.to_s))
|
|
59
|
+
|
|
60
|
+
# query parameters
|
|
61
|
+
query_params = opts[:query_params] || {}
|
|
62
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
63
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
64
|
+
|
|
65
|
+
# header parameters
|
|
66
|
+
header_params = opts[:header_params] || {}
|
|
67
|
+
# HTTP header 'Accept' (if needed)
|
|
68
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
69
|
+
|
|
70
|
+
# form parameters
|
|
71
|
+
form_params = opts[:form_params] || {}
|
|
72
|
+
|
|
73
|
+
# http body (model)
|
|
74
|
+
post_body = opts[:debug_body]
|
|
75
|
+
|
|
76
|
+
# return_type
|
|
77
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
78
|
+
|
|
79
|
+
# auth_names
|
|
80
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
81
|
+
|
|
82
|
+
new_options = opts.merge(
|
|
83
|
+
:operation => :"RedditApi.reddit_get_cross_posts",
|
|
84
|
+
:header_params => header_params,
|
|
85
|
+
:query_params => query_params,
|
|
86
|
+
:form_params => form_params,
|
|
87
|
+
:body => post_body,
|
|
88
|
+
:auth_names => auth_names,
|
|
89
|
+
:return_type => return_type
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_cross_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
95
|
+
end
|
|
96
|
+
return data, status_code, headers
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Get post comments
|
|
100
|
+
# Get comment tree for a Reddit post.
|
|
101
|
+
# @param post_id [String]
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @option opts [String] :sort Sort: confidence, top, new, controversial, old, qa (default to 'confidence')
|
|
104
|
+
# @option opts [Integer] :limit (default to 25)
|
|
105
|
+
# @option opts [Integer] :depth
|
|
106
|
+
# @return [Object]
|
|
107
|
+
def reddit_get_post_comments(post_id, opts = {})
|
|
108
|
+
data, _status_code, _headers = reddit_get_post_comments_with_http_info(post_id, opts)
|
|
109
|
+
data
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Get post comments
|
|
113
|
+
# Get comment tree for a Reddit post.
|
|
114
|
+
# @param post_id [String]
|
|
115
|
+
# @param [Hash] opts the optional parameters
|
|
116
|
+
# @option opts [String] :sort Sort: confidence, top, new, controversial, old, qa (default to 'confidence')
|
|
117
|
+
# @option opts [Integer] :limit (default to 25)
|
|
118
|
+
# @option opts [Integer] :depth
|
|
119
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
120
|
+
def reddit_get_post_comments_with_http_info(post_id, opts = {})
|
|
121
|
+
if @api_client.config.debugging
|
|
122
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_post_comments ...'
|
|
123
|
+
end
|
|
124
|
+
# verify the required parameter 'post_id' is set
|
|
125
|
+
if @api_client.config.client_side_validation && post_id.nil?
|
|
126
|
+
fail ArgumentError, "Missing the required parameter 'post_id' when calling RedditApi.reddit_get_post_comments"
|
|
127
|
+
end
|
|
128
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
129
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_post_comments, must be smaller than or equal to 100.'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
133
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_post_comments, must be greater than or equal to 1.'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
|
|
137
|
+
fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling RedditApi.reddit_get_post_comments, must be smaller than or equal to 10.'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
|
|
141
|
+
fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling RedditApi.reddit_get_post_comments, must be greater than or equal to 0.'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# resource path
|
|
145
|
+
local_var_path = '/v1/reddit/posts/{post_id}/comments'.sub('{' + 'post_id' + '}', CGI.escape(post_id.to_s))
|
|
146
|
+
|
|
147
|
+
# query parameters
|
|
148
|
+
query_params = opts[:query_params] || {}
|
|
149
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
150
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
151
|
+
query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
|
|
152
|
+
|
|
153
|
+
# header parameters
|
|
154
|
+
header_params = opts[:header_params] || {}
|
|
155
|
+
# HTTP header 'Accept' (if needed)
|
|
156
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
157
|
+
|
|
158
|
+
# form parameters
|
|
159
|
+
form_params = opts[:form_params] || {}
|
|
160
|
+
|
|
161
|
+
# http body (model)
|
|
162
|
+
post_body = opts[:debug_body]
|
|
163
|
+
|
|
164
|
+
# return_type
|
|
165
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
166
|
+
|
|
167
|
+
# auth_names
|
|
168
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
169
|
+
|
|
170
|
+
new_options = opts.merge(
|
|
171
|
+
:operation => :"RedditApi.reddit_get_post_comments",
|
|
172
|
+
:header_params => header_params,
|
|
173
|
+
:query_params => query_params,
|
|
174
|
+
:form_params => form_params,
|
|
175
|
+
:body => post_body,
|
|
176
|
+
:auth_names => auth_names,
|
|
177
|
+
:return_type => return_type
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
181
|
+
if @api_client.config.debugging
|
|
182
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_post_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
183
|
+
end
|
|
184
|
+
return data, status_code, headers
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Get post detail
|
|
188
|
+
# Get detailed information about a Reddit post.
|
|
189
|
+
# @param post_id [String]
|
|
190
|
+
# @param [Hash] opts the optional parameters
|
|
191
|
+
# @return [Object]
|
|
192
|
+
def reddit_get_post_detail(post_id, opts = {})
|
|
193
|
+
data, _status_code, _headers = reddit_get_post_detail_with_http_info(post_id, opts)
|
|
194
|
+
data
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Get post detail
|
|
198
|
+
# Get detailed information about a Reddit post.
|
|
199
|
+
# @param post_id [String]
|
|
200
|
+
# @param [Hash] opts the optional parameters
|
|
201
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
202
|
+
def reddit_get_post_detail_with_http_info(post_id, opts = {})
|
|
203
|
+
if @api_client.config.debugging
|
|
204
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_post_detail ...'
|
|
205
|
+
end
|
|
206
|
+
# verify the required parameter 'post_id' is set
|
|
207
|
+
if @api_client.config.client_side_validation && post_id.nil?
|
|
208
|
+
fail ArgumentError, "Missing the required parameter 'post_id' when calling RedditApi.reddit_get_post_detail"
|
|
209
|
+
end
|
|
210
|
+
# resource path
|
|
211
|
+
local_var_path = '/v1/reddit/posts/{post_id}'.sub('{' + 'post_id' + '}', CGI.escape(post_id.to_s))
|
|
212
|
+
|
|
213
|
+
# query parameters
|
|
214
|
+
query_params = opts[:query_params] || {}
|
|
215
|
+
|
|
216
|
+
# header parameters
|
|
217
|
+
header_params = opts[:header_params] || {}
|
|
218
|
+
# HTTP header 'Accept' (if needed)
|
|
219
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
220
|
+
|
|
221
|
+
# form parameters
|
|
222
|
+
form_params = opts[:form_params] || {}
|
|
223
|
+
|
|
224
|
+
# http body (model)
|
|
225
|
+
post_body = opts[:debug_body]
|
|
226
|
+
|
|
227
|
+
# return_type
|
|
228
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
229
|
+
|
|
230
|
+
# auth_names
|
|
231
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
232
|
+
|
|
233
|
+
new_options = opts.merge(
|
|
234
|
+
:operation => :"RedditApi.reddit_get_post_detail",
|
|
235
|
+
:header_params => header_params,
|
|
236
|
+
:query_params => query_params,
|
|
237
|
+
:form_params => form_params,
|
|
238
|
+
:body => post_body,
|
|
239
|
+
:auth_names => auth_names,
|
|
240
|
+
:return_type => return_type
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
244
|
+
if @api_client.config.debugging
|
|
245
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_post_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
246
|
+
end
|
|
247
|
+
return data, status_code, headers
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Get posts by domain
|
|
251
|
+
# Get Reddit posts linking to a specific domain.
|
|
252
|
+
# @param domain [String]
|
|
253
|
+
# @param [Hash] opts the optional parameters
|
|
254
|
+
# @option opts [String] :sort (default to 'hot')
|
|
255
|
+
# @option opts [String] :t (default to 'all')
|
|
256
|
+
# @option opts [Integer] :limit (default to 25)
|
|
257
|
+
# @option opts [String] :after
|
|
258
|
+
# @return [Object]
|
|
259
|
+
def reddit_get_posts_by_domain(domain, opts = {})
|
|
260
|
+
data, _status_code, _headers = reddit_get_posts_by_domain_with_http_info(domain, opts)
|
|
261
|
+
data
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Get posts by domain
|
|
265
|
+
# Get Reddit posts linking to a specific domain.
|
|
266
|
+
# @param domain [String]
|
|
267
|
+
# @param [Hash] opts the optional parameters
|
|
268
|
+
# @option opts [String] :sort (default to 'hot')
|
|
269
|
+
# @option opts [String] :t (default to 'all')
|
|
270
|
+
# @option opts [Integer] :limit (default to 25)
|
|
271
|
+
# @option opts [String] :after
|
|
272
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
273
|
+
def reddit_get_posts_by_domain_with_http_info(domain, opts = {})
|
|
274
|
+
if @api_client.config.debugging
|
|
275
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_posts_by_domain ...'
|
|
276
|
+
end
|
|
277
|
+
# verify the required parameter 'domain' is set
|
|
278
|
+
if @api_client.config.client_side_validation && domain.nil?
|
|
279
|
+
fail ArgumentError, "Missing the required parameter 'domain' when calling RedditApi.reddit_get_posts_by_domain"
|
|
280
|
+
end
|
|
281
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
282
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_posts_by_domain, must be smaller than or equal to 100.'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
286
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_posts_by_domain, must be greater than or equal to 1.'
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# resource path
|
|
290
|
+
local_var_path = '/v1/reddit/domains/{domain}/posts'.sub('{' + 'domain' + '}', CGI.escape(domain.to_s))
|
|
291
|
+
|
|
292
|
+
# query parameters
|
|
293
|
+
query_params = opts[:query_params] || {}
|
|
294
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
295
|
+
query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
|
|
296
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
297
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
298
|
+
|
|
299
|
+
# header parameters
|
|
300
|
+
header_params = opts[:header_params] || {}
|
|
301
|
+
# HTTP header 'Accept' (if needed)
|
|
302
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
303
|
+
|
|
304
|
+
# form parameters
|
|
305
|
+
form_params = opts[:form_params] || {}
|
|
306
|
+
|
|
307
|
+
# http body (model)
|
|
308
|
+
post_body = opts[:debug_body]
|
|
309
|
+
|
|
310
|
+
# return_type
|
|
311
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
312
|
+
|
|
313
|
+
# auth_names
|
|
314
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
315
|
+
|
|
316
|
+
new_options = opts.merge(
|
|
317
|
+
:operation => :"RedditApi.reddit_get_posts_by_domain",
|
|
318
|
+
:header_params => header_params,
|
|
319
|
+
:query_params => query_params,
|
|
320
|
+
:form_params => form_params,
|
|
321
|
+
:body => post_body,
|
|
322
|
+
:auth_names => auth_names,
|
|
323
|
+
:return_type => return_type
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
327
|
+
if @api_client.config.debugging
|
|
328
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_posts_by_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
329
|
+
end
|
|
330
|
+
return data, status_code, headers
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Get subreddit info
|
|
334
|
+
# Get detailed information about a subreddit.
|
|
335
|
+
# @param subreddit [String]
|
|
336
|
+
# @param [Hash] opts the optional parameters
|
|
337
|
+
# @return [Object]
|
|
338
|
+
def reddit_get_subreddit_info(subreddit, opts = {})
|
|
339
|
+
data, _status_code, _headers = reddit_get_subreddit_info_with_http_info(subreddit, opts)
|
|
340
|
+
data
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Get subreddit info
|
|
344
|
+
# Get detailed information about a subreddit.
|
|
345
|
+
# @param subreddit [String]
|
|
346
|
+
# @param [Hash] opts the optional parameters
|
|
347
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
348
|
+
def reddit_get_subreddit_info_with_http_info(subreddit, opts = {})
|
|
349
|
+
if @api_client.config.debugging
|
|
350
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_subreddit_info ...'
|
|
351
|
+
end
|
|
352
|
+
# verify the required parameter 'subreddit' is set
|
|
353
|
+
if @api_client.config.client_side_validation && subreddit.nil?
|
|
354
|
+
fail ArgumentError, "Missing the required parameter 'subreddit' when calling RedditApi.reddit_get_subreddit_info"
|
|
355
|
+
end
|
|
356
|
+
# resource path
|
|
357
|
+
local_var_path = '/v1/reddit/subreddits/{subreddit}'.sub('{' + 'subreddit' + '}', CGI.escape(subreddit.to_s))
|
|
358
|
+
|
|
359
|
+
# query parameters
|
|
360
|
+
query_params = opts[:query_params] || {}
|
|
361
|
+
|
|
362
|
+
# header parameters
|
|
363
|
+
header_params = opts[:header_params] || {}
|
|
364
|
+
# HTTP header 'Accept' (if needed)
|
|
365
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
366
|
+
|
|
367
|
+
# form parameters
|
|
368
|
+
form_params = opts[:form_params] || {}
|
|
369
|
+
|
|
370
|
+
# http body (model)
|
|
371
|
+
post_body = opts[:debug_body]
|
|
372
|
+
|
|
373
|
+
# return_type
|
|
374
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
375
|
+
|
|
376
|
+
# auth_names
|
|
377
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
378
|
+
|
|
379
|
+
new_options = opts.merge(
|
|
380
|
+
:operation => :"RedditApi.reddit_get_subreddit_info",
|
|
381
|
+
:header_params => header_params,
|
|
382
|
+
:query_params => query_params,
|
|
383
|
+
:form_params => form_params,
|
|
384
|
+
:body => post_body,
|
|
385
|
+
:auth_names => auth_names,
|
|
386
|
+
:return_type => return_type
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
390
|
+
if @api_client.config.debugging
|
|
391
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_subreddit_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
392
|
+
end
|
|
393
|
+
return data, status_code, headers
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# Get subreddit posts
|
|
397
|
+
# Get posts from a subreddit with sorting options.
|
|
398
|
+
# @param subreddit [String]
|
|
399
|
+
# @param [Hash] opts the optional parameters
|
|
400
|
+
# @option opts [String] :sort Sort: hot, new, top, rising, controversial (default to 'hot')
|
|
401
|
+
# @option opts [String] :t Time filter (default to 'all')
|
|
402
|
+
# @option opts [Integer] :limit (default to 25)
|
|
403
|
+
# @option opts [String] :after
|
|
404
|
+
# @return [Object]
|
|
405
|
+
def reddit_get_subreddit_posts(subreddit, opts = {})
|
|
406
|
+
data, _status_code, _headers = reddit_get_subreddit_posts_with_http_info(subreddit, opts)
|
|
407
|
+
data
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
# Get subreddit posts
|
|
411
|
+
# Get posts from a subreddit with sorting options.
|
|
412
|
+
# @param subreddit [String]
|
|
413
|
+
# @param [Hash] opts the optional parameters
|
|
414
|
+
# @option opts [String] :sort Sort: hot, new, top, rising, controversial (default to 'hot')
|
|
415
|
+
# @option opts [String] :t Time filter (default to 'all')
|
|
416
|
+
# @option opts [Integer] :limit (default to 25)
|
|
417
|
+
# @option opts [String] :after
|
|
418
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
419
|
+
def reddit_get_subreddit_posts_with_http_info(subreddit, opts = {})
|
|
420
|
+
if @api_client.config.debugging
|
|
421
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_subreddit_posts ...'
|
|
422
|
+
end
|
|
423
|
+
# verify the required parameter 'subreddit' is set
|
|
424
|
+
if @api_client.config.client_side_validation && subreddit.nil?
|
|
425
|
+
fail ArgumentError, "Missing the required parameter 'subreddit' when calling RedditApi.reddit_get_subreddit_posts"
|
|
426
|
+
end
|
|
427
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
428
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_subreddit_posts, must be smaller than or equal to 100.'
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
432
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_subreddit_posts, must be greater than or equal to 1.'
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
# resource path
|
|
436
|
+
local_var_path = '/v1/reddit/subreddits/{subreddit}/posts'.sub('{' + 'subreddit' + '}', CGI.escape(subreddit.to_s))
|
|
437
|
+
|
|
438
|
+
# query parameters
|
|
439
|
+
query_params = opts[:query_params] || {}
|
|
440
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
441
|
+
query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
|
|
442
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
443
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
444
|
+
|
|
445
|
+
# header parameters
|
|
446
|
+
header_params = opts[:header_params] || {}
|
|
447
|
+
# HTTP header 'Accept' (if needed)
|
|
448
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
449
|
+
|
|
450
|
+
# form parameters
|
|
451
|
+
form_params = opts[:form_params] || {}
|
|
452
|
+
|
|
453
|
+
# http body (model)
|
|
454
|
+
post_body = opts[:debug_body]
|
|
455
|
+
|
|
456
|
+
# return_type
|
|
457
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
458
|
+
|
|
459
|
+
# auth_names
|
|
460
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
461
|
+
|
|
462
|
+
new_options = opts.merge(
|
|
463
|
+
:operation => :"RedditApi.reddit_get_subreddit_posts",
|
|
464
|
+
:header_params => header_params,
|
|
465
|
+
:query_params => query_params,
|
|
466
|
+
:form_params => form_params,
|
|
467
|
+
:body => post_body,
|
|
468
|
+
:auth_names => auth_names,
|
|
469
|
+
:return_type => return_type
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
473
|
+
if @api_client.config.debugging
|
|
474
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_subreddit_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
475
|
+
end
|
|
476
|
+
return data, status_code, headers
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
# Get subreddit rules
|
|
480
|
+
# Get the rules of a subreddit.
|
|
481
|
+
# @param subreddit [String]
|
|
482
|
+
# @param [Hash] opts the optional parameters
|
|
483
|
+
# @return [Object]
|
|
484
|
+
def reddit_get_subreddit_rules(subreddit, opts = {})
|
|
485
|
+
data, _status_code, _headers = reddit_get_subreddit_rules_with_http_info(subreddit, opts)
|
|
486
|
+
data
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
# Get subreddit rules
|
|
490
|
+
# Get the rules of a subreddit.
|
|
491
|
+
# @param subreddit [String]
|
|
492
|
+
# @param [Hash] opts the optional parameters
|
|
493
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
494
|
+
def reddit_get_subreddit_rules_with_http_info(subreddit, opts = {})
|
|
495
|
+
if @api_client.config.debugging
|
|
496
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_subreddit_rules ...'
|
|
497
|
+
end
|
|
498
|
+
# verify the required parameter 'subreddit' is set
|
|
499
|
+
if @api_client.config.client_side_validation && subreddit.nil?
|
|
500
|
+
fail ArgumentError, "Missing the required parameter 'subreddit' when calling RedditApi.reddit_get_subreddit_rules"
|
|
501
|
+
end
|
|
502
|
+
# resource path
|
|
503
|
+
local_var_path = '/v1/reddit/subreddits/{subreddit}/rules'.sub('{' + 'subreddit' + '}', CGI.escape(subreddit.to_s))
|
|
504
|
+
|
|
505
|
+
# query parameters
|
|
506
|
+
query_params = opts[:query_params] || {}
|
|
507
|
+
|
|
508
|
+
# header parameters
|
|
509
|
+
header_params = opts[:header_params] || {}
|
|
510
|
+
# HTTP header 'Accept' (if needed)
|
|
511
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
512
|
+
|
|
513
|
+
# form parameters
|
|
514
|
+
form_params = opts[:form_params] || {}
|
|
515
|
+
|
|
516
|
+
# http body (model)
|
|
517
|
+
post_body = opts[:debug_body]
|
|
518
|
+
|
|
519
|
+
# return_type
|
|
520
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
521
|
+
|
|
522
|
+
# auth_names
|
|
523
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
524
|
+
|
|
525
|
+
new_options = opts.merge(
|
|
526
|
+
:operation => :"RedditApi.reddit_get_subreddit_rules",
|
|
527
|
+
:header_params => header_params,
|
|
528
|
+
:query_params => query_params,
|
|
529
|
+
:form_params => form_params,
|
|
530
|
+
:body => post_body,
|
|
531
|
+
:auth_names => auth_names,
|
|
532
|
+
:return_type => return_type
|
|
533
|
+
)
|
|
534
|
+
|
|
535
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
536
|
+
if @api_client.config.debugging
|
|
537
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_subreddit_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
538
|
+
end
|
|
539
|
+
return data, status_code, headers
|
|
540
|
+
end
|
|
541
|
+
|
|
542
|
+
# Get trending posts
|
|
543
|
+
# Get trending posts from Reddit's front page.
|
|
544
|
+
# @param [Hash] opts the optional parameters
|
|
545
|
+
# @option opts [String] :sort Sort: hot, new, top, rising, controversial, best (default to 'hot')
|
|
546
|
+
# @option opts [String] :t Time filter (default to 'day')
|
|
547
|
+
# @option opts [Integer] :limit (default to 25)
|
|
548
|
+
# @option opts [String] :after
|
|
549
|
+
# @return [Object]
|
|
550
|
+
def reddit_get_trending_posts(opts = {})
|
|
551
|
+
data, _status_code, _headers = reddit_get_trending_posts_with_http_info(opts)
|
|
552
|
+
data
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
# Get trending posts
|
|
556
|
+
# Get trending posts from Reddit's front page.
|
|
557
|
+
# @param [Hash] opts the optional parameters
|
|
558
|
+
# @option opts [String] :sort Sort: hot, new, top, rising, controversial, best (default to 'hot')
|
|
559
|
+
# @option opts [String] :t Time filter (default to 'day')
|
|
560
|
+
# @option opts [Integer] :limit (default to 25)
|
|
561
|
+
# @option opts [String] :after
|
|
562
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
563
|
+
def reddit_get_trending_posts_with_http_info(opts = {})
|
|
564
|
+
if @api_client.config.debugging
|
|
565
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_trending_posts ...'
|
|
566
|
+
end
|
|
567
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
568
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_trending_posts, must be smaller than or equal to 100.'
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
572
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_trending_posts, must be greater than or equal to 1.'
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
# resource path
|
|
576
|
+
local_var_path = '/v1/reddit/posts/trending'
|
|
577
|
+
|
|
578
|
+
# query parameters
|
|
579
|
+
query_params = opts[:query_params] || {}
|
|
580
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
581
|
+
query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
|
|
582
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
583
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
584
|
+
|
|
585
|
+
# header parameters
|
|
586
|
+
header_params = opts[:header_params] || {}
|
|
587
|
+
# HTTP header 'Accept' (if needed)
|
|
588
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
589
|
+
|
|
590
|
+
# form parameters
|
|
591
|
+
form_params = opts[:form_params] || {}
|
|
592
|
+
|
|
593
|
+
# http body (model)
|
|
594
|
+
post_body = opts[:debug_body]
|
|
595
|
+
|
|
596
|
+
# return_type
|
|
597
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
598
|
+
|
|
599
|
+
# auth_names
|
|
600
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
601
|
+
|
|
602
|
+
new_options = opts.merge(
|
|
603
|
+
:operation => :"RedditApi.reddit_get_trending_posts",
|
|
604
|
+
:header_params => header_params,
|
|
605
|
+
:query_params => query_params,
|
|
606
|
+
:form_params => form_params,
|
|
607
|
+
:body => post_body,
|
|
608
|
+
:auth_names => auth_names,
|
|
609
|
+
:return_type => return_type
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
613
|
+
if @api_client.config.debugging
|
|
614
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_trending_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
615
|
+
end
|
|
616
|
+
return data, status_code, headers
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
# Get user profile
|
|
620
|
+
# Get a Reddit user's profile.
|
|
621
|
+
# @param username [String]
|
|
622
|
+
# @param [Hash] opts the optional parameters
|
|
623
|
+
# @return [Object]
|
|
624
|
+
def reddit_get_user_profile(username, opts = {})
|
|
625
|
+
data, _status_code, _headers = reddit_get_user_profile_with_http_info(username, opts)
|
|
626
|
+
data
|
|
627
|
+
end
|
|
628
|
+
|
|
629
|
+
# Get user profile
|
|
630
|
+
# Get a Reddit user's profile.
|
|
631
|
+
# @param username [String]
|
|
632
|
+
# @param [Hash] opts the optional parameters
|
|
633
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
634
|
+
def reddit_get_user_profile_with_http_info(username, opts = {})
|
|
635
|
+
if @api_client.config.debugging
|
|
636
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_user_profile ...'
|
|
637
|
+
end
|
|
638
|
+
# verify the required parameter 'username' is set
|
|
639
|
+
if @api_client.config.client_side_validation && username.nil?
|
|
640
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling RedditApi.reddit_get_user_profile"
|
|
641
|
+
end
|
|
642
|
+
# resource path
|
|
643
|
+
local_var_path = '/v1/reddit/users/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
|
644
|
+
|
|
645
|
+
# query parameters
|
|
646
|
+
query_params = opts[:query_params] || {}
|
|
647
|
+
|
|
648
|
+
# header parameters
|
|
649
|
+
header_params = opts[:header_params] || {}
|
|
650
|
+
# HTTP header 'Accept' (if needed)
|
|
651
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
652
|
+
|
|
653
|
+
# form parameters
|
|
654
|
+
form_params = opts[:form_params] || {}
|
|
655
|
+
|
|
656
|
+
# http body (model)
|
|
657
|
+
post_body = opts[:debug_body]
|
|
658
|
+
|
|
659
|
+
# return_type
|
|
660
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
661
|
+
|
|
662
|
+
# auth_names
|
|
663
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
664
|
+
|
|
665
|
+
new_options = opts.merge(
|
|
666
|
+
:operation => :"RedditApi.reddit_get_user_profile",
|
|
667
|
+
:header_params => header_params,
|
|
668
|
+
:query_params => query_params,
|
|
669
|
+
:form_params => form_params,
|
|
670
|
+
:body => post_body,
|
|
671
|
+
:auth_names => auth_names,
|
|
672
|
+
:return_type => return_type
|
|
673
|
+
)
|
|
674
|
+
|
|
675
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
676
|
+
if @api_client.config.debugging
|
|
677
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_user_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
678
|
+
end
|
|
679
|
+
return data, status_code, headers
|
|
680
|
+
end
|
|
681
|
+
|
|
682
|
+
# Get user's comments
|
|
683
|
+
# Get comments by a Reddit user.
|
|
684
|
+
# @param username [String]
|
|
685
|
+
# @param [Hash] opts the optional parameters
|
|
686
|
+
# @option opts [String] :sort (default to 'new')
|
|
687
|
+
# @option opts [String] :t (default to 'all')
|
|
688
|
+
# @option opts [Integer] :limit (default to 25)
|
|
689
|
+
# @option opts [String] :after
|
|
690
|
+
# @return [Object]
|
|
691
|
+
def reddit_get_user_s_comments(username, opts = {})
|
|
692
|
+
data, _status_code, _headers = reddit_get_user_s_comments_with_http_info(username, opts)
|
|
693
|
+
data
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
# Get user's comments
|
|
697
|
+
# Get comments by a Reddit user.
|
|
698
|
+
# @param username [String]
|
|
699
|
+
# @param [Hash] opts the optional parameters
|
|
700
|
+
# @option opts [String] :sort (default to 'new')
|
|
701
|
+
# @option opts [String] :t (default to 'all')
|
|
702
|
+
# @option opts [Integer] :limit (default to 25)
|
|
703
|
+
# @option opts [String] :after
|
|
704
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
705
|
+
def reddit_get_user_s_comments_with_http_info(username, opts = {})
|
|
706
|
+
if @api_client.config.debugging
|
|
707
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_user_s_comments ...'
|
|
708
|
+
end
|
|
709
|
+
# verify the required parameter 'username' is set
|
|
710
|
+
if @api_client.config.client_side_validation && username.nil?
|
|
711
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling RedditApi.reddit_get_user_s_comments"
|
|
712
|
+
end
|
|
713
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
714
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_user_s_comments, must be smaller than or equal to 100.'
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
718
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_user_s_comments, must be greater than or equal to 1.'
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
# resource path
|
|
722
|
+
local_var_path = '/v1/reddit/users/{username}/comments'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
|
723
|
+
|
|
724
|
+
# query parameters
|
|
725
|
+
query_params = opts[:query_params] || {}
|
|
726
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
727
|
+
query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
|
|
728
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
729
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
730
|
+
|
|
731
|
+
# header parameters
|
|
732
|
+
header_params = opts[:header_params] || {}
|
|
733
|
+
# HTTP header 'Accept' (if needed)
|
|
734
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
735
|
+
|
|
736
|
+
# form parameters
|
|
737
|
+
form_params = opts[:form_params] || {}
|
|
738
|
+
|
|
739
|
+
# http body (model)
|
|
740
|
+
post_body = opts[:debug_body]
|
|
741
|
+
|
|
742
|
+
# return_type
|
|
743
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
744
|
+
|
|
745
|
+
# auth_names
|
|
746
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
747
|
+
|
|
748
|
+
new_options = opts.merge(
|
|
749
|
+
:operation => :"RedditApi.reddit_get_user_s_comments",
|
|
750
|
+
:header_params => header_params,
|
|
751
|
+
:query_params => query_params,
|
|
752
|
+
:form_params => form_params,
|
|
753
|
+
:body => post_body,
|
|
754
|
+
:auth_names => auth_names,
|
|
755
|
+
:return_type => return_type
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
759
|
+
if @api_client.config.debugging
|
|
760
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_user_s_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
761
|
+
end
|
|
762
|
+
return data, status_code, headers
|
|
763
|
+
end
|
|
764
|
+
|
|
765
|
+
# Get user's moderated subreddits
|
|
766
|
+
# Get subreddits moderated by a user.
|
|
767
|
+
# @param username [String]
|
|
768
|
+
# @param [Hash] opts the optional parameters
|
|
769
|
+
# @return [Object]
|
|
770
|
+
def reddit_get_user_s_moderated_subreddits(username, opts = {})
|
|
771
|
+
data, _status_code, _headers = reddit_get_user_s_moderated_subreddits_with_http_info(username, opts)
|
|
772
|
+
data
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
# Get user's moderated subreddits
|
|
776
|
+
# Get subreddits moderated by a user.
|
|
777
|
+
# @param username [String]
|
|
778
|
+
# @param [Hash] opts the optional parameters
|
|
779
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
780
|
+
def reddit_get_user_s_moderated_subreddits_with_http_info(username, opts = {})
|
|
781
|
+
if @api_client.config.debugging
|
|
782
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_user_s_moderated_subreddits ...'
|
|
783
|
+
end
|
|
784
|
+
# verify the required parameter 'username' is set
|
|
785
|
+
if @api_client.config.client_side_validation && username.nil?
|
|
786
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling RedditApi.reddit_get_user_s_moderated_subreddits"
|
|
787
|
+
end
|
|
788
|
+
# resource path
|
|
789
|
+
local_var_path = '/v1/reddit/users/{username}/moderated'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
|
790
|
+
|
|
791
|
+
# query parameters
|
|
792
|
+
query_params = opts[:query_params] || {}
|
|
793
|
+
|
|
794
|
+
# header parameters
|
|
795
|
+
header_params = opts[:header_params] || {}
|
|
796
|
+
# HTTP header 'Accept' (if needed)
|
|
797
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
798
|
+
|
|
799
|
+
# form parameters
|
|
800
|
+
form_params = opts[:form_params] || {}
|
|
801
|
+
|
|
802
|
+
# http body (model)
|
|
803
|
+
post_body = opts[:debug_body]
|
|
804
|
+
|
|
805
|
+
# return_type
|
|
806
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
807
|
+
|
|
808
|
+
# auth_names
|
|
809
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
810
|
+
|
|
811
|
+
new_options = opts.merge(
|
|
812
|
+
:operation => :"RedditApi.reddit_get_user_s_moderated_subreddits",
|
|
813
|
+
:header_params => header_params,
|
|
814
|
+
:query_params => query_params,
|
|
815
|
+
:form_params => form_params,
|
|
816
|
+
:body => post_body,
|
|
817
|
+
:auth_names => auth_names,
|
|
818
|
+
:return_type => return_type
|
|
819
|
+
)
|
|
820
|
+
|
|
821
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
822
|
+
if @api_client.config.debugging
|
|
823
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_user_s_moderated_subreddits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
824
|
+
end
|
|
825
|
+
return data, status_code, headers
|
|
826
|
+
end
|
|
827
|
+
|
|
828
|
+
# Get user's posts
|
|
829
|
+
# Get posts submitted by a Reddit user.
|
|
830
|
+
# @param username [String]
|
|
831
|
+
# @param [Hash] opts the optional parameters
|
|
832
|
+
# @option opts [String] :sort (default to 'new')
|
|
833
|
+
# @option opts [String] :t (default to 'all')
|
|
834
|
+
# @option opts [Integer] :limit (default to 25)
|
|
835
|
+
# @option opts [String] :after
|
|
836
|
+
# @return [Object]
|
|
837
|
+
def reddit_get_user_s_posts(username, opts = {})
|
|
838
|
+
data, _status_code, _headers = reddit_get_user_s_posts_with_http_info(username, opts)
|
|
839
|
+
data
|
|
840
|
+
end
|
|
841
|
+
|
|
842
|
+
# Get user's posts
|
|
843
|
+
# Get posts submitted by a Reddit user.
|
|
844
|
+
# @param username [String]
|
|
845
|
+
# @param [Hash] opts the optional parameters
|
|
846
|
+
# @option opts [String] :sort (default to 'new')
|
|
847
|
+
# @option opts [String] :t (default to 'all')
|
|
848
|
+
# @option opts [Integer] :limit (default to 25)
|
|
849
|
+
# @option opts [String] :after
|
|
850
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
851
|
+
def reddit_get_user_s_posts_with_http_info(username, opts = {})
|
|
852
|
+
if @api_client.config.debugging
|
|
853
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_user_s_posts ...'
|
|
854
|
+
end
|
|
855
|
+
# verify the required parameter 'username' is set
|
|
856
|
+
if @api_client.config.client_side_validation && username.nil?
|
|
857
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling RedditApi.reddit_get_user_s_posts"
|
|
858
|
+
end
|
|
859
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
860
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_user_s_posts, must be smaller than or equal to 100.'
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
864
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_get_user_s_posts, must be greater than or equal to 1.'
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
# resource path
|
|
868
|
+
local_var_path = '/v1/reddit/users/{username}/posts'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
|
869
|
+
|
|
870
|
+
# query parameters
|
|
871
|
+
query_params = opts[:query_params] || {}
|
|
872
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
873
|
+
query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
|
|
874
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
875
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
876
|
+
|
|
877
|
+
# header parameters
|
|
878
|
+
header_params = opts[:header_params] || {}
|
|
879
|
+
# HTTP header 'Accept' (if needed)
|
|
880
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
881
|
+
|
|
882
|
+
# form parameters
|
|
883
|
+
form_params = opts[:form_params] || {}
|
|
884
|
+
|
|
885
|
+
# http body (model)
|
|
886
|
+
post_body = opts[:debug_body]
|
|
887
|
+
|
|
888
|
+
# return_type
|
|
889
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
890
|
+
|
|
891
|
+
# auth_names
|
|
892
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
893
|
+
|
|
894
|
+
new_options = opts.merge(
|
|
895
|
+
:operation => :"RedditApi.reddit_get_user_s_posts",
|
|
896
|
+
:header_params => header_params,
|
|
897
|
+
:query_params => query_params,
|
|
898
|
+
:form_params => form_params,
|
|
899
|
+
:body => post_body,
|
|
900
|
+
:auth_names => auth_names,
|
|
901
|
+
:return_type => return_type
|
|
902
|
+
)
|
|
903
|
+
|
|
904
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
905
|
+
if @api_client.config.debugging
|
|
906
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_user_s_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
907
|
+
end
|
|
908
|
+
return data, status_code, headers
|
|
909
|
+
end
|
|
910
|
+
|
|
911
|
+
# Get user's trophies
|
|
912
|
+
# Get a user's trophy case.
|
|
913
|
+
# @param username [String]
|
|
914
|
+
# @param [Hash] opts the optional parameters
|
|
915
|
+
# @return [Object]
|
|
916
|
+
def reddit_get_user_s_trophies(username, opts = {})
|
|
917
|
+
data, _status_code, _headers = reddit_get_user_s_trophies_with_http_info(username, opts)
|
|
918
|
+
data
|
|
919
|
+
end
|
|
920
|
+
|
|
921
|
+
# Get user's trophies
|
|
922
|
+
# Get a user's trophy case.
|
|
923
|
+
# @param username [String]
|
|
924
|
+
# @param [Hash] opts the optional parameters
|
|
925
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
926
|
+
def reddit_get_user_s_trophies_with_http_info(username, opts = {})
|
|
927
|
+
if @api_client.config.debugging
|
|
928
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_user_s_trophies ...'
|
|
929
|
+
end
|
|
930
|
+
# verify the required parameter 'username' is set
|
|
931
|
+
if @api_client.config.client_side_validation && username.nil?
|
|
932
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling RedditApi.reddit_get_user_s_trophies"
|
|
933
|
+
end
|
|
934
|
+
# resource path
|
|
935
|
+
local_var_path = '/v1/reddit/users/{username}/trophies'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
|
|
936
|
+
|
|
937
|
+
# query parameters
|
|
938
|
+
query_params = opts[:query_params] || {}
|
|
939
|
+
|
|
940
|
+
# header parameters
|
|
941
|
+
header_params = opts[:header_params] || {}
|
|
942
|
+
# HTTP header 'Accept' (if needed)
|
|
943
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
944
|
+
|
|
945
|
+
# form parameters
|
|
946
|
+
form_params = opts[:form_params] || {}
|
|
947
|
+
|
|
948
|
+
# http body (model)
|
|
949
|
+
post_body = opts[:debug_body]
|
|
950
|
+
|
|
951
|
+
# return_type
|
|
952
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
953
|
+
|
|
954
|
+
# auth_names
|
|
955
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
956
|
+
|
|
957
|
+
new_options = opts.merge(
|
|
958
|
+
:operation => :"RedditApi.reddit_get_user_s_trophies",
|
|
959
|
+
:header_params => header_params,
|
|
960
|
+
:query_params => query_params,
|
|
961
|
+
:form_params => form_params,
|
|
962
|
+
:body => post_body,
|
|
963
|
+
:auth_names => auth_names,
|
|
964
|
+
:return_type => return_type
|
|
965
|
+
)
|
|
966
|
+
|
|
967
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
968
|
+
if @api_client.config.debugging
|
|
969
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_user_s_trophies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
970
|
+
end
|
|
971
|
+
return data, status_code, headers
|
|
972
|
+
end
|
|
973
|
+
|
|
974
|
+
# Get wiki page content
|
|
975
|
+
# Get the content of a specific wiki page.
|
|
976
|
+
# @param subreddit [String]
|
|
977
|
+
# @param page [String]
|
|
978
|
+
# @param [Hash] opts the optional parameters
|
|
979
|
+
# @return [Object]
|
|
980
|
+
def reddit_get_wiki_page_content(subreddit, page, opts = {})
|
|
981
|
+
data, _status_code, _headers = reddit_get_wiki_page_content_with_http_info(subreddit, page, opts)
|
|
982
|
+
data
|
|
983
|
+
end
|
|
984
|
+
|
|
985
|
+
# Get wiki page content
|
|
986
|
+
# Get the content of a specific wiki page.
|
|
987
|
+
# @param subreddit [String]
|
|
988
|
+
# @param page [String]
|
|
989
|
+
# @param [Hash] opts the optional parameters
|
|
990
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
991
|
+
def reddit_get_wiki_page_content_with_http_info(subreddit, page, opts = {})
|
|
992
|
+
if @api_client.config.debugging
|
|
993
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_get_wiki_page_content ...'
|
|
994
|
+
end
|
|
995
|
+
# verify the required parameter 'subreddit' is set
|
|
996
|
+
if @api_client.config.client_side_validation && subreddit.nil?
|
|
997
|
+
fail ArgumentError, "Missing the required parameter 'subreddit' when calling RedditApi.reddit_get_wiki_page_content"
|
|
998
|
+
end
|
|
999
|
+
# verify the required parameter 'page' is set
|
|
1000
|
+
if @api_client.config.client_side_validation && page.nil?
|
|
1001
|
+
fail ArgumentError, "Missing the required parameter 'page' when calling RedditApi.reddit_get_wiki_page_content"
|
|
1002
|
+
end
|
|
1003
|
+
# resource path
|
|
1004
|
+
local_var_path = '/v1/reddit/subreddits/{subreddit}/wiki/{page}'.sub('{' + 'subreddit' + '}', CGI.escape(subreddit.to_s)).sub('{' + 'page' + '}', CGI.escape(page.to_s))
|
|
1005
|
+
|
|
1006
|
+
# query parameters
|
|
1007
|
+
query_params = opts[:query_params] || {}
|
|
1008
|
+
|
|
1009
|
+
# header parameters
|
|
1010
|
+
header_params = opts[:header_params] || {}
|
|
1011
|
+
# HTTP header 'Accept' (if needed)
|
|
1012
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1013
|
+
|
|
1014
|
+
# form parameters
|
|
1015
|
+
form_params = opts[:form_params] || {}
|
|
1016
|
+
|
|
1017
|
+
# http body (model)
|
|
1018
|
+
post_body = opts[:debug_body]
|
|
1019
|
+
|
|
1020
|
+
# return_type
|
|
1021
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1022
|
+
|
|
1023
|
+
# auth_names
|
|
1024
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1025
|
+
|
|
1026
|
+
new_options = opts.merge(
|
|
1027
|
+
:operation => :"RedditApi.reddit_get_wiki_page_content",
|
|
1028
|
+
:header_params => header_params,
|
|
1029
|
+
:query_params => query_params,
|
|
1030
|
+
:form_params => form_params,
|
|
1031
|
+
:body => post_body,
|
|
1032
|
+
:auth_names => auth_names,
|
|
1033
|
+
:return_type => return_type
|
|
1034
|
+
)
|
|
1035
|
+
|
|
1036
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1037
|
+
if @api_client.config.debugging
|
|
1038
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_get_wiki_page_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1039
|
+
end
|
|
1040
|
+
return data, status_code, headers
|
|
1041
|
+
end
|
|
1042
|
+
|
|
1043
|
+
# List wiki pages
|
|
1044
|
+
# List all wiki pages in a subreddit.
|
|
1045
|
+
# @param subreddit [String]
|
|
1046
|
+
# @param [Hash] opts the optional parameters
|
|
1047
|
+
# @return [Object]
|
|
1048
|
+
def reddit_list_wiki_pages(subreddit, opts = {})
|
|
1049
|
+
data, _status_code, _headers = reddit_list_wiki_pages_with_http_info(subreddit, opts)
|
|
1050
|
+
data
|
|
1051
|
+
end
|
|
1052
|
+
|
|
1053
|
+
# List wiki pages
|
|
1054
|
+
# List all wiki pages in a subreddit.
|
|
1055
|
+
# @param subreddit [String]
|
|
1056
|
+
# @param [Hash] opts the optional parameters
|
|
1057
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1058
|
+
def reddit_list_wiki_pages_with_http_info(subreddit, opts = {})
|
|
1059
|
+
if @api_client.config.debugging
|
|
1060
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_list_wiki_pages ...'
|
|
1061
|
+
end
|
|
1062
|
+
# verify the required parameter 'subreddit' is set
|
|
1063
|
+
if @api_client.config.client_side_validation && subreddit.nil?
|
|
1064
|
+
fail ArgumentError, "Missing the required parameter 'subreddit' when calling RedditApi.reddit_list_wiki_pages"
|
|
1065
|
+
end
|
|
1066
|
+
# resource path
|
|
1067
|
+
local_var_path = '/v1/reddit/subreddits/{subreddit}/wiki'.sub('{' + 'subreddit' + '}', CGI.escape(subreddit.to_s))
|
|
1068
|
+
|
|
1069
|
+
# query parameters
|
|
1070
|
+
query_params = opts[:query_params] || {}
|
|
1071
|
+
|
|
1072
|
+
# header parameters
|
|
1073
|
+
header_params = opts[:header_params] || {}
|
|
1074
|
+
# HTTP header 'Accept' (if needed)
|
|
1075
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1076
|
+
|
|
1077
|
+
# form parameters
|
|
1078
|
+
form_params = opts[:form_params] || {}
|
|
1079
|
+
|
|
1080
|
+
# http body (model)
|
|
1081
|
+
post_body = opts[:debug_body]
|
|
1082
|
+
|
|
1083
|
+
# return_type
|
|
1084
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1085
|
+
|
|
1086
|
+
# auth_names
|
|
1087
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1088
|
+
|
|
1089
|
+
new_options = opts.merge(
|
|
1090
|
+
:operation => :"RedditApi.reddit_list_wiki_pages",
|
|
1091
|
+
:header_params => header_params,
|
|
1092
|
+
:query_params => query_params,
|
|
1093
|
+
:form_params => form_params,
|
|
1094
|
+
:body => post_body,
|
|
1095
|
+
:auth_names => auth_names,
|
|
1096
|
+
:return_type => return_type
|
|
1097
|
+
)
|
|
1098
|
+
|
|
1099
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1100
|
+
if @api_client.config.debugging
|
|
1101
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_list_wiki_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1102
|
+
end
|
|
1103
|
+
return data, status_code, headers
|
|
1104
|
+
end
|
|
1105
|
+
|
|
1106
|
+
# New subreddits
|
|
1107
|
+
# Get recently created subreddits.
|
|
1108
|
+
# @param [Hash] opts the optional parameters
|
|
1109
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1110
|
+
# @option opts [String] :after
|
|
1111
|
+
# @return [Object]
|
|
1112
|
+
def reddit_new_subreddits(opts = {})
|
|
1113
|
+
data, _status_code, _headers = reddit_new_subreddits_with_http_info(opts)
|
|
1114
|
+
data
|
|
1115
|
+
end
|
|
1116
|
+
|
|
1117
|
+
# New subreddits
|
|
1118
|
+
# Get recently created subreddits.
|
|
1119
|
+
# @param [Hash] opts the optional parameters
|
|
1120
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1121
|
+
# @option opts [String] :after
|
|
1122
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1123
|
+
def reddit_new_subreddits_with_http_info(opts = {})
|
|
1124
|
+
if @api_client.config.debugging
|
|
1125
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_new_subreddits ...'
|
|
1126
|
+
end
|
|
1127
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
1128
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_new_subreddits, must be smaller than or equal to 100.'
|
|
1129
|
+
end
|
|
1130
|
+
|
|
1131
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1132
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_new_subreddits, must be greater than or equal to 1.'
|
|
1133
|
+
end
|
|
1134
|
+
|
|
1135
|
+
# resource path
|
|
1136
|
+
local_var_path = '/v1/reddit/subreddits/new'
|
|
1137
|
+
|
|
1138
|
+
# query parameters
|
|
1139
|
+
query_params = opts[:query_params] || {}
|
|
1140
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1141
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1142
|
+
|
|
1143
|
+
# header parameters
|
|
1144
|
+
header_params = opts[:header_params] || {}
|
|
1145
|
+
# HTTP header 'Accept' (if needed)
|
|
1146
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1147
|
+
|
|
1148
|
+
# form parameters
|
|
1149
|
+
form_params = opts[:form_params] || {}
|
|
1150
|
+
|
|
1151
|
+
# http body (model)
|
|
1152
|
+
post_body = opts[:debug_body]
|
|
1153
|
+
|
|
1154
|
+
# return_type
|
|
1155
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1156
|
+
|
|
1157
|
+
# auth_names
|
|
1158
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1159
|
+
|
|
1160
|
+
new_options = opts.merge(
|
|
1161
|
+
:operation => :"RedditApi.reddit_new_subreddits",
|
|
1162
|
+
:header_params => header_params,
|
|
1163
|
+
:query_params => query_params,
|
|
1164
|
+
:form_params => form_params,
|
|
1165
|
+
:body => post_body,
|
|
1166
|
+
:auth_names => auth_names,
|
|
1167
|
+
:return_type => return_type
|
|
1168
|
+
)
|
|
1169
|
+
|
|
1170
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1171
|
+
if @api_client.config.debugging
|
|
1172
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_new_subreddits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1173
|
+
end
|
|
1174
|
+
return data, status_code, headers
|
|
1175
|
+
end
|
|
1176
|
+
|
|
1177
|
+
# Popular subreddits
|
|
1178
|
+
# Get popular subreddits by subscriber count.
|
|
1179
|
+
# @param [Hash] opts the optional parameters
|
|
1180
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1181
|
+
# @option opts [String] :after
|
|
1182
|
+
# @return [Object]
|
|
1183
|
+
def reddit_popular_subreddits(opts = {})
|
|
1184
|
+
data, _status_code, _headers = reddit_popular_subreddits_with_http_info(opts)
|
|
1185
|
+
data
|
|
1186
|
+
end
|
|
1187
|
+
|
|
1188
|
+
# Popular subreddits
|
|
1189
|
+
# Get popular subreddits by subscriber count.
|
|
1190
|
+
# @param [Hash] opts the optional parameters
|
|
1191
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1192
|
+
# @option opts [String] :after
|
|
1193
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1194
|
+
def reddit_popular_subreddits_with_http_info(opts = {})
|
|
1195
|
+
if @api_client.config.debugging
|
|
1196
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_popular_subreddits ...'
|
|
1197
|
+
end
|
|
1198
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
1199
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_popular_subreddits, must be smaller than or equal to 100.'
|
|
1200
|
+
end
|
|
1201
|
+
|
|
1202
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1203
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_popular_subreddits, must be greater than or equal to 1.'
|
|
1204
|
+
end
|
|
1205
|
+
|
|
1206
|
+
# resource path
|
|
1207
|
+
local_var_path = '/v1/reddit/subreddits/popular'
|
|
1208
|
+
|
|
1209
|
+
# query parameters
|
|
1210
|
+
query_params = opts[:query_params] || {}
|
|
1211
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1212
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1213
|
+
|
|
1214
|
+
# header parameters
|
|
1215
|
+
header_params = opts[:header_params] || {}
|
|
1216
|
+
# HTTP header 'Accept' (if needed)
|
|
1217
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1218
|
+
|
|
1219
|
+
# form parameters
|
|
1220
|
+
form_params = opts[:form_params] || {}
|
|
1221
|
+
|
|
1222
|
+
# http body (model)
|
|
1223
|
+
post_body = opts[:debug_body]
|
|
1224
|
+
|
|
1225
|
+
# return_type
|
|
1226
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1227
|
+
|
|
1228
|
+
# auth_names
|
|
1229
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1230
|
+
|
|
1231
|
+
new_options = opts.merge(
|
|
1232
|
+
:operation => :"RedditApi.reddit_popular_subreddits",
|
|
1233
|
+
:header_params => header_params,
|
|
1234
|
+
:query_params => query_params,
|
|
1235
|
+
:form_params => form_params,
|
|
1236
|
+
:body => post_body,
|
|
1237
|
+
:auth_names => auth_names,
|
|
1238
|
+
:return_type => return_type
|
|
1239
|
+
)
|
|
1240
|
+
|
|
1241
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1242
|
+
if @api_client.config.debugging
|
|
1243
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_popular_subreddits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1244
|
+
end
|
|
1245
|
+
return data, status_code, headers
|
|
1246
|
+
end
|
|
1247
|
+
|
|
1248
|
+
# Reddit scraper health check
|
|
1249
|
+
# @param [Hash] opts the optional parameters
|
|
1250
|
+
# @return [Object]
|
|
1251
|
+
def reddit_reddit_scraper_health_check(opts = {})
|
|
1252
|
+
data, _status_code, _headers = reddit_reddit_scraper_health_check_with_http_info(opts)
|
|
1253
|
+
data
|
|
1254
|
+
end
|
|
1255
|
+
|
|
1256
|
+
# Reddit scraper health check
|
|
1257
|
+
# @param [Hash] opts the optional parameters
|
|
1258
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1259
|
+
def reddit_reddit_scraper_health_check_with_http_info(opts = {})
|
|
1260
|
+
if @api_client.config.debugging
|
|
1261
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_reddit_scraper_health_check ...'
|
|
1262
|
+
end
|
|
1263
|
+
# resource path
|
|
1264
|
+
local_var_path = '/v1/reddit/health'
|
|
1265
|
+
|
|
1266
|
+
# query parameters
|
|
1267
|
+
query_params = opts[:query_params] || {}
|
|
1268
|
+
|
|
1269
|
+
# header parameters
|
|
1270
|
+
header_params = opts[:header_params] || {}
|
|
1271
|
+
# HTTP header 'Accept' (if needed)
|
|
1272
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1273
|
+
|
|
1274
|
+
# form parameters
|
|
1275
|
+
form_params = opts[:form_params] || {}
|
|
1276
|
+
|
|
1277
|
+
# http body (model)
|
|
1278
|
+
post_body = opts[:debug_body]
|
|
1279
|
+
|
|
1280
|
+
# return_type
|
|
1281
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1282
|
+
|
|
1283
|
+
# auth_names
|
|
1284
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1285
|
+
|
|
1286
|
+
new_options = opts.merge(
|
|
1287
|
+
:operation => :"RedditApi.reddit_reddit_scraper_health_check",
|
|
1288
|
+
:header_params => header_params,
|
|
1289
|
+
:query_params => query_params,
|
|
1290
|
+
:form_params => form_params,
|
|
1291
|
+
:body => post_body,
|
|
1292
|
+
:auth_names => auth_names,
|
|
1293
|
+
:return_type => return_type
|
|
1294
|
+
)
|
|
1295
|
+
|
|
1296
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1297
|
+
if @api_client.config.debugging
|
|
1298
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_reddit_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1299
|
+
end
|
|
1300
|
+
return data, status_code, headers
|
|
1301
|
+
end
|
|
1302
|
+
|
|
1303
|
+
# Reddit scraper health check
|
|
1304
|
+
# @param [Hash] opts the optional parameters
|
|
1305
|
+
# @return [Object]
|
|
1306
|
+
def reddit_reddit_scraper_health_check_head(opts = {})
|
|
1307
|
+
data, _status_code, _headers = reddit_reddit_scraper_health_check_head_with_http_info(opts)
|
|
1308
|
+
data
|
|
1309
|
+
end
|
|
1310
|
+
|
|
1311
|
+
# Reddit scraper health check
|
|
1312
|
+
# @param [Hash] opts the optional parameters
|
|
1313
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1314
|
+
def reddit_reddit_scraper_health_check_head_with_http_info(opts = {})
|
|
1315
|
+
if @api_client.config.debugging
|
|
1316
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_reddit_scraper_health_check_head ...'
|
|
1317
|
+
end
|
|
1318
|
+
# resource path
|
|
1319
|
+
local_var_path = '/v1/reddit/health'
|
|
1320
|
+
|
|
1321
|
+
# query parameters
|
|
1322
|
+
query_params = opts[:query_params] || {}
|
|
1323
|
+
|
|
1324
|
+
# header parameters
|
|
1325
|
+
header_params = opts[:header_params] || {}
|
|
1326
|
+
# HTTP header 'Accept' (if needed)
|
|
1327
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1328
|
+
|
|
1329
|
+
# form parameters
|
|
1330
|
+
form_params = opts[:form_params] || {}
|
|
1331
|
+
|
|
1332
|
+
# http body (model)
|
|
1333
|
+
post_body = opts[:debug_body]
|
|
1334
|
+
|
|
1335
|
+
# return_type
|
|
1336
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1337
|
+
|
|
1338
|
+
# auth_names
|
|
1339
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1340
|
+
|
|
1341
|
+
new_options = opts.merge(
|
|
1342
|
+
:operation => :"RedditApi.reddit_reddit_scraper_health_check_head",
|
|
1343
|
+
:header_params => header_params,
|
|
1344
|
+
:query_params => query_params,
|
|
1345
|
+
:form_params => form_params,
|
|
1346
|
+
:body => post_body,
|
|
1347
|
+
:auth_names => auth_names,
|
|
1348
|
+
:return_type => return_type
|
|
1349
|
+
)
|
|
1350
|
+
|
|
1351
|
+
data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
|
|
1352
|
+
if @api_client.config.debugging
|
|
1353
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_reddit_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1354
|
+
end
|
|
1355
|
+
return data, status_code, headers
|
|
1356
|
+
end
|
|
1357
|
+
|
|
1358
|
+
# Search Reddit posts
|
|
1359
|
+
# Search Reddit posts globally or within a subreddit.
|
|
1360
|
+
# @param q [String] Search query
|
|
1361
|
+
# @param [Hash] opts the optional parameters
|
|
1362
|
+
# @option opts [String] :subreddit Restrict to subreddit
|
|
1363
|
+
# @option opts [String] :sort Sort: relevance, hot, top, new, comments (default to 'relevance')
|
|
1364
|
+
# @option opts [String] :t Time: hour, day, week, month, year, all (default to 'all')
|
|
1365
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1366
|
+
# @option opts [String] :after
|
|
1367
|
+
# @return [Object]
|
|
1368
|
+
def reddit_search_reddit_posts(q, opts = {})
|
|
1369
|
+
data, _status_code, _headers = reddit_search_reddit_posts_with_http_info(q, opts)
|
|
1370
|
+
data
|
|
1371
|
+
end
|
|
1372
|
+
|
|
1373
|
+
# Search Reddit posts
|
|
1374
|
+
# Search Reddit posts globally or within a subreddit.
|
|
1375
|
+
# @param q [String] Search query
|
|
1376
|
+
# @param [Hash] opts the optional parameters
|
|
1377
|
+
# @option opts [String] :subreddit Restrict to subreddit
|
|
1378
|
+
# @option opts [String] :sort Sort: relevance, hot, top, new, comments (default to 'relevance')
|
|
1379
|
+
# @option opts [String] :t Time: hour, day, week, month, year, all (default to 'all')
|
|
1380
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1381
|
+
# @option opts [String] :after
|
|
1382
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1383
|
+
def reddit_search_reddit_posts_with_http_info(q, opts = {})
|
|
1384
|
+
if @api_client.config.debugging
|
|
1385
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_search_reddit_posts ...'
|
|
1386
|
+
end
|
|
1387
|
+
# verify the required parameter 'q' is set
|
|
1388
|
+
if @api_client.config.client_side_validation && q.nil?
|
|
1389
|
+
fail ArgumentError, "Missing the required parameter 'q' when calling RedditApi.reddit_search_reddit_posts"
|
|
1390
|
+
end
|
|
1391
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
1392
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_search_reddit_posts, must be smaller than or equal to 100.'
|
|
1393
|
+
end
|
|
1394
|
+
|
|
1395
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1396
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_search_reddit_posts, must be greater than or equal to 1.'
|
|
1397
|
+
end
|
|
1398
|
+
|
|
1399
|
+
# resource path
|
|
1400
|
+
local_var_path = '/v1/reddit/search/posts'
|
|
1401
|
+
|
|
1402
|
+
# query parameters
|
|
1403
|
+
query_params = opts[:query_params] || {}
|
|
1404
|
+
query_params[:'q'] = q
|
|
1405
|
+
query_params[:'subreddit'] = opts[:'subreddit'] if !opts[:'subreddit'].nil?
|
|
1406
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
1407
|
+
query_params[:'t'] = opts[:'t'] if !opts[:'t'].nil?
|
|
1408
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1409
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1410
|
+
|
|
1411
|
+
# header parameters
|
|
1412
|
+
header_params = opts[:header_params] || {}
|
|
1413
|
+
# HTTP header 'Accept' (if needed)
|
|
1414
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1415
|
+
|
|
1416
|
+
# form parameters
|
|
1417
|
+
form_params = opts[:form_params] || {}
|
|
1418
|
+
|
|
1419
|
+
# http body (model)
|
|
1420
|
+
post_body = opts[:debug_body]
|
|
1421
|
+
|
|
1422
|
+
# return_type
|
|
1423
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1424
|
+
|
|
1425
|
+
# auth_names
|
|
1426
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1427
|
+
|
|
1428
|
+
new_options = opts.merge(
|
|
1429
|
+
:operation => :"RedditApi.reddit_search_reddit_posts",
|
|
1430
|
+
:header_params => header_params,
|
|
1431
|
+
:query_params => query_params,
|
|
1432
|
+
:form_params => form_params,
|
|
1433
|
+
:body => post_body,
|
|
1434
|
+
:auth_names => auth_names,
|
|
1435
|
+
:return_type => return_type
|
|
1436
|
+
)
|
|
1437
|
+
|
|
1438
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1439
|
+
if @api_client.config.debugging
|
|
1440
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_search_reddit_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1441
|
+
end
|
|
1442
|
+
return data, status_code, headers
|
|
1443
|
+
end
|
|
1444
|
+
|
|
1445
|
+
# Search subreddits
|
|
1446
|
+
# Search for subreddits by keyword.
|
|
1447
|
+
# @param q [String] Search query
|
|
1448
|
+
# @param [Hash] opts the optional parameters
|
|
1449
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1450
|
+
# @option opts [String] :after
|
|
1451
|
+
# @return [Object]
|
|
1452
|
+
def reddit_search_subreddits(q, opts = {})
|
|
1453
|
+
data, _status_code, _headers = reddit_search_subreddits_with_http_info(q, opts)
|
|
1454
|
+
data
|
|
1455
|
+
end
|
|
1456
|
+
|
|
1457
|
+
# Search subreddits
|
|
1458
|
+
# Search for subreddits by keyword.
|
|
1459
|
+
# @param q [String] Search query
|
|
1460
|
+
# @param [Hash] opts the optional parameters
|
|
1461
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1462
|
+
# @option opts [String] :after
|
|
1463
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1464
|
+
def reddit_search_subreddits_with_http_info(q, opts = {})
|
|
1465
|
+
if @api_client.config.debugging
|
|
1466
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_search_subreddits ...'
|
|
1467
|
+
end
|
|
1468
|
+
# verify the required parameter 'q' is set
|
|
1469
|
+
if @api_client.config.client_side_validation && q.nil?
|
|
1470
|
+
fail ArgumentError, "Missing the required parameter 'q' when calling RedditApi.reddit_search_subreddits"
|
|
1471
|
+
end
|
|
1472
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
1473
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_search_subreddits, must be smaller than or equal to 100.'
|
|
1474
|
+
end
|
|
1475
|
+
|
|
1476
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1477
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_search_subreddits, must be greater than or equal to 1.'
|
|
1478
|
+
end
|
|
1479
|
+
|
|
1480
|
+
# resource path
|
|
1481
|
+
local_var_path = '/v1/reddit/search/subreddits'
|
|
1482
|
+
|
|
1483
|
+
# query parameters
|
|
1484
|
+
query_params = opts[:query_params] || {}
|
|
1485
|
+
query_params[:'q'] = q
|
|
1486
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1487
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1488
|
+
|
|
1489
|
+
# header parameters
|
|
1490
|
+
header_params = opts[:header_params] || {}
|
|
1491
|
+
# HTTP header 'Accept' (if needed)
|
|
1492
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1493
|
+
|
|
1494
|
+
# form parameters
|
|
1495
|
+
form_params = opts[:form_params] || {}
|
|
1496
|
+
|
|
1497
|
+
# http body (model)
|
|
1498
|
+
post_body = opts[:debug_body]
|
|
1499
|
+
|
|
1500
|
+
# return_type
|
|
1501
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1502
|
+
|
|
1503
|
+
# auth_names
|
|
1504
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1505
|
+
|
|
1506
|
+
new_options = opts.merge(
|
|
1507
|
+
:operation => :"RedditApi.reddit_search_subreddits",
|
|
1508
|
+
:header_params => header_params,
|
|
1509
|
+
:query_params => query_params,
|
|
1510
|
+
:form_params => form_params,
|
|
1511
|
+
:body => post_body,
|
|
1512
|
+
:auth_names => auth_names,
|
|
1513
|
+
:return_type => return_type
|
|
1514
|
+
)
|
|
1515
|
+
|
|
1516
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1517
|
+
if @api_client.config.debugging
|
|
1518
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_search_subreddits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1519
|
+
end
|
|
1520
|
+
return data, status_code, headers
|
|
1521
|
+
end
|
|
1522
|
+
|
|
1523
|
+
# Search users
|
|
1524
|
+
# Search for Reddit users.
|
|
1525
|
+
# @param q [String] Search query
|
|
1526
|
+
# @param [Hash] opts the optional parameters
|
|
1527
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1528
|
+
# @option opts [String] :after
|
|
1529
|
+
# @return [Object]
|
|
1530
|
+
def reddit_search_users(q, opts = {})
|
|
1531
|
+
data, _status_code, _headers = reddit_search_users_with_http_info(q, opts)
|
|
1532
|
+
data
|
|
1533
|
+
end
|
|
1534
|
+
|
|
1535
|
+
# Search users
|
|
1536
|
+
# Search for Reddit users.
|
|
1537
|
+
# @param q [String] Search query
|
|
1538
|
+
# @param [Hash] opts the optional parameters
|
|
1539
|
+
# @option opts [Integer] :limit (default to 25)
|
|
1540
|
+
# @option opts [String] :after
|
|
1541
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1542
|
+
def reddit_search_users_with_http_info(q, opts = {})
|
|
1543
|
+
if @api_client.config.debugging
|
|
1544
|
+
@api_client.config.logger.debug 'Calling API: RedditApi.reddit_search_users ...'
|
|
1545
|
+
end
|
|
1546
|
+
# verify the required parameter 'q' is set
|
|
1547
|
+
if @api_client.config.client_side_validation && q.nil?
|
|
1548
|
+
fail ArgumentError, "Missing the required parameter 'q' when calling RedditApi.reddit_search_users"
|
|
1549
|
+
end
|
|
1550
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
1551
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_search_users, must be smaller than or equal to 100.'
|
|
1552
|
+
end
|
|
1553
|
+
|
|
1554
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1555
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedditApi.reddit_search_users, must be greater than or equal to 1.'
|
|
1556
|
+
end
|
|
1557
|
+
|
|
1558
|
+
# resource path
|
|
1559
|
+
local_var_path = '/v1/reddit/search/users'
|
|
1560
|
+
|
|
1561
|
+
# query parameters
|
|
1562
|
+
query_params = opts[:query_params] || {}
|
|
1563
|
+
query_params[:'q'] = q
|
|
1564
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1565
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1566
|
+
|
|
1567
|
+
# header parameters
|
|
1568
|
+
header_params = opts[:header_params] || {}
|
|
1569
|
+
# HTTP header 'Accept' (if needed)
|
|
1570
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1571
|
+
|
|
1572
|
+
# form parameters
|
|
1573
|
+
form_params = opts[:form_params] || {}
|
|
1574
|
+
|
|
1575
|
+
# http body (model)
|
|
1576
|
+
post_body = opts[:debug_body]
|
|
1577
|
+
|
|
1578
|
+
# return_type
|
|
1579
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1580
|
+
|
|
1581
|
+
# auth_names
|
|
1582
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1583
|
+
|
|
1584
|
+
new_options = opts.merge(
|
|
1585
|
+
:operation => :"RedditApi.reddit_search_users",
|
|
1586
|
+
:header_params => header_params,
|
|
1587
|
+
:query_params => query_params,
|
|
1588
|
+
:form_params => form_params,
|
|
1589
|
+
:body => post_body,
|
|
1590
|
+
:auth_names => auth_names,
|
|
1591
|
+
:return_type => return_type
|
|
1592
|
+
)
|
|
1593
|
+
|
|
1594
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1595
|
+
if @api_client.config.debugging
|
|
1596
|
+
@api_client.config.logger.debug "API called: RedditApi#reddit_search_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1597
|
+
end
|
|
1598
|
+
return data, status_code, headers
|
|
1599
|
+
end
|
|
1600
|
+
end
|
|
1601
|
+
end
|