zernio-sdk 0.0.113 → 0.0.115
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 +4 -4
- data/README.md +1 -2
- data/docs/LinkedInMentionsApi.md +1 -1
- data/docs/RedditPost.md +48 -0
- data/docs/RedditSearchApi.md +4 -4
- data/docs/SearchReddit200Response.md +5 -3
- data/docs/ValidateApi.md +9 -5
- data/lib/late-sdk/api/linked_in_mentions_api.rb +2 -2
- data/lib/late-sdk/api/reddit_search_api.rb +3 -3
- data/lib/late-sdk/api/validate_api.rb +5 -2
- data/lib/late-sdk/models/{search_reddit200_response_posts_inner.rb → reddit_post.rb} +102 -26
- data/lib/late-sdk/models/search_reddit200_response.rb +20 -11
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +1 -2
- data/openapi.yaml +76 -32
- data/spec/api/linked_in_mentions_api_spec.rb +1 -1
- data/spec/api/reddit_search_api_spec.rb +1 -1
- data/spec/api/validate_api_spec.rb +2 -1
- data/spec/models/{search_reddit200_response_posts_inner_spec.rb → reddit_post_spec.rb} +52 -10
- data/spec/models/search_reddit200_response_spec.rb +7 -1
- metadata +6 -10
- data/docs/GetRedditFeed200Response.md +0 -20
- data/docs/SearchReddit200ResponsePostsInner.md +0 -34
- data/lib/late-sdk/models/get_reddit_feed200_response.rb +0 -158
- data/spec/models/get_reddit_feed200_response_spec.rb +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 522b1fb25e19c690785db45febb3ef0c986228efc2bf1c52118d8a48c2e23d80
|
|
4
|
+
data.tar.gz: efe27f647e71b07ac96f480b1b54d1b9aa3f6d96c38480135a8a9b5f0fb7ae73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d19faf9e8aa806d66294cdb416d2709710b8edc3b4e29f764569a8e359bfa92930b4a7734404308771b21e7c2506d3828a977deddd97a01979a71a65728529ec
|
|
7
|
+
data.tar.gz: 8a89c143fd54b4d9dfbab33d0438710987c9226816e6dd8c04500af9ea2bbae297b2d8deb0b9b2bef96e59b5ba20832081b8742ad6fff560738227814a554a58
|
data/README.md
CHANGED
|
@@ -627,7 +627,6 @@ Class | Method | HTTP request | Description
|
|
|
627
627
|
- [Late::GetPostingFrequency200Response](docs/GetPostingFrequency200Response.md)
|
|
628
628
|
- [Late::GetPostingFrequency200ResponseFrequencyInner](docs/GetPostingFrequency200ResponseFrequencyInner.md)
|
|
629
629
|
- [Late::GetProfile200Response](docs/GetProfile200Response.md)
|
|
630
|
-
- [Late::GetRedditFeed200Response](docs/GetRedditFeed200Response.md)
|
|
631
630
|
- [Late::GetRedditFlairs200Response](docs/GetRedditFlairs200Response.md)
|
|
632
631
|
- [Late::GetRedditFlairs200ResponseFlairsInner](docs/GetRedditFlairs200ResponseFlairsInner.md)
|
|
633
632
|
- [Late::GetRedditSubreddits200Response](docs/GetRedditSubreddits200Response.md)
|
|
@@ -844,6 +843,7 @@ Class | Method | HTTP request | Description
|
|
|
844
843
|
- [Late::RecyclingConfig](docs/RecyclingConfig.md)
|
|
845
844
|
- [Late::RecyclingState](docs/RecyclingState.md)
|
|
846
845
|
- [Late::RedditPlatformData](docs/RedditPlatformData.md)
|
|
846
|
+
- [Late::RedditPost](docs/RedditPost.md)
|
|
847
847
|
- [Late::RejectWhatsAppGroupJoinRequestsRequest](docs/RejectWhatsAppGroupJoinRequestsRequest.md)
|
|
848
848
|
- [Late::ReleaseWhatsAppPhoneNumber200Response](docs/ReleaseWhatsAppPhoneNumber200Response.md)
|
|
849
849
|
- [Late::ReleaseWhatsAppPhoneNumber200ResponsePhoneNumber](docs/ReleaseWhatsAppPhoneNumber200ResponsePhoneNumber.md)
|
|
@@ -870,7 +870,6 @@ Class | Method | HTTP request | Description
|
|
|
870
870
|
- [Late::SearchAdInterests200Response](docs/SearchAdInterests200Response.md)
|
|
871
871
|
- [Late::SearchAdInterests200ResponseInterestsInner](docs/SearchAdInterests200ResponseInterestsInner.md)
|
|
872
872
|
- [Late::SearchReddit200Response](docs/SearchReddit200Response.md)
|
|
873
|
-
- [Late::SearchReddit200ResponsePostsInner](docs/SearchReddit200ResponsePostsInner.md)
|
|
874
873
|
- [Late::SelectFacebookPage200Response](docs/SelectFacebookPage200Response.md)
|
|
875
874
|
- [Late::SelectFacebookPage200ResponseAccount](docs/SelectFacebookPage200ResponseAccount.md)
|
|
876
875
|
- [Late::SelectFacebookPageRequest](docs/SelectFacebookPageRequest.md)
|
data/docs/LinkedInMentionsApi.md
CHANGED
|
@@ -13,7 +13,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
13
13
|
|
|
14
14
|
Resolve LinkedIn mention
|
|
15
15
|
|
|
16
|
-
Converts a LinkedIn profile or company URL to a URN for @mentions in posts. **How to use LinkedIn @mentions (2-step workflow):** 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format. 2. Embed the returned `mentionFormat` (e.g. `@[Vincent Jong](urn:li:person:xxx)`) directly in your post's `content` field. **Example:** - Resolve: `GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong` - Returns: `mentionFormat: \"@[Vincent Jong](urn:li:person:xxx)\"` - Use in post content: `\"Great talk with @[Vincent Jong](urn:li:person:xxx) today!\"` **Important:** The `mentions` array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text. **Requirements:** - Person mentions require the LinkedIn account to be admin of at least one organization. - Organization mentions (e.g. @Microsoft) work without this requirement. - For person mentions to be clickable, the `displayName` parameter must exactly match the name shown on their LinkedIn profile.
|
|
16
|
+
Converts a LinkedIn profile or company URL to a URN for @mentions in posts. **How to use LinkedIn @mentions (2-step workflow):** 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format. 2. Embed the returned `mentionFormat` (e.g. `@[Vincent Jong](urn:li:person:xxx)`) directly in your post's `content` field. **Example:** - Resolve: `GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong` - Returns: `mentionFormat: \"@[Vincent Jong](urn:li:person:xxx)\"` - Use in post content: `\"Great talk with @[Vincent Jong](urn:li:person:xxx) today!\"` **Important:** The `mentions` array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text. **Requirements:** - **Person mentions** require the LinkedIn account to be admin of at least one organization. This is a LinkedIn API limitation: the only endpoints that resolve profile URLs to member URNs (`vanityUrl`, `peopleTypeahead`) are scoped to organization followers. There is no public LinkedIn API to resolve a vanity URL without organization context. - **Organization mentions** (e.g. @Microsoft) work without this requirement. - For person mentions to be clickable, the `displayName` parameter must exactly match the name shown on their LinkedIn profile. - Person mentions DO work when published from personal profiles (the URN just needs to be valid). The limitation is only in the resolution step (URL to URN), not in publishing.
|
|
17
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
|
data/docs/RedditPost.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Late::RedditPost
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Reddit post ID (without type prefix) | [optional] |
|
|
8
|
+
| **fullname** | **String** | Reddit fullname (e.g. t3_abc123) | [optional] |
|
|
9
|
+
| **title** | **String** | | [optional] |
|
|
10
|
+
| **author** | **String** | | [optional] |
|
|
11
|
+
| **subreddit** | **String** | | [optional] |
|
|
12
|
+
| **url** | **String** | Post URL (may be a gallery URL | [optional] |
|
|
13
|
+
| **permalink** | **String** | Full permalink to the Reddit post | [optional] |
|
|
14
|
+
| **selftext** | **String** | Self-post body text (empty string for link posts) | [optional] |
|
|
15
|
+
| **created_utc** | **Float** | Unix timestamp of post creation | [optional] |
|
|
16
|
+
| **score** | **Integer** | | [optional] |
|
|
17
|
+
| **num_comments** | **Integer** | | [optional] |
|
|
18
|
+
| **over18** | **Boolean** | Whether the post is marked NSFW | [optional] |
|
|
19
|
+
| **stickied** | **Boolean** | | [optional] |
|
|
20
|
+
| **flair_text** | **String** | Link flair text if set | [optional] |
|
|
21
|
+
| **is_gallery** | **Boolean** | Whether the post is a gallery with multiple images | [optional] |
|
|
22
|
+
| **gallery_images** | **Array<String>** | Individual image URLs for gallery posts (only present when isGallery is true) | [optional] |
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
require 'late-sdk'
|
|
28
|
+
|
|
29
|
+
instance = Late::RedditPost.new(
|
|
30
|
+
id: null,
|
|
31
|
+
fullname: null,
|
|
32
|
+
title: null,
|
|
33
|
+
author: null,
|
|
34
|
+
subreddit: null,
|
|
35
|
+
url: null,
|
|
36
|
+
permalink: null,
|
|
37
|
+
selftext: null,
|
|
38
|
+
created_utc: null,
|
|
39
|
+
score: null,
|
|
40
|
+
num_comments: null,
|
|
41
|
+
over18: null,
|
|
42
|
+
stickied: null,
|
|
43
|
+
flair_text: null,
|
|
44
|
+
is_gallery: null,
|
|
45
|
+
gallery_images: null
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
data/docs/RedditSearchApi.md
CHANGED
|
@@ -10,7 +10,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
10
10
|
|
|
11
11
|
## get_reddit_feed
|
|
12
12
|
|
|
13
|
-
> <
|
|
13
|
+
> <SearchReddit200Response> get_reddit_feed(account_id, opts)
|
|
14
14
|
|
|
15
15
|
Get subreddit feed
|
|
16
16
|
|
|
@@ -50,7 +50,7 @@ end
|
|
|
50
50
|
|
|
51
51
|
This returns an Array which contains the response data, status code and headers.
|
|
52
52
|
|
|
53
|
-
> <Array(<
|
|
53
|
+
> <Array(<SearchReddit200Response>, Integer, Hash)> get_reddit_feed_with_http_info(account_id, opts)
|
|
54
54
|
|
|
55
55
|
```ruby
|
|
56
56
|
begin
|
|
@@ -58,7 +58,7 @@ begin
|
|
|
58
58
|
data, status_code, headers = api_instance.get_reddit_feed_with_http_info(account_id, opts)
|
|
59
59
|
p status_code # => 2xx
|
|
60
60
|
p headers # => { ... }
|
|
61
|
-
p data # => <
|
|
61
|
+
p data # => <SearchReddit200Response>
|
|
62
62
|
rescue Late::ApiError => e
|
|
63
63
|
puts "Error when calling RedditSearchApi->get_reddit_feed_with_http_info: #{e}"
|
|
64
64
|
end
|
|
@@ -77,7 +77,7 @@ end
|
|
|
77
77
|
|
|
78
78
|
### Return type
|
|
79
79
|
|
|
80
|
-
[**
|
|
80
|
+
[**SearchReddit200Response**](SearchReddit200Response.md)
|
|
81
81
|
|
|
82
82
|
### Authorization
|
|
83
83
|
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **
|
|
7
|
+
| **items** | [**Array<RedditPost>**](RedditPost.md) | | [optional] |
|
|
8
8
|
| **after** | **String** | | [optional] |
|
|
9
|
+
| **before** | **String** | | [optional] |
|
|
9
10
|
|
|
10
11
|
## Example
|
|
11
12
|
|
|
@@ -13,8 +14,9 @@
|
|
|
13
14
|
require 'late-sdk'
|
|
14
15
|
|
|
15
16
|
instance = Late::SearchReddit200Response.new(
|
|
16
|
-
|
|
17
|
-
after: null
|
|
17
|
+
items: null,
|
|
18
|
+
after: null,
|
|
19
|
+
before: null
|
|
18
20
|
)
|
|
19
21
|
```
|
|
20
22
|
|
data/docs/ValidateApi.md
CHANGED
|
@@ -219,11 +219,11 @@ end
|
|
|
219
219
|
|
|
220
220
|
## validate_subreddit
|
|
221
221
|
|
|
222
|
-
> <ValidateSubreddit200Response> validate_subreddit(name)
|
|
222
|
+
> <ValidateSubreddit200Response> validate_subreddit(name, opts)
|
|
223
223
|
|
|
224
224
|
Check subreddit existence
|
|
225
225
|
|
|
226
|
-
Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed).
|
|
226
|
+
Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). When accountId is provided, uses authenticated Reddit OAuth API with automatic token refresh (recommended). Falls back to Reddit's public JSON API, which may be unreliable from server IPs. Returns `exists: false` for private, banned, or nonexistent subreddits.
|
|
227
227
|
|
|
228
228
|
### Examples
|
|
229
229
|
|
|
@@ -238,10 +238,13 @@ end
|
|
|
238
238
|
|
|
239
239
|
api_instance = Late::ValidateApi.new
|
|
240
240
|
name = 'programming' # String | Subreddit name (with or without \"r/\" prefix)
|
|
241
|
+
opts = {
|
|
242
|
+
account_id: 'account_id_example' # String | Reddit social account ID for authenticated lookup (recommended for reliable results)
|
|
243
|
+
}
|
|
241
244
|
|
|
242
245
|
begin
|
|
243
246
|
# Check subreddit existence
|
|
244
|
-
result = api_instance.validate_subreddit(name)
|
|
247
|
+
result = api_instance.validate_subreddit(name, opts)
|
|
245
248
|
p result
|
|
246
249
|
rescue Late::ApiError => e
|
|
247
250
|
puts "Error when calling ValidateApi->validate_subreddit: #{e}"
|
|
@@ -252,12 +255,12 @@ end
|
|
|
252
255
|
|
|
253
256
|
This returns an Array which contains the response data, status code and headers.
|
|
254
257
|
|
|
255
|
-
> <Array(<ValidateSubreddit200Response>, Integer, Hash)> validate_subreddit_with_http_info(name)
|
|
258
|
+
> <Array(<ValidateSubreddit200Response>, Integer, Hash)> validate_subreddit_with_http_info(name, opts)
|
|
256
259
|
|
|
257
260
|
```ruby
|
|
258
261
|
begin
|
|
259
262
|
# Check subreddit existence
|
|
260
|
-
data, status_code, headers = api_instance.validate_subreddit_with_http_info(name)
|
|
263
|
+
data, status_code, headers = api_instance.validate_subreddit_with_http_info(name, opts)
|
|
261
264
|
p status_code # => 2xx
|
|
262
265
|
p headers # => { ... }
|
|
263
266
|
p data # => <ValidateSubreddit200Response>
|
|
@@ -271,6 +274,7 @@ end
|
|
|
271
274
|
| Name | Type | Description | Notes |
|
|
272
275
|
| ---- | ---- | ----------- | ----- |
|
|
273
276
|
| **name** | **String** | Subreddit name (with or without \"r/\" prefix) | |
|
|
277
|
+
| **account_id** | **String** | Reddit social account ID for authenticated lookup (recommended for reliable results) | [optional] |
|
|
274
278
|
|
|
275
279
|
### Return type
|
|
276
280
|
|
|
@@ -20,7 +20,7 @@ module Late
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Resolve LinkedIn mention
|
|
23
|
-
# Converts a LinkedIn profile or company URL to a URN for @mentions in posts. **How to use LinkedIn @mentions (2-step workflow):** 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format. 2. Embed the returned `mentionFormat` (e.g. `@[Vincent Jong](urn:li:person:xxx)`) directly in your post's `content` field. **Example:** - Resolve: `GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong` - Returns: `mentionFormat: \"@[Vincent Jong](urn:li:person:xxx)\"` - Use in post content: `\"Great talk with @[Vincent Jong](urn:li:person:xxx) today!\"` **Important:** The `mentions` array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text. **Requirements:** - Person mentions require the LinkedIn account to be admin of at least one organization. - Organization mentions (e.g. @Microsoft) work without this requirement. - For person mentions to be clickable, the `displayName` parameter must exactly match the name shown on their LinkedIn profile.
|
|
23
|
+
# Converts a LinkedIn profile or company URL to a URN for @mentions in posts. **How to use LinkedIn @mentions (2-step workflow):** 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format. 2. Embed the returned `mentionFormat` (e.g. `@[Vincent Jong](urn:li:person:xxx)`) directly in your post's `content` field. **Example:** - Resolve: `GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong` - Returns: `mentionFormat: \"@[Vincent Jong](urn:li:person:xxx)\"` - Use in post content: `\"Great talk with @[Vincent Jong](urn:li:person:xxx) today!\"` **Important:** The `mentions` array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text. **Requirements:** - **Person mentions** require the LinkedIn account to be admin of at least one organization. This is a LinkedIn API limitation: the only endpoints that resolve profile URLs to member URNs (`vanityUrl`, `peopleTypeahead`) are scoped to organization followers. There is no public LinkedIn API to resolve a vanity URL without organization context. - **Organization mentions** (e.g. @Microsoft) work without this requirement. - For person mentions to be clickable, the `displayName` parameter must exactly match the name shown on their LinkedIn profile. - Person mentions DO work when published from personal profiles (the URN just needs to be valid). The limitation is only in the resolution step (URL to URN), not in publishing.
|
|
24
24
|
# @param account_id [String] The LinkedIn account ID
|
|
25
25
|
# @param url [String] LinkedIn profile URL, company URL, or vanity name.
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
@@ -32,7 +32,7 @@ module Late
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Resolve LinkedIn mention
|
|
35
|
-
# Converts a LinkedIn profile or company URL to a URN for @mentions in posts. **How to use LinkedIn @mentions (2-step workflow):** 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format. 2. Embed the returned `mentionFormat` (e.g. `@[Vincent Jong](urn:li:person:xxx)`) directly in your post's `content` field. **Example:** - Resolve: `GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong` - Returns: `mentionFormat: \"@[Vincent Jong](urn:li:person:xxx)\"` - Use in post content: `\"Great talk with @[Vincent Jong](urn:li:person:xxx) today!\"` **Important:** The `mentions` array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text. **Requirements:** - Person mentions require the LinkedIn account to be admin of at least one organization. - Organization mentions (e.g. @Microsoft) work without this requirement. - For person mentions to be clickable, the `displayName` parameter must exactly match the name shown on their LinkedIn profile.
|
|
35
|
+
# Converts a LinkedIn profile or company URL to a URN for @mentions in posts. **How to use LinkedIn @mentions (2-step workflow):** 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format. 2. Embed the returned `mentionFormat` (e.g. `@[Vincent Jong](urn:li:person:xxx)`) directly in your post's `content` field. **Example:** - Resolve: `GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong` - Returns: `mentionFormat: \"@[Vincent Jong](urn:li:person:xxx)\"` - Use in post content: `\"Great talk with @[Vincent Jong](urn:li:person:xxx) today!\"` **Important:** The `mentions` array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text. **Requirements:** - **Person mentions** require the LinkedIn account to be admin of at least one organization. This is a LinkedIn API limitation: the only endpoints that resolve profile URLs to member URNs (`vanityUrl`, `peopleTypeahead`) are scoped to organization followers. There is no public LinkedIn API to resolve a vanity URL without organization context. - **Organization mentions** (e.g. @Microsoft) work without this requirement. - For person mentions to be clickable, the `displayName` parameter must exactly match the name shown on their LinkedIn profile. - Person mentions DO work when published from personal profiles (the URN just needs to be valid). The limitation is only in the resolution step (URL to URN), not in publishing.
|
|
36
36
|
# @param account_id [String] The LinkedIn account ID
|
|
37
37
|
# @param url [String] LinkedIn profile URL, company URL, or vanity name.
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
@@ -28,7 +28,7 @@ module Late
|
|
|
28
28
|
# @option opts [Integer] :limit (default to 25)
|
|
29
29
|
# @option opts [String] :after
|
|
30
30
|
# @option opts [String] :t
|
|
31
|
-
# @return [
|
|
31
|
+
# @return [SearchReddit200Response]
|
|
32
32
|
def get_reddit_feed(account_id, opts = {})
|
|
33
33
|
data, _status_code, _headers = get_reddit_feed_with_http_info(account_id, opts)
|
|
34
34
|
data
|
|
@@ -43,7 +43,7 @@ module Late
|
|
|
43
43
|
# @option opts [Integer] :limit (default to 25)
|
|
44
44
|
# @option opts [String] :after
|
|
45
45
|
# @option opts [String] :t
|
|
46
|
-
# @return [Array<(
|
|
46
|
+
# @return [Array<(SearchReddit200Response, Integer, Hash)>] SearchReddit200Response data, response status code and response headers
|
|
47
47
|
def get_reddit_feed_with_http_info(account_id, opts = {})
|
|
48
48
|
if @api_client.config.debugging
|
|
49
49
|
@api_client.config.logger.debug 'Calling API: RedditSearchApi.get_reddit_feed ...'
|
|
@@ -88,7 +88,7 @@ module Late
|
|
|
88
88
|
post_body = opts[:debug_body]
|
|
89
89
|
|
|
90
90
|
# return_type
|
|
91
|
-
return_type = opts[:debug_return_type] || '
|
|
91
|
+
return_type = opts[:debug_return_type] || 'SearchReddit200Response'
|
|
92
92
|
|
|
93
93
|
# auth_names
|
|
94
94
|
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
@@ -224,9 +224,10 @@ module Late
|
|
|
224
224
|
end
|
|
225
225
|
|
|
226
226
|
# Check subreddit existence
|
|
227
|
-
# Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed).
|
|
227
|
+
# Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). When accountId is provided, uses authenticated Reddit OAuth API with automatic token refresh (recommended). Falls back to Reddit's public JSON API, which may be unreliable from server IPs. Returns `exists: false` for private, banned, or nonexistent subreddits.
|
|
228
228
|
# @param name [String] Subreddit name (with or without \"r/\" prefix)
|
|
229
229
|
# @param [Hash] opts the optional parameters
|
|
230
|
+
# @option opts [String] :account_id Reddit social account ID for authenticated lookup (recommended for reliable results)
|
|
230
231
|
# @return [ValidateSubreddit200Response]
|
|
231
232
|
def validate_subreddit(name, opts = {})
|
|
232
233
|
data, _status_code, _headers = validate_subreddit_with_http_info(name, opts)
|
|
@@ -234,9 +235,10 @@ module Late
|
|
|
234
235
|
end
|
|
235
236
|
|
|
236
237
|
# Check subreddit existence
|
|
237
|
-
# Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed).
|
|
238
|
+
# Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). When accountId is provided, uses authenticated Reddit OAuth API with automatic token refresh (recommended). Falls back to Reddit's public JSON API, which may be unreliable from server IPs. Returns `exists: false` for private, banned, or nonexistent subreddits.
|
|
238
239
|
# @param name [String] Subreddit name (with or without \"r/\" prefix)
|
|
239
240
|
# @param [Hash] opts the optional parameters
|
|
241
|
+
# @option opts [String] :account_id Reddit social account ID for authenticated lookup (recommended for reliable results)
|
|
240
242
|
# @return [Array<(ValidateSubreddit200Response, Integer, Hash)>] ValidateSubreddit200Response data, response status code and response headers
|
|
241
243
|
def validate_subreddit_with_http_info(name, opts = {})
|
|
242
244
|
if @api_client.config.debugging
|
|
@@ -252,6 +254,7 @@ module Late
|
|
|
252
254
|
# query parameters
|
|
253
255
|
query_params = opts[:query_params] || {}
|
|
254
256
|
query_params[:'name'] = name
|
|
257
|
+
query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
|
|
255
258
|
|
|
256
259
|
# header parameters
|
|
257
260
|
header_params = opts[:header_params] || {}
|
|
@@ -14,37 +14,69 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Late
|
|
17
|
-
|
|
17
|
+
# A normalized Reddit post returned by the feed and search endpoints
|
|
18
|
+
class RedditPost < ApiModelBase
|
|
19
|
+
# Reddit post ID (without type prefix)
|
|
18
20
|
attr_accessor :id
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
# Reddit fullname (e.g. t3_abc123)
|
|
23
|
+
attr_accessor :fullname
|
|
21
24
|
|
|
22
|
-
attr_accessor :
|
|
25
|
+
attr_accessor :title
|
|
23
26
|
|
|
24
27
|
attr_accessor :author
|
|
25
28
|
|
|
26
29
|
attr_accessor :subreddit
|
|
27
30
|
|
|
31
|
+
# Post URL (may be a gallery URL
|
|
32
|
+
attr_accessor :url
|
|
33
|
+
|
|
34
|
+
# Full permalink to the Reddit post
|
|
35
|
+
attr_accessor :permalink
|
|
36
|
+
|
|
37
|
+
# Self-post body text (empty string for link posts)
|
|
38
|
+
attr_accessor :selftext
|
|
39
|
+
|
|
40
|
+
# Unix timestamp of post creation
|
|
41
|
+
attr_accessor :created_utc
|
|
42
|
+
|
|
28
43
|
attr_accessor :score
|
|
29
44
|
|
|
30
45
|
attr_accessor :num_comments
|
|
31
46
|
|
|
32
|
-
|
|
47
|
+
# Whether the post is marked NSFW
|
|
48
|
+
attr_accessor :over18
|
|
33
49
|
|
|
34
|
-
attr_accessor :
|
|
50
|
+
attr_accessor :stickied
|
|
51
|
+
|
|
52
|
+
# Link flair text if set
|
|
53
|
+
attr_accessor :flair_text
|
|
54
|
+
|
|
55
|
+
# Whether the post is a gallery with multiple images
|
|
56
|
+
attr_accessor :is_gallery
|
|
57
|
+
|
|
58
|
+
# Individual image URLs for gallery posts (only present when isGallery is true)
|
|
59
|
+
attr_accessor :gallery_images
|
|
35
60
|
|
|
36
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
62
|
def self.attribute_map
|
|
38
63
|
{
|
|
39
64
|
:'id' => :'id',
|
|
65
|
+
:'fullname' => :'fullname',
|
|
40
66
|
:'title' => :'title',
|
|
41
|
-
:'selftext' => :'selftext',
|
|
42
67
|
:'author' => :'author',
|
|
43
68
|
:'subreddit' => :'subreddit',
|
|
69
|
+
:'url' => :'url',
|
|
70
|
+
:'permalink' => :'permalink',
|
|
71
|
+
:'selftext' => :'selftext',
|
|
72
|
+
:'created_utc' => :'createdUtc',
|
|
44
73
|
:'score' => :'score',
|
|
45
|
-
:'num_comments' => :'
|
|
46
|
-
:'
|
|
47
|
-
:'
|
|
74
|
+
:'num_comments' => :'numComments',
|
|
75
|
+
:'over18' => :'over18',
|
|
76
|
+
:'stickied' => :'stickied',
|
|
77
|
+
:'flair_text' => :'flairText',
|
|
78
|
+
:'is_gallery' => :'isGallery',
|
|
79
|
+
:'gallery_images' => :'galleryImages'
|
|
48
80
|
}
|
|
49
81
|
end
|
|
50
82
|
|
|
@@ -62,14 +94,21 @@ module Late
|
|
|
62
94
|
def self.openapi_types
|
|
63
95
|
{
|
|
64
96
|
:'id' => :'String',
|
|
97
|
+
:'fullname' => :'String',
|
|
65
98
|
:'title' => :'String',
|
|
66
|
-
:'selftext' => :'String',
|
|
67
99
|
:'author' => :'String',
|
|
68
100
|
:'subreddit' => :'String',
|
|
101
|
+
:'url' => :'String',
|
|
102
|
+
:'permalink' => :'String',
|
|
103
|
+
:'selftext' => :'String',
|
|
104
|
+
:'created_utc' => :'Float',
|
|
69
105
|
:'score' => :'Integer',
|
|
70
106
|
:'num_comments' => :'Integer',
|
|
71
|
-
:'
|
|
72
|
-
:'
|
|
107
|
+
:'over18' => :'Boolean',
|
|
108
|
+
:'stickied' => :'Boolean',
|
|
109
|
+
:'flair_text' => :'String',
|
|
110
|
+
:'is_gallery' => :'Boolean',
|
|
111
|
+
:'gallery_images' => :'Array<String>'
|
|
73
112
|
}
|
|
74
113
|
end
|
|
75
114
|
|
|
@@ -83,14 +122,14 @@ module Late
|
|
|
83
122
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
84
123
|
def initialize(attributes = {})
|
|
85
124
|
if (!attributes.is_a?(Hash))
|
|
86
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::
|
|
125
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::RedditPost` initialize method"
|
|
87
126
|
end
|
|
88
127
|
|
|
89
128
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
90
129
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
91
130
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
92
131
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
93
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::
|
|
132
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::RedditPost`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
94
133
|
end
|
|
95
134
|
h[k.to_sym] = v
|
|
96
135
|
}
|
|
@@ -99,12 +138,12 @@ module Late
|
|
|
99
138
|
self.id = attributes[:'id']
|
|
100
139
|
end
|
|
101
140
|
|
|
102
|
-
if attributes.key?(:'
|
|
103
|
-
self.
|
|
141
|
+
if attributes.key?(:'fullname')
|
|
142
|
+
self.fullname = attributes[:'fullname']
|
|
104
143
|
end
|
|
105
144
|
|
|
106
|
-
if attributes.key?(:'
|
|
107
|
-
self.
|
|
145
|
+
if attributes.key?(:'title')
|
|
146
|
+
self.title = attributes[:'title']
|
|
108
147
|
end
|
|
109
148
|
|
|
110
149
|
if attributes.key?(:'author')
|
|
@@ -115,6 +154,22 @@ module Late
|
|
|
115
154
|
self.subreddit = attributes[:'subreddit']
|
|
116
155
|
end
|
|
117
156
|
|
|
157
|
+
if attributes.key?(:'url')
|
|
158
|
+
self.url = attributes[:'url']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'permalink')
|
|
162
|
+
self.permalink = attributes[:'permalink']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'selftext')
|
|
166
|
+
self.selftext = attributes[:'selftext']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'created_utc')
|
|
170
|
+
self.created_utc = attributes[:'created_utc']
|
|
171
|
+
end
|
|
172
|
+
|
|
118
173
|
if attributes.key?(:'score')
|
|
119
174
|
self.score = attributes[:'score']
|
|
120
175
|
end
|
|
@@ -123,12 +178,26 @@ module Late
|
|
|
123
178
|
self.num_comments = attributes[:'num_comments']
|
|
124
179
|
end
|
|
125
180
|
|
|
126
|
-
if attributes.key?(:'
|
|
127
|
-
self.
|
|
181
|
+
if attributes.key?(:'over18')
|
|
182
|
+
self.over18 = attributes[:'over18']
|
|
128
183
|
end
|
|
129
184
|
|
|
130
|
-
if attributes.key?(:'
|
|
131
|
-
self.
|
|
185
|
+
if attributes.key?(:'stickied')
|
|
186
|
+
self.stickied = attributes[:'stickied']
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'flair_text')
|
|
190
|
+
self.flair_text = attributes[:'flair_text']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'is_gallery')
|
|
194
|
+
self.is_gallery = attributes[:'is_gallery']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'gallery_images')
|
|
198
|
+
if (value = attributes[:'gallery_images']).is_a?(Array)
|
|
199
|
+
self.gallery_images = value
|
|
200
|
+
end
|
|
132
201
|
end
|
|
133
202
|
end
|
|
134
203
|
|
|
@@ -153,14 +222,21 @@ module Late
|
|
|
153
222
|
return true if self.equal?(o)
|
|
154
223
|
self.class == o.class &&
|
|
155
224
|
id == o.id &&
|
|
225
|
+
fullname == o.fullname &&
|
|
156
226
|
title == o.title &&
|
|
157
|
-
selftext == o.selftext &&
|
|
158
227
|
author == o.author &&
|
|
159
228
|
subreddit == o.subreddit &&
|
|
229
|
+
url == o.url &&
|
|
230
|
+
permalink == o.permalink &&
|
|
231
|
+
selftext == o.selftext &&
|
|
232
|
+
created_utc == o.created_utc &&
|
|
160
233
|
score == o.score &&
|
|
161
234
|
num_comments == o.num_comments &&
|
|
162
|
-
|
|
163
|
-
|
|
235
|
+
over18 == o.over18 &&
|
|
236
|
+
stickied == o.stickied &&
|
|
237
|
+
flair_text == o.flair_text &&
|
|
238
|
+
is_gallery == o.is_gallery &&
|
|
239
|
+
gallery_images == o.gallery_images
|
|
164
240
|
end
|
|
165
241
|
|
|
166
242
|
# @see the `==` method
|
|
@@ -172,7 +248,7 @@ module Late
|
|
|
172
248
|
# Calculates hash code according to all attributes.
|
|
173
249
|
# @return [Integer] Hash code
|
|
174
250
|
def hash
|
|
175
|
-
[id,
|
|
251
|
+
[id, fullname, title, author, subreddit, url, permalink, selftext, created_utc, score, num_comments, over18, stickied, flair_text, is_gallery, gallery_images].hash
|
|
176
252
|
end
|
|
177
253
|
|
|
178
254
|
# Builds the object from hash
|
|
@@ -15,15 +15,18 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Late
|
|
17
17
|
class SearchReddit200Response < ApiModelBase
|
|
18
|
-
attr_accessor :
|
|
18
|
+
attr_accessor :items
|
|
19
19
|
|
|
20
20
|
attr_accessor :after
|
|
21
21
|
|
|
22
|
+
attr_accessor :before
|
|
23
|
+
|
|
22
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
25
|
def self.attribute_map
|
|
24
26
|
{
|
|
25
|
-
:'
|
|
26
|
-
:'after' => :'after'
|
|
27
|
+
:'items' => :'items',
|
|
28
|
+
:'after' => :'after',
|
|
29
|
+
:'before' => :'before'
|
|
27
30
|
}
|
|
28
31
|
end
|
|
29
32
|
|
|
@@ -40,8 +43,9 @@ module Late
|
|
|
40
43
|
# Attribute type mapping.
|
|
41
44
|
def self.openapi_types
|
|
42
45
|
{
|
|
43
|
-
:'
|
|
44
|
-
:'after' => :'String'
|
|
46
|
+
:'items' => :'Array<RedditPost>',
|
|
47
|
+
:'after' => :'String',
|
|
48
|
+
:'before' => :'String'
|
|
45
49
|
}
|
|
46
50
|
end
|
|
47
51
|
|
|
@@ -67,15 +71,19 @@ module Late
|
|
|
67
71
|
h[k.to_sym] = v
|
|
68
72
|
}
|
|
69
73
|
|
|
70
|
-
if attributes.key?(:'
|
|
71
|
-
if (value = attributes[:'
|
|
72
|
-
self.
|
|
74
|
+
if attributes.key?(:'items')
|
|
75
|
+
if (value = attributes[:'items']).is_a?(Array)
|
|
76
|
+
self.items = value
|
|
73
77
|
end
|
|
74
78
|
end
|
|
75
79
|
|
|
76
80
|
if attributes.key?(:'after')
|
|
77
81
|
self.after = attributes[:'after']
|
|
78
82
|
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'before')
|
|
85
|
+
self.before = attributes[:'before']
|
|
86
|
+
end
|
|
79
87
|
end
|
|
80
88
|
|
|
81
89
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -98,8 +106,9 @@ module Late
|
|
|
98
106
|
def ==(o)
|
|
99
107
|
return true if self.equal?(o)
|
|
100
108
|
self.class == o.class &&
|
|
101
|
-
|
|
102
|
-
after == o.after
|
|
109
|
+
items == o.items &&
|
|
110
|
+
after == o.after &&
|
|
111
|
+
before == o.before
|
|
103
112
|
end
|
|
104
113
|
|
|
105
114
|
# @see the `==` method
|
|
@@ -111,7 +120,7 @@ module Late
|
|
|
111
120
|
# Calculates hash code according to all attributes.
|
|
112
121
|
# @return [Integer] Hash code
|
|
113
122
|
def hash
|
|
114
|
-
[
|
|
123
|
+
[items, after, before].hash
|
|
115
124
|
end
|
|
116
125
|
|
|
117
126
|
# Builds the object from hash
|
data/lib/late-sdk/version.rb
CHANGED
data/lib/late-sdk.rb
CHANGED
|
@@ -308,7 +308,6 @@ require 'late-sdk/models/get_post_timeline404_response'
|
|
|
308
308
|
require 'late-sdk/models/get_posting_frequency200_response'
|
|
309
309
|
require 'late-sdk/models/get_posting_frequency200_response_frequency_inner'
|
|
310
310
|
require 'late-sdk/models/get_profile200_response'
|
|
311
|
-
require 'late-sdk/models/get_reddit_feed200_response'
|
|
312
311
|
require 'late-sdk/models/get_reddit_flairs200_response'
|
|
313
312
|
require 'late-sdk/models/get_reddit_flairs200_response_flairs_inner'
|
|
314
313
|
require 'late-sdk/models/get_reddit_subreddits200_response'
|
|
@@ -525,6 +524,7 @@ require 'late-sdk/models/queue_update_response'
|
|
|
525
524
|
require 'late-sdk/models/recycling_config'
|
|
526
525
|
require 'late-sdk/models/recycling_state'
|
|
527
526
|
require 'late-sdk/models/reddit_platform_data'
|
|
527
|
+
require 'late-sdk/models/reddit_post'
|
|
528
528
|
require 'late-sdk/models/reject_whats_app_group_join_requests_request'
|
|
529
529
|
require 'late-sdk/models/release_whats_app_phone_number200_response'
|
|
530
530
|
require 'late-sdk/models/release_whats_app_phone_number200_response_phone_number'
|
|
@@ -551,7 +551,6 @@ require 'late-sdk/models/schedule_whats_app_broadcast_request'
|
|
|
551
551
|
require 'late-sdk/models/search_ad_interests200_response'
|
|
552
552
|
require 'late-sdk/models/search_ad_interests200_response_interests_inner'
|
|
553
553
|
require 'late-sdk/models/search_reddit200_response'
|
|
554
|
-
require 'late-sdk/models/search_reddit200_response_posts_inner'
|
|
555
554
|
require 'late-sdk/models/select_facebook_page200_response'
|
|
556
555
|
require 'late-sdk/models/select_facebook_page200_response_account'
|
|
557
556
|
require 'late-sdk/models/select_facebook_page_request'
|