post-for-me 0.1.0.pre.alpha.8 → 0.1.0.pre.alpha.9

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +1 -1
  4. data/lib/post_for_me/errors.rb +25 -11
  5. data/lib/post_for_me/file_part.rb +10 -7
  6. data/lib/post_for_me/internal/transport/base_client.rb +11 -7
  7. data/lib/post_for_me/internal/transport/pooled_net_requester.rb +7 -10
  8. data/lib/post_for_me/internal/type/base_page.rb +1 -1
  9. data/lib/post_for_me/internal/type/file_input.rb +7 -4
  10. data/lib/post_for_me/internal/util.rb +3 -2
  11. data/lib/post_for_me/models/bluesky_configuration_dto.rb +87 -1
  12. data/lib/post_for_me/models/create_social_post.rb +221 -2
  13. data/lib/post_for_me/models/facebook_configuration_dto.rb +106 -2
  14. data/lib/post_for_me/models/instagram_configuration_dto.rb +104 -2
  15. data/lib/post_for_me/models/linkedin_configuration_dto.rb +87 -1
  16. data/lib/post_for_me/models/pinterest_configuration_dto.rb +87 -1
  17. data/lib/post_for_me/models/social_account_create_auth_url_params.rb +43 -1
  18. data/lib/post_for_me/models/social_post.rb +221 -2
  19. data/lib/post_for_me/models/threads_configuration_dto.rb +87 -1
  20. data/lib/post_for_me/models/tiktok_configuration.rb +96 -2
  21. data/lib/post_for_me/models/twitter_configuration_dto.rb +180 -2
  22. data/lib/post_for_me/models/youtube_configuration_dto.rb +87 -1
  23. data/lib/post_for_me/version.rb +1 -1
  24. data/rbi/post_for_me/errors.rbi +29 -2
  25. data/rbi/post_for_me/file_part.rbi +1 -1
  26. data/rbi/post_for_me/internal/transport/base_client.rbi +4 -5
  27. data/rbi/post_for_me/internal/type/base_page.rbi +1 -1
  28. data/rbi/post_for_me/internal/util.rbi +1 -1
  29. data/rbi/post_for_me/models/bluesky_configuration_dto.rbi +180 -0
  30. data/rbi/post_for_me/models/create_social_post.rbi +424 -0
  31. data/rbi/post_for_me/models/facebook_configuration_dto.rbi +198 -0
  32. data/rbi/post_for_me/models/instagram_configuration_dto.rbi +205 -3
  33. data/rbi/post_for_me/models/linkedin_configuration_dto.rbi +182 -0
  34. data/rbi/post_for_me/models/pinterest_configuration_dto.rbi +184 -0
  35. data/rbi/post_for_me/models/social_account_create_auth_url_params.rbi +104 -0
  36. data/rbi/post_for_me/models/social_post.rbi +414 -0
  37. data/rbi/post_for_me/models/threads_configuration_dto.rbi +180 -0
  38. data/rbi/post_for_me/models/tiktok_configuration.rbi +180 -0
  39. data/rbi/post_for_me/models/twitter_configuration_dto.rbi +390 -2
  40. data/rbi/post_for_me/models/youtube_configuration_dto.rbi +180 -0
  41. data/sig/post_for_me/errors.rbs +7 -0
  42. data/sig/post_for_me/file_part.rbs +1 -1
  43. data/sig/post_for_me/models/bluesky_configuration_dto.rbs +73 -1
  44. data/sig/post_for_me/models/create_social_post.rbs +180 -1
  45. data/sig/post_for_me/models/facebook_configuration_dto.rbs +83 -1
  46. data/sig/post_for_me/models/instagram_configuration_dto.rbs +86 -4
  47. data/sig/post_for_me/models/linkedin_configuration_dto.rbs +73 -1
  48. data/sig/post_for_me/models/pinterest_configuration_dto.rbs +73 -1
  49. data/sig/post_for_me/models/social_account_create_auth_url_params.rbs +37 -0
  50. data/sig/post_for_me/models/social_post.rbs +180 -1
  51. data/sig/post_for_me/models/threads_configuration_dto.rbs +73 -1
  52. data/sig/post_for_me/models/tiktok_configuration.rbs +78 -1
  53. data/sig/post_for_me/models/twitter_configuration_dto.rbs +163 -4
  54. data/sig/post_for_me/models/youtube_configuration_dto.rbs +73 -1
  55. metadata +2 -2
@@ -15,6 +15,14 @@ module PostForMe
15
15
  sig { returns(T.nilable(T.anything)) }
16
16
  attr_accessor :caption
17
17
 
18
+ # List of page ids to invite as collaborators for a Video Reel
19
+ sig { returns(T.nilable(T::Array[T::Array[T.anything]])) }
20
+ attr_accessor :collaborators
21
+
22
+ # Page id with a location that you want to tag the image or video with
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :location
25
+
18
26
  # Overrides the `media` from the post
19
27
  sig do
20
28
  returns(T.nilable(T::Array[PostForMe::FacebookConfigurationDto::Media]))
@@ -32,6 +40,8 @@ module PostForMe
32
40
  sig do
33
41
  params(
34
42
  caption: T.nilable(T.anything),
43
+ collaborators: T.nilable(T::Array[T::Array[T.anything]]),
44
+ location: T.nilable(String),
35
45
  media:
36
46
  T.nilable(
37
47
  T::Array[PostForMe::FacebookConfigurationDto::Media::OrHash]
@@ -43,6 +53,10 @@ module PostForMe
43
53
  def self.new(
44
54
  # Overrides the `caption` from the post
45
55
  caption: nil,
56
+ # List of page ids to invite as collaborators for a Video Reel
57
+ collaborators: nil,
58
+ # Page id with a location that you want to tag the image or video with
59
+ location: nil,
46
60
  # Overrides the `media` from the post
47
61
  media: nil,
48
62
  # Facebook post placement
@@ -54,6 +68,8 @@ module PostForMe
54
68
  override.returns(
55
69
  {
56
70
  caption: T.nilable(T.anything),
71
+ collaborators: T.nilable(T::Array[T::Array[T.anything]]),
72
+ location: T.nilable(String),
57
73
  media:
58
74
  T.nilable(T::Array[PostForMe::FacebookConfigurationDto::Media]),
59
75
  placement:
@@ -79,6 +95,14 @@ module PostForMe
79
95
  sig { returns(String) }
80
96
  attr_accessor :url
81
97
 
98
+ # List of tags to attach to the media
99
+ sig do
100
+ returns(
101
+ T.nilable(T::Array[PostForMe::FacebookConfigurationDto::Media::Tag])
102
+ )
103
+ end
104
+ attr_accessor :tags
105
+
82
106
  # Timestamp in milliseconds of frame to use as thumbnail for the media
83
107
  sig { returns(T.nilable(T.anything)) }
84
108
  attr_accessor :thumbnail_timestamp_ms
@@ -90,6 +114,12 @@ module PostForMe
90
114
  sig do
91
115
  params(
92
116
  url: String,
117
+ tags:
118
+ T.nilable(
119
+ T::Array[
120
+ PostForMe::FacebookConfigurationDto::Media::Tag::OrHash
121
+ ]
122
+ ),
93
123
  thumbnail_timestamp_ms: T.nilable(T.anything),
94
124
  thumbnail_url: T.nilable(T.anything)
95
125
  ).returns(T.attached_class)
@@ -97,6 +127,8 @@ module PostForMe
97
127
  def self.new(
98
128
  # Public URL of the media
99
129
  url:,
130
+ # List of tags to attach to the media
131
+ tags: nil,
100
132
  # Timestamp in milliseconds of frame to use as thumbnail for the media
101
133
  thumbnail_timestamp_ms: nil,
102
134
  # Public URL of the thumbnail for the media
@@ -108,6 +140,10 @@ module PostForMe
108
140
  override.returns(
109
141
  {
110
142
  url: String,
143
+ tags:
144
+ T.nilable(
145
+ T::Array[PostForMe::FacebookConfigurationDto::Media::Tag]
146
+ ),
111
147
  thumbnail_timestamp_ms: T.nilable(T.anything),
112
148
  thumbnail_url: T.nilable(T.anything)
113
149
  }
@@ -115,6 +151,168 @@ module PostForMe
115
151
  end
116
152
  def to_hash
117
153
  end
154
+
155
+ class Tag < PostForMe::Internal::Type::BaseModel
156
+ OrHash =
157
+ T.type_alias do
158
+ T.any(
159
+ PostForMe::FacebookConfigurationDto::Media::Tag,
160
+ PostForMe::Internal::AnyHash
161
+ )
162
+ end
163
+
164
+ # Facebook User ID, Instagram Username or Instagram product id to tag
165
+ sig { returns(String) }
166
+ attr_accessor :id
167
+
168
+ # The platform for the tags
169
+ sig do
170
+ returns(
171
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform::OrSymbol
172
+ )
173
+ end
174
+ attr_accessor :platform
175
+
176
+ # The type of tag, user to tag accounts, product to tag products (only supported
177
+ # for instagram)
178
+ sig do
179
+ returns(
180
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type::OrSymbol
181
+ )
182
+ end
183
+ attr_accessor :type
184
+
185
+ # Percentage distance from left edge of the image, Not required for videos or
186
+ # stories
187
+ sig { returns(T.nilable(Float)) }
188
+ attr_reader :x
189
+
190
+ sig { params(x: Float).void }
191
+ attr_writer :x
192
+
193
+ # Percentage distance from top edge of the image, Not required for videos or
194
+ # stories
195
+ sig { returns(T.nilable(Float)) }
196
+ attr_reader :y_
197
+
198
+ sig { params(y_: Float).void }
199
+ attr_writer :y_
200
+
201
+ sig do
202
+ params(
203
+ id: String,
204
+ platform:
205
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform::OrSymbol,
206
+ type:
207
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type::OrSymbol,
208
+ x: Float,
209
+ y_: Float
210
+ ).returns(T.attached_class)
211
+ end
212
+ def self.new(
213
+ # Facebook User ID, Instagram Username or Instagram product id to tag
214
+ id:,
215
+ # The platform for the tags
216
+ platform:,
217
+ # The type of tag, user to tag accounts, product to tag products (only supported
218
+ # for instagram)
219
+ type:,
220
+ # Percentage distance from left edge of the image, Not required for videos or
221
+ # stories
222
+ x: nil,
223
+ # Percentage distance from top edge of the image, Not required for videos or
224
+ # stories
225
+ y_: nil
226
+ )
227
+ end
228
+
229
+ sig do
230
+ override.returns(
231
+ {
232
+ id: String,
233
+ platform:
234
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform::OrSymbol,
235
+ type:
236
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type::OrSymbol,
237
+ x: Float,
238
+ y_: Float
239
+ }
240
+ )
241
+ end
242
+ def to_hash
243
+ end
244
+
245
+ # The platform for the tags
246
+ module Platform
247
+ extend PostForMe::Internal::Type::Enum
248
+
249
+ TaggedSymbol =
250
+ T.type_alias do
251
+ T.all(
252
+ Symbol,
253
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform
254
+ )
255
+ end
256
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
257
+
258
+ FACEBOOK =
259
+ T.let(
260
+ :facebook,
261
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform::TaggedSymbol
262
+ )
263
+ INSTAGRAM =
264
+ T.let(
265
+ :instagram,
266
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform::TaggedSymbol
267
+ )
268
+
269
+ sig do
270
+ override.returns(
271
+ T::Array[
272
+ PostForMe::FacebookConfigurationDto::Media::Tag::Platform::TaggedSymbol
273
+ ]
274
+ )
275
+ end
276
+ def self.values
277
+ end
278
+ end
279
+
280
+ # The type of tag, user to tag accounts, product to tag products (only supported
281
+ # for instagram)
282
+ module Type
283
+ extend PostForMe::Internal::Type::Enum
284
+
285
+ TaggedSymbol =
286
+ T.type_alias do
287
+ T.all(
288
+ Symbol,
289
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type
290
+ )
291
+ end
292
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
293
+
294
+ USER =
295
+ T.let(
296
+ :user,
297
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type::TaggedSymbol
298
+ )
299
+ PRODUCT =
300
+ T.let(
301
+ :product,
302
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type::TaggedSymbol
303
+ )
304
+
305
+ sig do
306
+ override.returns(
307
+ T::Array[
308
+ PostForMe::FacebookConfigurationDto::Media::Tag::Type::TaggedSymbol
309
+ ]
310
+ )
311
+ end
312
+ def self.values
313
+ end
314
+ end
315
+ end
118
316
  end
119
317
 
120
318
  # Facebook post placement
@@ -19,6 +19,10 @@ module PostForMe
19
19
  sig { returns(T.nilable(T::Array[String])) }
20
20
  attr_accessor :collaborators
21
21
 
22
+ # Page id with a location that you want to tag the image or video with
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :location
25
+
22
26
  # Overrides the `media` from the post
23
27
  sig do
24
28
  returns(
@@ -35,16 +39,24 @@ module PostForMe
35
39
  end
36
40
  attr_accessor :placement
37
41
 
42
+ # If false video posts will only be shown in the Reels tab
43
+ sig { returns(T.nilable(T::Boolean)) }
44
+ attr_accessor :share_to_feed
45
+
38
46
  sig do
39
47
  params(
40
48
  caption: T.nilable(T.anything),
41
49
  collaborators: T.nilable(T::Array[String]),
50
+ location: T.nilable(String),
42
51
  media:
43
52
  T.nilable(
44
53
  T::Array[PostForMe::InstagramConfigurationDto::Media::OrHash]
45
54
  ),
46
55
  placement:
47
- T.nilable(PostForMe::InstagramConfigurationDto::Placement::OrSymbol)
56
+ T.nilable(
57
+ PostForMe::InstagramConfigurationDto::Placement::OrSymbol
58
+ ),
59
+ share_to_feed: T.nilable(T::Boolean)
48
60
  ).returns(T.attached_class)
49
61
  end
50
62
  def self.new(
@@ -52,10 +64,14 @@ module PostForMe
52
64
  caption: nil,
53
65
  # Instagram usernames to be tagged as a collaborator
54
66
  collaborators: nil,
67
+ # Page id with a location that you want to tag the image or video with
68
+ location: nil,
55
69
  # Overrides the `media` from the post
56
70
  media: nil,
57
71
  # Instagram post placement
58
- placement: nil
72
+ placement: nil,
73
+ # If false video posts will only be shown in the Reels tab
74
+ share_to_feed: nil
59
75
  )
60
76
  end
61
77
 
@@ -64,12 +80,14 @@ module PostForMe
64
80
  {
65
81
  caption: T.nilable(T.anything),
66
82
  collaborators: T.nilable(T::Array[String]),
83
+ location: T.nilable(String),
67
84
  media:
68
85
  T.nilable(T::Array[PostForMe::InstagramConfigurationDto::Media]),
69
86
  placement:
70
87
  T.nilable(
71
88
  PostForMe::InstagramConfigurationDto::Placement::OrSymbol
72
- )
89
+ ),
90
+ share_to_feed: T.nilable(T::Boolean)
73
91
  }
74
92
  )
75
93
  end
@@ -89,6 +107,16 @@ module PostForMe
89
107
  sig { returns(String) }
90
108
  attr_accessor :url
91
109
 
110
+ # List of tags to attach to the media
111
+ sig do
112
+ returns(
113
+ T.nilable(
114
+ T::Array[PostForMe::InstagramConfigurationDto::Media::Tag]
115
+ )
116
+ )
117
+ end
118
+ attr_accessor :tags
119
+
92
120
  # Timestamp in milliseconds of frame to use as thumbnail for the media
93
121
  sig { returns(T.nilable(T.anything)) }
94
122
  attr_accessor :thumbnail_timestamp_ms
@@ -100,6 +128,12 @@ module PostForMe
100
128
  sig do
101
129
  params(
102
130
  url: String,
131
+ tags:
132
+ T.nilable(
133
+ T::Array[
134
+ PostForMe::InstagramConfigurationDto::Media::Tag::OrHash
135
+ ]
136
+ ),
103
137
  thumbnail_timestamp_ms: T.nilable(T.anything),
104
138
  thumbnail_url: T.nilable(T.anything)
105
139
  ).returns(T.attached_class)
@@ -107,6 +141,8 @@ module PostForMe
107
141
  def self.new(
108
142
  # Public URL of the media
109
143
  url:,
144
+ # List of tags to attach to the media
145
+ tags: nil,
110
146
  # Timestamp in milliseconds of frame to use as thumbnail for the media
111
147
  thumbnail_timestamp_ms: nil,
112
148
  # Public URL of the thumbnail for the media
@@ -118,6 +154,10 @@ module PostForMe
118
154
  override.returns(
119
155
  {
120
156
  url: String,
157
+ tags:
158
+ T.nilable(
159
+ T::Array[PostForMe::InstagramConfigurationDto::Media::Tag]
160
+ ),
121
161
  thumbnail_timestamp_ms: T.nilable(T.anything),
122
162
  thumbnail_url: T.nilable(T.anything)
123
163
  }
@@ -125,6 +165,168 @@ module PostForMe
125
165
  end
126
166
  def to_hash
127
167
  end
168
+
169
+ class Tag < PostForMe::Internal::Type::BaseModel
170
+ OrHash =
171
+ T.type_alias do
172
+ T.any(
173
+ PostForMe::InstagramConfigurationDto::Media::Tag,
174
+ PostForMe::Internal::AnyHash
175
+ )
176
+ end
177
+
178
+ # Facebook User ID, Instagram Username or Instagram product id to tag
179
+ sig { returns(String) }
180
+ attr_accessor :id
181
+
182
+ # The platform for the tags
183
+ sig do
184
+ returns(
185
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform::OrSymbol
186
+ )
187
+ end
188
+ attr_accessor :platform
189
+
190
+ # The type of tag, user to tag accounts, product to tag products (only supported
191
+ # for instagram)
192
+ sig do
193
+ returns(
194
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type::OrSymbol
195
+ )
196
+ end
197
+ attr_accessor :type
198
+
199
+ # Percentage distance from left edge of the image, Not required for videos or
200
+ # stories
201
+ sig { returns(T.nilable(Float)) }
202
+ attr_reader :x
203
+
204
+ sig { params(x: Float).void }
205
+ attr_writer :x
206
+
207
+ # Percentage distance from top edge of the image, Not required for videos or
208
+ # stories
209
+ sig { returns(T.nilable(Float)) }
210
+ attr_reader :y_
211
+
212
+ sig { params(y_: Float).void }
213
+ attr_writer :y_
214
+
215
+ sig do
216
+ params(
217
+ id: String,
218
+ platform:
219
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform::OrSymbol,
220
+ type:
221
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type::OrSymbol,
222
+ x: Float,
223
+ y_: Float
224
+ ).returns(T.attached_class)
225
+ end
226
+ def self.new(
227
+ # Facebook User ID, Instagram Username or Instagram product id to tag
228
+ id:,
229
+ # The platform for the tags
230
+ platform:,
231
+ # The type of tag, user to tag accounts, product to tag products (only supported
232
+ # for instagram)
233
+ type:,
234
+ # Percentage distance from left edge of the image, Not required for videos or
235
+ # stories
236
+ x: nil,
237
+ # Percentage distance from top edge of the image, Not required for videos or
238
+ # stories
239
+ y_: nil
240
+ )
241
+ end
242
+
243
+ sig do
244
+ override.returns(
245
+ {
246
+ id: String,
247
+ platform:
248
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform::OrSymbol,
249
+ type:
250
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type::OrSymbol,
251
+ x: Float,
252
+ y_: Float
253
+ }
254
+ )
255
+ end
256
+ def to_hash
257
+ end
258
+
259
+ # The platform for the tags
260
+ module Platform
261
+ extend PostForMe::Internal::Type::Enum
262
+
263
+ TaggedSymbol =
264
+ T.type_alias do
265
+ T.all(
266
+ Symbol,
267
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform
268
+ )
269
+ end
270
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
271
+
272
+ FACEBOOK =
273
+ T.let(
274
+ :facebook,
275
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform::TaggedSymbol
276
+ )
277
+ INSTAGRAM =
278
+ T.let(
279
+ :instagram,
280
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform::TaggedSymbol
281
+ )
282
+
283
+ sig do
284
+ override.returns(
285
+ T::Array[
286
+ PostForMe::InstagramConfigurationDto::Media::Tag::Platform::TaggedSymbol
287
+ ]
288
+ )
289
+ end
290
+ def self.values
291
+ end
292
+ end
293
+
294
+ # The type of tag, user to tag accounts, product to tag products (only supported
295
+ # for instagram)
296
+ module Type
297
+ extend PostForMe::Internal::Type::Enum
298
+
299
+ TaggedSymbol =
300
+ T.type_alias do
301
+ T.all(
302
+ Symbol,
303
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type
304
+ )
305
+ end
306
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
307
+
308
+ USER =
309
+ T.let(
310
+ :user,
311
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type::TaggedSymbol
312
+ )
313
+ PRODUCT =
314
+ T.let(
315
+ :product,
316
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type::TaggedSymbol
317
+ )
318
+
319
+ sig do
320
+ override.returns(
321
+ T::Array[
322
+ PostForMe::InstagramConfigurationDto::Media::Tag::Type::TaggedSymbol
323
+ ]
324
+ )
325
+ end
326
+ def self.values
327
+ end
328
+ end
329
+ end
128
330
  end
129
331
 
130
332
  # Instagram post placement