late-sdk 0.0.112 → 0.0.114

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.
data/openapi.yaml CHANGED
@@ -317,6 +317,29 @@ components:
317
317
  type: string
318
318
  example: Not found
319
319
  schemas:
320
+ RedditPost:
321
+ type: object
322
+ description: A normalized Reddit post returned by the feed and search endpoints
323
+ properties:
324
+ id: { type: string, description: Reddit post ID (without type prefix) }
325
+ fullname: { type: string, description: "Reddit fullname (e.g. t3_abc123)" }
326
+ title: { type: string }
327
+ author: { type: string }
328
+ subreddit: { type: string }
329
+ url: { type: string, description: Post URL (may be a gallery URL, external link, or self-post URL) }
330
+ permalink: { type: string, description: Full permalink to the Reddit post }
331
+ selftext: { type: string, description: Self-post body text (empty string for link posts) }
332
+ createdUtc: { type: number, description: Unix timestamp of post creation }
333
+ score: { type: integer }
334
+ numComments: { type: integer }
335
+ over18: { type: boolean, description: Whether the post is marked NSFW }
336
+ stickied: { type: boolean }
337
+ flairText: { type: string, nullable: true, description: Link flair text if set }
338
+ isGallery: { type: boolean, description: Whether the post is a gallery with multiple images }
339
+ galleryImages:
340
+ type: array
341
+ description: Individual image URLs for gallery posts (only present when isGallery is true)
342
+ items: { type: string, format: uri }
320
343
  ErrorResponse:
321
344
  type: object
322
345
  properties:
@@ -1674,7 +1697,7 @@ components:
1674
1697
  description: Reel title (only for contentType=reel). Separate from the caption/content field.
1675
1698
  firstComment:
1676
1699
  type: string
1677
- description: Optional first comment to post immediately after publishing (feed posts only, not stories or reels). Skipped when draft is true.
1700
+ description: Optional first comment to post immediately after publishing (feed posts and reels, not stories). Skipped when draft is true.
1678
1701
  pageId:
1679
1702
  type: string
1680
1703
  description: Target Facebook Page ID for multi-page posting. If omitted, uses the default page. Use GET /v1/accounts/{id}/facebook-page to list pages.
@@ -3109,7 +3132,7 @@ paths:
3109
3132
  description: |
3110
3133
  Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed).
3111
3134
 
3112
- Uses Reddit's public JSON API (no Reddit auth needed). Returns `exists: false` for private, banned, or nonexistent subreddits.
3135
+ 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.
3113
3136
  security:
3114
3137
  - bearerAuth: []
3115
3138
  parameters:
@@ -3120,6 +3143,11 @@ paths:
3120
3143
  schema:
3121
3144
  type: string
3122
3145
  example: "programming"
3146
+ - name: accountId
3147
+ in: query
3148
+ description: Reddit social account ID for authenticated lookup (recommended for reliable results)
3149
+ schema:
3150
+ type: string
3123
3151
  responses:
3124
3152
  "200":
3125
3153
  description: Subreddit lookup result
@@ -4850,33 +4878,31 @@ paths:
4850
4878
  schema:
4851
4879
  type: object
4852
4880
  properties:
4853
- posts:
4881
+ items:
4854
4882
  type: array
4855
4883
  items:
4856
- type: object
4857
- properties:
4858
- id: { type: string }
4859
- title: { type: string }
4860
- selftext: { type: string }
4861
- author: { type: string }
4862
- subreddit: { type: string }
4863
- score: { type: integer }
4864
- num_comments: { type: integer }
4865
- created_utc: { type: number }
4866
- permalink: { type: string }
4867
- after: { type: string }
4884
+ $ref: '#/components/schemas/RedditPost'
4885
+ after: { type: string, nullable: true }
4886
+ before: { type: string, nullable: true }
4868
4887
  example:
4869
- posts:
4888
+ items:
4870
4889
  - id: "1abc234"
4890
+ fullname: "t3_1abc234"
4871
4891
  title: "How to grow on social media in 2025"
4872
4892
  selftext: "Here are my tips..."
4873
4893
  author: "marketingpro"
4874
4894
  subreddit: "socialmedia"
4895
+ url: "https://www.reddit.com/r/socialmedia/comments/1abc234/"
4896
+ permalink: "https://www.reddit.com/r/socialmedia/comments/1abc234/how_to_grow/"
4875
4897
  score: 156
4876
- num_comments: 42
4877
- created_utc: 1730000000
4878
- permalink: "/r/socialmedia/comments/1abc234/how_to_grow/"
4898
+ numComments: 42
4899
+ createdUtc: 1730000000
4900
+ over18: false
4901
+ stickied: false
4902
+ flairText: null
4903
+ isGallery: false
4879
4904
  after: "t3_1abc234"
4905
+ before: null
4880
4906
  '400': { description: Missing params }
4881
4907
  '401': { $ref: '#/components/responses/Unauthorized' }
4882
4908
  '404': { description: Account not found }
@@ -4914,30 +4940,47 @@ paths:
4914
4940
  schema:
4915
4941
  type: object
4916
4942
  properties:
4917
- posts:
4943
+ items:
4918
4944
  type: array
4919
4945
  items:
4920
- type: object
4921
- after: { type: string }
4946
+ $ref: '#/components/schemas/RedditPost'
4947
+ after: { type: string, nullable: true }
4948
+ before: { type: string, nullable: true }
4922
4949
  example:
4923
- posts:
4950
+ items:
4924
4951
  - id: "1xyz789"
4952
+ fullname: "t3_1xyz789"
4925
4953
  title: "Top marketing trends this week"
4926
4954
  author: "trendwatcher"
4927
4955
  subreddit: "marketing"
4956
+ url: "https://www.reddit.com/r/marketing/comments/1xyz789/"
4957
+ permalink: "https://www.reddit.com/r/marketing/comments/1xyz789/top_marketing_trends/"
4928
4958
  score: 892
4929
- num_comments: 134
4930
- created_utc: 1730100000
4931
- permalink: "/r/marketing/comments/1xyz789/top_marketing_trends/"
4959
+ numComments: 134
4960
+ createdUtc: 1730100000
4961
+ over18: false
4962
+ stickied: false
4963
+ flairText: null
4964
+ isGallery: false
4932
4965
  - id: "1def456"
4933
- title: "My social media strategy that worked"
4966
+ fullname: "t3_1def456"
4967
+ title: "Check out my grow setup"
4934
4968
  author: "growthexpert"
4935
- subreddit: "marketing"
4969
+ subreddit: "gardening"
4970
+ url: "https://www.reddit.com/gallery/1def456"
4971
+ permalink: "https://www.reddit.com/r/gardening/comments/1def456/check_out_my_grow_setup/"
4936
4972
  score: 567
4937
- num_comments: 89
4938
- created_utc: 1730050000
4939
- permalink: "/r/marketing/comments/1def456/my_social_media_strategy/"
4973
+ numComments: 89
4974
+ createdUtc: 1730050000
4975
+ over18: false
4976
+ stickied: false
4977
+ flairText: null
4978
+ isGallery: true
4979
+ galleryImages:
4980
+ - "https://i.redd.it/abc123.jpg"
4981
+ - "https://i.redd.it/def456.jpg"
4940
4982
  after: "t3_1def456"
4983
+ before: null
4941
4984
  '400': { description: Missing params }
4942
4985
  '401': { $ref: '#/components/responses/Unauthorized' }
4943
4986
  '404': { description: Account not found }
@@ -42,7 +42,7 @@ describe 'RedditSearchApi' do
42
42
  # @option opts [Integer] :limit
43
43
  # @option opts [String] :after
44
44
  # @option opts [String] :t
45
- # @return [GetRedditFeed200Response]
45
+ # @return [SearchReddit200Response]
46
46
  describe 'get_reddit_feed test' do
47
47
  it 'should work' do
48
48
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -70,9 +70,10 @@ describe 'ValidateApi' do
70
70
 
71
71
  # unit tests for validate_subreddit
72
72
  # Check subreddit existence
73
- # Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). Uses Reddit's public JSON API (no Reddit auth needed). Returns `exists: false` for private, banned, or nonexistent subreddits.
73
+ # 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.
74
74
  # @param name Subreddit name (with or without \"r/\" prefix)
75
75
  # @param [Hash] opts the optional parameters
76
+ # @option opts [String] :account_id Reddit social account ID for authenticated lookup (recommended for reliable results)
76
77
  # @return [ValidateSubreddit200Response]
77
78
  describe 'validate_subreddit test' do
78
79
  it 'should work' do
@@ -14,16 +14,16 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for Late::SearchReddit200ResponsePostsInner
17
+ # Unit tests for Late::RedditPost
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe Late::SearchReddit200ResponsePostsInner do
21
- #let(:instance) { Late::SearchReddit200ResponsePostsInner.new }
20
+ describe Late::RedditPost do
21
+ #let(:instance) { Late::RedditPost.new }
22
22
 
23
- describe 'test an instance of SearchReddit200ResponsePostsInner' do
24
- it 'should create an instance of SearchReddit200ResponsePostsInner' do
23
+ describe 'test an instance of RedditPost' do
24
+ it 'should create an instance of RedditPost' do
25
25
  # uncomment below to test the instance creation
26
- #expect(instance).to be_instance_of(Late::SearchReddit200ResponsePostsInner)
26
+ #expect(instance).to be_instance_of(Late::RedditPost)
27
27
  end
28
28
  end
29
29
 
@@ -33,13 +33,13 @@ describe Late::SearchReddit200ResponsePostsInner do
33
33
  end
34
34
  end
35
35
 
36
- describe 'test attribute "title"' do
36
+ describe 'test attribute "fullname"' do
37
37
  it 'should work' do
38
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
39
  end
40
40
  end
41
41
 
42
- describe 'test attribute "selftext"' do
42
+ describe 'test attribute "title"' do
43
43
  it 'should work' do
44
44
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
45
  end
@@ -57,6 +57,30 @@ describe Late::SearchReddit200ResponsePostsInner do
57
57
  end
58
58
  end
59
59
 
60
+ describe 'test attribute "url"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
63
+ end
64
+ end
65
+
66
+ describe 'test attribute "permalink"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
69
+ end
70
+ end
71
+
72
+ describe 'test attribute "selftext"' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
+ end
76
+ end
77
+
78
+ describe 'test attribute "created_utc"' do
79
+ it 'should work' do
80
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
81
+ end
82
+ end
83
+
60
84
  describe 'test attribute "score"' do
61
85
  it 'should work' do
62
86
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -69,13 +93,31 @@ describe Late::SearchReddit200ResponsePostsInner do
69
93
  end
70
94
  end
71
95
 
72
- describe 'test attribute "created_utc"' do
96
+ describe 'test attribute "over18"' do
73
97
  it 'should work' do
74
98
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
99
  end
76
100
  end
77
101
 
78
- describe 'test attribute "permalink"' do
102
+ describe 'test attribute "stickied"' do
103
+ it 'should work' do
104
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
105
+ end
106
+ end
107
+
108
+ describe 'test attribute "flair_text"' do
109
+ it 'should work' do
110
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
111
+ end
112
+ end
113
+
114
+ describe 'test attribute "is_gallery"' do
115
+ it 'should work' do
116
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
117
+ end
118
+ end
119
+
120
+ describe 'test attribute "gallery_images"' do
79
121
  it 'should work' do
80
122
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
81
123
  end
@@ -27,7 +27,7 @@ describe Late::SearchReddit200Response do
27
27
  end
28
28
  end
29
29
 
30
- describe 'test attribute "posts"' do
30
+ describe 'test attribute "items"' do
31
31
  it 'should work' do
32
32
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
33
  end
@@ -39,4 +39,10 @@ describe Late::SearchReddit200Response do
39
39
  end
40
40
  end
41
41
 
42
+ describe 'test attribute "before"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
42
48
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: late-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.112
4
+ version: 0.0.114
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-04 00:00:00.000000000 Z
11
+ date: 2026-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -373,7 +373,6 @@ files:
373
373
  - docs/GetPostingFrequency200Response.md
374
374
  - docs/GetPostingFrequency200ResponseFrequencyInner.md
375
375
  - docs/GetProfile200Response.md
376
- - docs/GetRedditFeed200Response.md
377
376
  - docs/GetRedditFlairs200Response.md
378
377
  - docs/GetRedditFlairs200ResponseFlairsInner.md
379
378
  - docs/GetRedditSubreddits200Response.md
@@ -598,6 +597,7 @@ files:
598
597
  - docs/RecyclingConfig.md
599
598
  - docs/RecyclingState.md
600
599
  - docs/RedditPlatformData.md
600
+ - docs/RedditPost.md
601
601
  - docs/RedditSearchApi.md
602
602
  - docs/RejectWhatsAppGroupJoinRequestsRequest.md
603
603
  - docs/ReleaseWhatsAppPhoneNumber200Response.md
@@ -626,7 +626,6 @@ files:
626
626
  - docs/SearchAdInterests200Response.md
627
627
  - docs/SearchAdInterests200ResponseInterestsInner.md
628
628
  - docs/SearchReddit200Response.md
629
- - docs/SearchReddit200ResponsePostsInner.md
630
629
  - docs/SelectFacebookPage200Response.md
631
630
  - docs/SelectFacebookPage200ResponseAccount.md
632
631
  - docs/SelectFacebookPageRequest.md
@@ -1190,7 +1189,6 @@ files:
1190
1189
  - lib/late-sdk/models/get_posting_frequency200_response.rb
1191
1190
  - lib/late-sdk/models/get_posting_frequency200_response_frequency_inner.rb
1192
1191
  - lib/late-sdk/models/get_profile200_response.rb
1193
- - lib/late-sdk/models/get_reddit_feed200_response.rb
1194
1192
  - lib/late-sdk/models/get_reddit_flairs200_response.rb
1195
1193
  - lib/late-sdk/models/get_reddit_flairs200_response_flairs_inner.rb
1196
1194
  - lib/late-sdk/models/get_reddit_subreddits200_response.rb
@@ -1407,6 +1405,7 @@ files:
1407
1405
  - lib/late-sdk/models/recycling_config.rb
1408
1406
  - lib/late-sdk/models/recycling_state.rb
1409
1407
  - lib/late-sdk/models/reddit_platform_data.rb
1408
+ - lib/late-sdk/models/reddit_post.rb
1410
1409
  - lib/late-sdk/models/reject_whats_app_group_join_requests_request.rb
1411
1410
  - lib/late-sdk/models/release_whats_app_phone_number200_response.rb
1412
1411
  - lib/late-sdk/models/release_whats_app_phone_number200_response_phone_number.rb
@@ -1433,7 +1432,6 @@ files:
1433
1432
  - lib/late-sdk/models/search_ad_interests200_response.rb
1434
1433
  - lib/late-sdk/models/search_ad_interests200_response_interests_inner.rb
1435
1434
  - lib/late-sdk/models/search_reddit200_response.rb
1436
- - lib/late-sdk/models/search_reddit200_response_posts_inner.rb
1437
1435
  - lib/late-sdk/models/select_facebook_page200_response.rb
1438
1436
  - lib/late-sdk/models/select_facebook_page200_response_account.rb
1439
1437
  - lib/late-sdk/models/select_facebook_page_request.rb
@@ -1982,7 +1980,6 @@ files:
1982
1980
  - spec/models/get_posting_frequency200_response_frequency_inner_spec.rb
1983
1981
  - spec/models/get_posting_frequency200_response_spec.rb
1984
1982
  - spec/models/get_profile200_response_spec.rb
1985
- - spec/models/get_reddit_feed200_response_spec.rb
1986
1983
  - spec/models/get_reddit_flairs200_response_flairs_inner_spec.rb
1987
1984
  - spec/models/get_reddit_flairs200_response_spec.rb
1988
1985
  - spec/models/get_reddit_subreddits200_response_spec.rb
@@ -2199,6 +2196,7 @@ files:
2199
2196
  - spec/models/recycling_config_spec.rb
2200
2197
  - spec/models/recycling_state_spec.rb
2201
2198
  - spec/models/reddit_platform_data_spec.rb
2199
+ - spec/models/reddit_post_spec.rb
2202
2200
  - spec/models/reject_whats_app_group_join_requests_request_spec.rb
2203
2201
  - spec/models/release_whats_app_phone_number200_response_phone_number_spec.rb
2204
2202
  - spec/models/release_whats_app_phone_number200_response_spec.rb
@@ -2224,7 +2222,6 @@ files:
2224
2222
  - spec/models/schedule_whats_app_broadcast_request_spec.rb
2225
2223
  - spec/models/search_ad_interests200_response_interests_inner_spec.rb
2226
2224
  - spec/models/search_ad_interests200_response_spec.rb
2227
- - spec/models/search_reddit200_response_posts_inner_spec.rb
2228
2225
  - spec/models/search_reddit200_response_spec.rb
2229
2226
  - spec/models/select_facebook_page200_response_account_spec.rb
2230
2227
  - spec/models/select_facebook_page200_response_spec.rb
@@ -2442,7 +2439,7 @@ files:
2442
2439
  - spec/models/you_tube_scope_missing_response_scope_status_spec.rb
2443
2440
  - spec/models/you_tube_scope_missing_response_spec.rb
2444
2441
  - spec/spec_helper.rb
2445
- - zernio-sdk-0.0.112.gem
2442
+ - zernio-sdk-0.0.114.gem
2446
2443
  homepage: https://openapi-generator.tech
2447
2444
  licenses:
2448
2445
  - Unlicense
@@ -3060,7 +3057,6 @@ test_files:
3060
3057
  - spec/models/get_google_business_location_details200_response_service_items_inner_spec.rb
3061
3058
  - spec/models/handle_o_auth_callback_request_spec.rb
3062
3059
  - spec/models/search_reddit200_response_spec.rb
3063
- - spec/models/search_reddit200_response_posts_inner_spec.rb
3064
3060
  - spec/models/send_whats_app_flow_message_request_flow_action_payload_spec.rb
3065
3061
  - spec/models/create_sequence_request_steps_inner_template_variable_mapping_value_spec.rb
3066
3062
  - spec/models/list_ad_accounts200_response_spec.rb
@@ -3085,7 +3081,6 @@ test_files:
3085
3081
  - spec/models/get_linked_in_organizations200_response_organizations_inner_spec.rb
3086
3082
  - spec/models/get_whats_app_broadcasts200_response_spec.rb
3087
3083
  - spec/models/create_sequence_request_steps_inner_template_spec.rb
3088
- - spec/models/get_reddit_feed200_response_spec.rb
3089
3084
  - spec/models/list_broadcast_recipients200_response_recipients_inner_spec.rb
3090
3085
  - spec/models/bookmark_post_request_spec.rb
3091
3086
  - spec/models/list_comment_automation_logs200_response_spec.rb
@@ -3204,6 +3199,7 @@ test_files:
3204
3199
  - spec/models/get_ad_analytics200_response_analytics_spec.rb
3205
3200
  - spec/models/unpublish_post_request_spec.rb
3206
3201
  - spec/models/select_google_business_location200_response_account_spec.rb
3202
+ - spec/models/reddit_post_spec.rb
3207
3203
  - spec/models/ad_metrics_spec.rb
3208
3204
  - spec/models/analytics_overview_data_staleness_spec.rb
3209
3205
  - spec/models/ad_tree_ad_set_spec.rb
@@ -1,20 +0,0 @@
1
- # Late::GetRedditFeed200Response
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **posts** | **Array<Object>** | | [optional] |
8
- | **after** | **String** | | [optional] |
9
-
10
- ## Example
11
-
12
- ```ruby
13
- require 'late-sdk'
14
-
15
- instance = Late::GetRedditFeed200Response.new(
16
- posts: null,
17
- after: null
18
- )
19
- ```
20
-
@@ -1,34 +0,0 @@
1
- # Late::SearchReddit200ResponsePostsInner
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **id** | **String** | | [optional] |
8
- | **title** | **String** | | [optional] |
9
- | **selftext** | **String** | | [optional] |
10
- | **author** | **String** | | [optional] |
11
- | **subreddit** | **String** | | [optional] |
12
- | **score** | **Integer** | | [optional] |
13
- | **num_comments** | **Integer** | | [optional] |
14
- | **created_utc** | **Float** | | [optional] |
15
- | **permalink** | **String** | | [optional] |
16
-
17
- ## Example
18
-
19
- ```ruby
20
- require 'late-sdk'
21
-
22
- instance = Late::SearchReddit200ResponsePostsInner.new(
23
- id: null,
24
- title: null,
25
- selftext: null,
26
- author: null,
27
- subreddit: null,
28
- score: null,
29
- num_comments: null,
30
- created_utc: null,
31
- permalink: null
32
- )
33
- ```
34
-
@@ -1,158 +0,0 @@
1
- =begin
2
- #Zernio API
3
-
4
- #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
-
6
- The version of the OpenAPI document: 1.0.1
7
- Contact: support@zernio.com
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.19.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Late
17
- class GetRedditFeed200Response < ApiModelBase
18
- attr_accessor :posts
19
-
20
- attr_accessor :after
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'posts' => :'posts',
26
- :'after' => :'after'
27
- }
28
- end
29
-
30
- # Returns attribute mapping this model knows about
31
- def self.acceptable_attribute_map
32
- attribute_map
33
- end
34
-
35
- # Returns all the JSON keys this model knows about
36
- def self.acceptable_attributes
37
- acceptable_attribute_map.values
38
- end
39
-
40
- # Attribute type mapping.
41
- def self.openapi_types
42
- {
43
- :'posts' => :'Array<Object>',
44
- :'after' => :'String'
45
- }
46
- end
47
-
48
- # List of attributes with nullable: true
49
- def self.openapi_nullable
50
- Set.new([
51
- ])
52
- end
53
-
54
- # Initializes the object
55
- # @param [Hash] attributes Model attributes in the form of hash
56
- def initialize(attributes = {})
57
- if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetRedditFeed200Response` initialize method"
59
- end
60
-
61
- # check to see if the attribute exists and convert string to symbol for hash key
62
- acceptable_attribute_map = self.class.acceptable_attribute_map
63
- attributes = attributes.each_with_object({}) { |(k, v), h|
64
- if (!acceptable_attribute_map.key?(k.to_sym))
65
- fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetRedditFeed200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
- end
67
- h[k.to_sym] = v
68
- }
69
-
70
- if attributes.key?(:'posts')
71
- if (value = attributes[:'posts']).is_a?(Array)
72
- self.posts = value
73
- end
74
- end
75
-
76
- if attributes.key?(:'after')
77
- self.after = attributes[:'after']
78
- end
79
- end
80
-
81
- # Show invalid properties with the reasons. Usually used together with valid?
82
- # @return Array for valid properties with the reasons
83
- def list_invalid_properties
84
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
- invalid_properties = Array.new
86
- invalid_properties
87
- end
88
-
89
- # Check to see if the all the properties in the model are valid
90
- # @return true if the model is valid
91
- def valid?
92
- warn '[DEPRECATED] the `valid?` method is obsolete'
93
- true
94
- end
95
-
96
- # Checks equality by comparing each attribute.
97
- # @param [Object] Object to be compared
98
- def ==(o)
99
- return true if self.equal?(o)
100
- self.class == o.class &&
101
- posts == o.posts &&
102
- after == o.after
103
- end
104
-
105
- # @see the `==` method
106
- # @param [Object] Object to be compared
107
- def eql?(o)
108
- self == o
109
- end
110
-
111
- # Calculates hash code according to all attributes.
112
- # @return [Integer] Hash code
113
- def hash
114
- [posts, after].hash
115
- end
116
-
117
- # Builds the object from hash
118
- # @param [Hash] attributes Model attributes in the form of hash
119
- # @return [Object] Returns the model itself
120
- def self.build_from_hash(attributes)
121
- return nil unless attributes.is_a?(Hash)
122
- attributes = attributes.transform_keys(&:to_sym)
123
- transformed_hash = {}
124
- openapi_types.each_pair do |key, type|
125
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
- transformed_hash["#{key}"] = nil
127
- elsif type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the attribute
129
- # is documented as an array but the input is not
130
- if attributes[attribute_map[key]].is_a?(Array)
131
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
- end
133
- elsif !attributes[attribute_map[key]].nil?
134
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
- end
136
- end
137
- new(transformed_hash)
138
- end
139
-
140
- # Returns the object in the form of hash
141
- # @return [Hash] Returns the object in the form of hash
142
- def to_hash
143
- hash = {}
144
- self.class.attribute_map.each_pair do |attr, param|
145
- value = self.send(attr)
146
- if value.nil?
147
- is_nullable = self.class.openapi_nullable.include?(attr)
148
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
- end
150
-
151
- hash[param] = _to_hash(value)
152
- end
153
- hash
154
- end
155
-
156
- end
157
-
158
- end