post-for-me 0.1.0.pre.alpha.5 → 0.1.0.pre.alpha.7

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 +19 -0
  3. data/README.md +11 -9
  4. data/lib/post_for_me/models/bluesky_configuration_dto.rb +24 -0
  5. data/lib/post_for_me/models/create_social_post.rb +3 -372
  6. data/lib/post_for_me/models/facebook_configuration_dto.rb +46 -0
  7. data/lib/post_for_me/models/instagram_configuration_dto.rb +54 -0
  8. data/lib/post_for_me/models/linkedin_configuration_dto.rb +24 -0
  9. data/lib/post_for_me/models/pinterest_configuration_dto.rb +40 -0
  10. data/lib/post_for_me/models/platform_configurations_dto.rb +88 -0
  11. data/lib/post_for_me/models/social_account.rb +1 -1
  12. data/lib/post_for_me/models/social_account_create_auth_url_params.rb +9 -1
  13. data/lib/post_for_me/models/social_account_create_params.rb +105 -0
  14. data/lib/post_for_me/models/social_post.rb +197 -12
  15. data/lib/post_for_me/models/threads_configuration_dto.rb +45 -0
  16. data/lib/post_for_me/models/twitter_configuration_dto.rb +24 -0
  17. data/lib/post_for_me/models/youtube_configuration_dto.rb +32 -0
  18. data/lib/post_for_me/models.rb +20 -0
  19. data/lib/post_for_me/resources/social_accounts.rb +42 -1
  20. data/lib/post_for_me/resources/social_posts.rb +2 -2
  21. data/lib/post_for_me/version.rb +1 -1
  22. data/lib/post_for_me.rb +10 -0
  23. data/rbi/post_for_me/models/bluesky_configuration_dto.rbi +45 -0
  24. data/rbi/post_for_me/models/create_social_post.rbi +4 -863
  25. data/rbi/post_for_me/models/facebook_configuration_dto.rbi +101 -0
  26. data/rbi/post_for_me/models/instagram_configuration_dto.rbi +109 -0
  27. data/rbi/post_for_me/models/linkedin_configuration_dto.rbi +45 -0
  28. data/rbi/post_for_me/models/pinterest_configuration_dto.rbi +64 -0
  29. data/rbi/post_for_me/models/platform_configurations_dto.rbi +178 -0
  30. data/rbi/post_for_me/models/social_account_create_auth_url_params.rbi +11 -0
  31. data/rbi/post_for_me/models/social_account_create_params.rbi +185 -0
  32. data/rbi/post_for_me/models/social_post.rbi +328 -13
  33. data/rbi/post_for_me/models/threads_configuration_dto.rbi +94 -0
  34. data/rbi/post_for_me/models/twitter_configuration_dto.rbi +45 -0
  35. data/rbi/post_for_me/models/youtube_configuration_dto.rbi +56 -0
  36. data/rbi/post_for_me/models.rbi +20 -0
  37. data/rbi/post_for_me/resources/social_accounts.rbi +42 -0
  38. data/rbi/post_for_me/resources/social_posts.rbi +2 -6
  39. data/sig/post_for_me/models/bluesky_configuration_dto.rbs +15 -0
  40. data/sig/post_for_me/models/create_social_post.rbs +4 -278
  41. data/sig/post_for_me/models/facebook_configuration_dto.rbs +42 -0
  42. data/sig/post_for_me/models/instagram_configuration_dto.rbs +47 -0
  43. data/sig/post_for_me/models/linkedin_configuration_dto.rbs +15 -0
  44. data/sig/post_for_me/models/pinterest_configuration_dto.rbs +35 -0
  45. data/sig/post_for_me/models/platform_configurations_dto.rbs +65 -0
  46. data/sig/post_for_me/models/social_account_create_auth_url_params.rbs +7 -0
  47. data/sig/post_for_me/models/social_account_create_params.rbs +97 -0
  48. data/sig/post_for_me/models/social_post.rbs +155 -16
  49. data/sig/post_for_me/models/threads_configuration_dto.rbs +41 -0
  50. data/sig/post_for_me/models/twitter_configuration_dto.rbs +15 -0
  51. data/sig/post_for_me/models/youtube_configuration_dto.rbs +22 -0
  52. data/sig/post_for_me/models.rbs +20 -0
  53. data/sig/post_for_me/resources/social_accounts.rbs +14 -0
  54. data/sig/post_for_me/resources/social_posts.rbs +2 -2
  55. metadata +32 -2
@@ -3,6 +3,45 @@
3
3
  module PostForMe
4
4
  module Resources
5
5
  class SocialAccounts
6
+ # If a social account with the same platform and user_id already exists, it will
7
+ # be updated. If not, a new social account will be created.
8
+ #
9
+ # @overload create(access_token:, access_token_expires_at:, platform:, user_id:, external_id: nil, metadata: nil, refresh_token: nil, refresh_token_expires_at: nil, username: nil, request_options: {})
10
+ #
11
+ # @param access_token [String] The access token of the social account
12
+ #
13
+ # @param access_token_expires_at [Time] The access token expiration date of the social account
14
+ #
15
+ # @param platform [Symbol, PostForMe::Models::SocialAccountCreateParams::Platform] The platform of the social account
16
+ #
17
+ # @param user_id [String] The user id of the social account
18
+ #
19
+ # @param external_id [String, nil] The external id of the social account
20
+ #
21
+ # @param metadata [Object] The metadata of the social account
22
+ #
23
+ # @param refresh_token [String, nil] The refresh token of the social account
24
+ #
25
+ # @param refresh_token_expires_at [Time, nil] The refresh token expiration date of the social account
26
+ #
27
+ # @param username [String, nil] The platform's username of the social account
28
+ #
29
+ # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}, nil]
30
+ #
31
+ # @return [PostForMe::Models::SocialAccount]
32
+ #
33
+ # @see PostForMe::Models::SocialAccountCreateParams
34
+ def create(params)
35
+ parsed, options = PostForMe::SocialAccountCreateParams.dump_request(params)
36
+ @client.request(
37
+ method: :post,
38
+ path: "v1/social-accounts",
39
+ body: parsed,
40
+ model: PostForMe::SocialAccount,
41
+ options: options
42
+ )
43
+ end
44
+
6
45
  # Get social account by ID
7
46
  #
8
47
  # @overload retrieve(id, request_options: {})
@@ -89,10 +128,12 @@ module PostForMe
89
128
  # login/authorization page. Upon successful authentication, they are redirected
90
129
  # back to your application
91
130
  #
92
- # @overload create_auth_url(platform:, platform_data: nil, request_options: {})
131
+ # @overload create_auth_url(platform:, external_id: nil, platform_data: nil, request_options: {})
93
132
  #
94
133
  # @param platform [String] The social account provider
95
134
  #
135
+ # @param external_id [String] Your unique identifier for the social account
136
+ #
96
137
  # @param platform_data [PostForMe::Models::SocialAccountCreateAuthURLParams::PlatformData] Additional data needed for the provider
97
138
  #
98
139
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -22,7 +22,7 @@ module PostForMe
22
22
  #
23
23
  # @param media [Array<PostForMe::Models::CreateSocialPost::Media>, nil] Array of media URLs associated with the post
24
24
  #
25
- # @param platform_configurations [PostForMe::Models::CreateSocialPost::PlatformConfigurations, nil] Platform-specific configurations for the post
25
+ # @param platform_configurations [PostForMe::Models::PlatformConfigurationsDto, nil] Platform-specific configurations for the post
26
26
  #
27
27
  # @param scheduled_at [Time, nil] Scheduled date and time for the post, setting to null or undefined will post ins
28
28
  #
@@ -83,7 +83,7 @@ module PostForMe
83
83
  #
84
84
  # @param media [Array<PostForMe::Models::CreateSocialPost::Media>, nil] Array of media URLs associated with the post
85
85
  #
86
- # @param platform_configurations [PostForMe::Models::CreateSocialPost::PlatformConfigurations, nil] Platform-specific configurations for the post
86
+ # @param platform_configurations [PostForMe::Models::PlatformConfigurationsDto, nil] Platform-specific configurations for the post
87
87
  #
88
88
  # @param scheduled_at [Time, nil] Scheduled date and time for the post, setting to null or undefined will post ins
89
89
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostForMe
4
- VERSION = "0.1.0.pre.alpha.5"
4
+ VERSION = "0.1.0.pre.alpha.7"
5
5
  end
data/lib/post_for_me.rb CHANGED
@@ -51,11 +51,18 @@ require_relative "post_for_me/internal/transport/base_client"
51
51
  require_relative "post_for_me/internal/transport/pooled_net_requester"
52
52
  require_relative "post_for_me/client"
53
53
  require_relative "post_for_me/models/create_social_post"
54
+ require_relative "post_for_me/models/bluesky_configuration_dto"
55
+ require_relative "post_for_me/models/facebook_configuration_dto"
56
+ require_relative "post_for_me/models/instagram_configuration_dto"
57
+ require_relative "post_for_me/models/linkedin_configuration_dto"
54
58
  require_relative "post_for_me/models/media_create_upload_url_params"
55
59
  require_relative "post_for_me/models/media_create_upload_url_response"
60
+ require_relative "post_for_me/models/pinterest_configuration_dto"
61
+ require_relative "post_for_me/models/platform_configurations_dto"
56
62
  require_relative "post_for_me/models/social_account"
57
63
  require_relative "post_for_me/models/social_account_create_auth_url_params"
58
64
  require_relative "post_for_me/models/social_account_create_auth_url_response"
65
+ require_relative "post_for_me/models/social_account_create_params"
59
66
  require_relative "post_for_me/models/social_account_disconnect_params"
60
67
  require_relative "post_for_me/models/social_account_disconnect_response"
61
68
  require_relative "post_for_me/models/social_account_list_params"
@@ -74,7 +81,10 @@ require_relative "post_for_me/models/social_post_result_list_response"
74
81
  require_relative "post_for_me/models/social_post_result_retrieve_params"
75
82
  require_relative "post_for_me/models/social_post_retrieve_params"
76
83
  require_relative "post_for_me/models/social_post_update_params"
84
+ require_relative "post_for_me/models/threads_configuration_dto"
77
85
  require_relative "post_for_me/models/tiktok_configuration"
86
+ require_relative "post_for_me/models/twitter_configuration_dto"
87
+ require_relative "post_for_me/models/youtube_configuration_dto"
78
88
  require_relative "post_for_me/models"
79
89
  require_relative "post_for_me/resources/media"
80
90
  require_relative "post_for_me/resources/social_accounts"
@@ -0,0 +1,45 @@
1
+ # typed: strong
2
+
3
+ module PostForMe
4
+ module Models
5
+ class BlueskyConfigurationDto < PostForMe::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ PostForMe::BlueskyConfigurationDto,
10
+ PostForMe::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Overrides the `caption` from the post
15
+ sig { returns(T.nilable(T.anything)) }
16
+ attr_accessor :caption
17
+
18
+ # Overrides the `media` from the post
19
+ sig { returns(T.nilable(T::Array[String])) }
20
+ attr_accessor :media
21
+
22
+ sig do
23
+ params(
24
+ caption: T.nilable(T.anything),
25
+ media: T.nilable(T::Array[String])
26
+ ).returns(T.attached_class)
27
+ end
28
+ def self.new(
29
+ # Overrides the `caption` from the post
30
+ caption: nil,
31
+ # Overrides the `media` from the post
32
+ media: nil
33
+ )
34
+ end
35
+
36
+ sig do
37
+ override.returns(
38
+ { caption: T.nilable(T.anything), media: T.nilable(T::Array[String]) }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+ end
44
+ end
45
+ end