post-for-me 0.1.0.pre.alpha.10 → 0.1.0.pre.alpha.11

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/post_for_me/client.rb +4 -0
  5. data/lib/post_for_me/internal/transport/pooled_net_requester.rb +12 -10
  6. data/lib/post_for_me/internal/util.rb +7 -2
  7. data/lib/post_for_me/models/platform_post.rb +843 -0
  8. data/lib/post_for_me/models/social_account_create_auth_url_params.rb +245 -9
  9. data/lib/post_for_me/models/social_account_feed_list_params.rb +81 -0
  10. data/lib/post_for_me/models/social_account_feed_list_response.rb +58 -0
  11. data/lib/post_for_me/models.rb +4 -0
  12. data/lib/post_for_me/resources/social_account_feeds.rb +51 -0
  13. data/lib/post_for_me/resources/social_accounts.rb +8 -1
  14. data/lib/post_for_me/version.rb +1 -1
  15. data/lib/post_for_me.rb +5 -0
  16. data/manifest.yaml +1 -0
  17. data/rbi/post_for_me/client.rbi +3 -0
  18. data/rbi/post_for_me/models/platform_post.rbi +1287 -0
  19. data/rbi/post_for_me/models/social_account_create_auth_url_params.rbi +545 -15
  20. data/rbi/post_for_me/models/social_account_feed_list_params.rbi +157 -0
  21. data/rbi/post_for_me/models/social_account_feed_list_response.rbi +110 -0
  22. data/rbi/post_for_me/models.rbi +4 -0
  23. data/rbi/post_for_me/resources/social_account_feeds.rbi +51 -0
  24. data/rbi/post_for_me/resources/social_accounts.rbi +13 -0
  25. data/sig/post_for_me/client.rbs +2 -0
  26. data/sig/post_for_me/models/platform_post.rbs +660 -0
  27. data/sig/post_for_me/models/social_account_create_auth_url_params.rbs +193 -10
  28. data/sig/post_for_me/models/social_account_feed_list_params.rbs +75 -0
  29. data/sig/post_for_me/models/social_account_feed_list_response.rbs +54 -0
  30. data/sig/post_for_me/models.rbs +4 -0
  31. data/sig/post_for_me/resources/social_account_feeds.rbs +18 -0
  32. data/sig/post_for_me/resources/social_accounts.rbs +2 -0
  33. metadata +14 -2
@@ -0,0 +1,157 @@
1
+ # typed: strong
2
+
3
+ module PostForMe
4
+ module Models
5
+ class SocialAccountFeedListParams < PostForMe::Internal::Type::BaseModel
6
+ extend PostForMe::Internal::Type::RequestParameters::Converter
7
+ include PostForMe::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ PostForMe::SocialAccountFeedListParams,
13
+ PostForMe::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Cursor identifying next page of results
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :cursor
20
+
21
+ sig { params(cursor: String).void }
22
+ attr_writer :cursor
23
+
24
+ # Expand additional data in the response. Currently supports: "metrics" to include
25
+ # post analytics data.
26
+ sig do
27
+ returns(
28
+ T.nilable(
29
+ T::Array[PostForMe::SocialAccountFeedListParams::Expand::OrSymbol]
30
+ )
31
+ )
32
+ end
33
+ attr_reader :expand
34
+
35
+ sig do
36
+ params(
37
+ expand:
38
+ T::Array[PostForMe::SocialAccountFeedListParams::Expand::OrSymbol]
39
+ ).void
40
+ end
41
+ attr_writer :expand
42
+
43
+ # Filter by Post for Me Social Postexternal ID. Multiple values imply OR logic
44
+ # (e.g., ?external_post_id=xxxxxx&external_post_id=yyyyyy).
45
+ sig { returns(T.nilable(T::Array[String])) }
46
+ attr_reader :external_post_id
47
+
48
+ sig { params(external_post_id: T::Array[String]).void }
49
+ attr_writer :external_post_id
50
+
51
+ # Number of items to return; Note: some platforms will have different max limits,
52
+ # in the case the provided limit is over the platform's limit we will return the
53
+ # max allowed by the platform.
54
+ sig { returns(T.nilable(Float)) }
55
+ attr_reader :limit
56
+
57
+ sig { params(limit: Float).void }
58
+ attr_writer :limit
59
+
60
+ # Filter by the platform's id(s). Multiple values imply OR logic (e.g.,
61
+ # ?social_post_id=spr_xxxxxx&social_post_id=spr_yyyyyy).
62
+ sig { returns(T.nilable(T::Array[String])) }
63
+ attr_reader :platform_post_id
64
+
65
+ sig { params(platform_post_id: T::Array[String]).void }
66
+ attr_writer :platform_post_id
67
+
68
+ # Filter by Post for Me Social Post id(s). Multiple values imply OR logic (e.g.,
69
+ # ?social_post_id=sp_xxxxxx&social_post_id=sp_yyyyyy).
70
+ sig { returns(T.nilable(T::Array[String])) }
71
+ attr_reader :social_post_id
72
+
73
+ sig { params(social_post_id: T::Array[String]).void }
74
+ attr_writer :social_post_id
75
+
76
+ sig do
77
+ params(
78
+ cursor: String,
79
+ expand:
80
+ T::Array[PostForMe::SocialAccountFeedListParams::Expand::OrSymbol],
81
+ external_post_id: T::Array[String],
82
+ limit: Float,
83
+ platform_post_id: T::Array[String],
84
+ social_post_id: T::Array[String],
85
+ request_options: PostForMe::RequestOptions::OrHash
86
+ ).returns(T.attached_class)
87
+ end
88
+ def self.new(
89
+ # Cursor identifying next page of results
90
+ cursor: nil,
91
+ # Expand additional data in the response. Currently supports: "metrics" to include
92
+ # post analytics data.
93
+ expand: nil,
94
+ # Filter by Post for Me Social Postexternal ID. Multiple values imply OR logic
95
+ # (e.g., ?external_post_id=xxxxxx&external_post_id=yyyyyy).
96
+ external_post_id: nil,
97
+ # Number of items to return; Note: some platforms will have different max limits,
98
+ # in the case the provided limit is over the platform's limit we will return the
99
+ # max allowed by the platform.
100
+ limit: nil,
101
+ # Filter by the platform's id(s). Multiple values imply OR logic (e.g.,
102
+ # ?social_post_id=spr_xxxxxx&social_post_id=spr_yyyyyy).
103
+ platform_post_id: nil,
104
+ # Filter by Post for Me Social Post id(s). Multiple values imply OR logic (e.g.,
105
+ # ?social_post_id=sp_xxxxxx&social_post_id=sp_yyyyyy).
106
+ social_post_id: nil,
107
+ request_options: {}
108
+ )
109
+ end
110
+
111
+ sig do
112
+ override.returns(
113
+ {
114
+ cursor: String,
115
+ expand:
116
+ T::Array[
117
+ PostForMe::SocialAccountFeedListParams::Expand::OrSymbol
118
+ ],
119
+ external_post_id: T::Array[String],
120
+ limit: Float,
121
+ platform_post_id: T::Array[String],
122
+ social_post_id: T::Array[String],
123
+ request_options: PostForMe::RequestOptions
124
+ }
125
+ )
126
+ end
127
+ def to_hash
128
+ end
129
+
130
+ module Expand
131
+ extend PostForMe::Internal::Type::Enum
132
+
133
+ TaggedSymbol =
134
+ T.type_alias do
135
+ T.all(Symbol, PostForMe::SocialAccountFeedListParams::Expand)
136
+ end
137
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
138
+
139
+ METRICS =
140
+ T.let(
141
+ :metrics,
142
+ PostForMe::SocialAccountFeedListParams::Expand::TaggedSymbol
143
+ )
144
+
145
+ sig do
146
+ override.returns(
147
+ T::Array[
148
+ PostForMe::SocialAccountFeedListParams::Expand::TaggedSymbol
149
+ ]
150
+ )
151
+ end
152
+ def self.values
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
@@ -0,0 +1,110 @@
1
+ # typed: strong
2
+
3
+ module PostForMe
4
+ module Models
5
+ class SocialAccountFeedListResponse < PostForMe::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ PostForMe::Models::SocialAccountFeedListResponse,
10
+ PostForMe::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(T::Array[PostForMe::PlatformPost]) }
15
+ attr_accessor :data
16
+
17
+ sig { returns(PostForMe::Models::SocialAccountFeedListResponse::Meta) }
18
+ attr_reader :meta
19
+
20
+ sig do
21
+ params(
22
+ meta: PostForMe::Models::SocialAccountFeedListResponse::Meta::OrHash
23
+ ).void
24
+ end
25
+ attr_writer :meta
26
+
27
+ sig do
28
+ params(
29
+ data: T::Array[PostForMe::PlatformPost::OrHash],
30
+ meta: PostForMe::Models::SocialAccountFeedListResponse::Meta::OrHash
31
+ ).returns(T.attached_class)
32
+ end
33
+ def self.new(data:, meta:)
34
+ end
35
+
36
+ sig do
37
+ override.returns(
38
+ {
39
+ data: T::Array[PostForMe::PlatformPost],
40
+ meta: PostForMe::Models::SocialAccountFeedListResponse::Meta
41
+ }
42
+ )
43
+ end
44
+ def to_hash
45
+ end
46
+
47
+ class Meta < PostForMe::Internal::Type::BaseModel
48
+ OrHash =
49
+ T.type_alias do
50
+ T.any(
51
+ PostForMe::Models::SocialAccountFeedListResponse::Meta,
52
+ PostForMe::Internal::AnyHash
53
+ )
54
+ end
55
+
56
+ # Id representing the next page of items
57
+ sig { returns(String) }
58
+ attr_accessor :cursor
59
+
60
+ # Maximum number of items returned.
61
+ sig { returns(Float) }
62
+ attr_accessor :limit
63
+
64
+ # URL to the next page of results, or null if none.
65
+ sig { returns(T.nilable(String)) }
66
+ attr_accessor :next_
67
+
68
+ # Indicates if there are more results or not
69
+ sig { returns(T.nilable(T::Boolean)) }
70
+ attr_reader :has_more
71
+
72
+ sig { params(has_more: T::Boolean).void }
73
+ attr_writer :has_more
74
+
75
+ sig do
76
+ params(
77
+ cursor: String,
78
+ limit: Float,
79
+ next_: T.nilable(String),
80
+ has_more: T::Boolean
81
+ ).returns(T.attached_class)
82
+ end
83
+ def self.new(
84
+ # Id representing the next page of items
85
+ cursor:,
86
+ # Maximum number of items returned.
87
+ limit:,
88
+ # URL to the next page of results, or null if none.
89
+ next_:,
90
+ # Indicates if there are more results or not
91
+ has_more: nil
92
+ )
93
+ end
94
+
95
+ sig do
96
+ override.returns(
97
+ {
98
+ cursor: String,
99
+ limit: Float,
100
+ next_: T.nilable(String),
101
+ has_more: T::Boolean
102
+ }
103
+ )
104
+ end
105
+ def to_hash
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
@@ -17,6 +17,8 @@ module PostForMe
17
17
 
18
18
  PlatformConfigurationsDto = PostForMe::Models::PlatformConfigurationsDto
19
19
 
20
+ PlatformPost = PostForMe::Models::PlatformPost
21
+
20
22
  SocialAccount = PostForMe::Models::SocialAccount
21
23
 
22
24
  SocialAccountCreateAuthURLParams =
@@ -27,6 +29,8 @@ module PostForMe
27
29
  SocialAccountDisconnectParams =
28
30
  PostForMe::Models::SocialAccountDisconnectParams
29
31
 
32
+ SocialAccountFeedListParams = PostForMe::Models::SocialAccountFeedListParams
33
+
30
34
  SocialAccountListParams = PostForMe::Models::SocialAccountListParams
31
35
 
32
36
  SocialAccountRetrieveParams = PostForMe::Models::SocialAccountRetrieveParams
@@ -0,0 +1,51 @@
1
+ # typed: strong
2
+
3
+ module PostForMe
4
+ module Resources
5
+ class SocialAccountFeeds
6
+ # Get a paginated result for the social account based on the applied filters
7
+ sig do
8
+ params(
9
+ social_account_id: String,
10
+ cursor: String,
11
+ expand:
12
+ T::Array[PostForMe::SocialAccountFeedListParams::Expand::OrSymbol],
13
+ external_post_id: T::Array[String],
14
+ limit: Float,
15
+ platform_post_id: T::Array[String],
16
+ social_post_id: T::Array[String],
17
+ request_options: PostForMe::RequestOptions::OrHash
18
+ ).returns(PostForMe::Models::SocialAccountFeedListResponse)
19
+ end
20
+ def list(
21
+ # Social Account ID
22
+ social_account_id,
23
+ # Cursor identifying next page of results
24
+ cursor: nil,
25
+ # Expand additional data in the response. Currently supports: "metrics" to include
26
+ # post analytics data.
27
+ expand: nil,
28
+ # Filter by Post for Me Social Postexternal ID. Multiple values imply OR logic
29
+ # (e.g., ?external_post_id=xxxxxx&external_post_id=yyyyyy).
30
+ external_post_id: nil,
31
+ # Number of items to return; Note: some platforms will have different max limits,
32
+ # in the case the provided limit is over the platform's limit we will return the
33
+ # max allowed by the platform.
34
+ limit: nil,
35
+ # Filter by the platform's id(s). Multiple values imply OR logic (e.g.,
36
+ # ?social_post_id=spr_xxxxxx&social_post_id=spr_yyyyyy).
37
+ platform_post_id: nil,
38
+ # Filter by Post for Me Social Post id(s). Multiple values imply OR logic (e.g.,
39
+ # ?social_post_id=sp_xxxxxx&social_post_id=sp_yyyyyy).
40
+ social_post_id: nil,
41
+ request_options: {}
42
+ )
43
+ end
44
+
45
+ # @api private
46
+ sig { params(client: PostForMe::Client).returns(T.attached_class) }
47
+ def self.new(client:)
48
+ end
49
+ end
50
+ end
51
+ end
@@ -117,8 +117,13 @@ module PostForMe
117
117
  params(
118
118
  platform: String,
119
119
  external_id: String,
120
+ permissions:
121
+ T::Array[
122
+ PostForMe::SocialAccountCreateAuthURLParams::Permission::OrSymbol
123
+ ],
120
124
  platform_data:
121
125
  PostForMe::SocialAccountCreateAuthURLParams::PlatformData::OrHash,
126
+ redirect_url_override: String,
122
127
  request_options: PostForMe::RequestOptions::OrHash
123
128
  ).returns(PostForMe::Models::SocialAccountCreateAuthURLResponse)
124
129
  end
@@ -127,8 +132,16 @@ module PostForMe
127
132
  platform:,
128
133
  # Your unique identifier for the social account
129
134
  external_id: nil,
135
+ # List of permissions you want to allow. Will default to only post permissions.
136
+ # You must include the "feeds" permission to request an account feed and metrics
137
+ permissions: nil,
130
138
  # Additional data needed for the provider
131
139
  platform_data: nil,
140
+ # Override the default redirect URL for the OAuth flow. If provided, this URL will
141
+ # be used instead of our redirect URL. Make sure this URL is included in your
142
+ # app's authorized redirect urls. This override will not work when using our
143
+ # system credientals.
144
+ redirect_url_override: nil,
132
145
  request_options: {}
133
146
  )
134
147
  end
@@ -18,6 +18,8 @@ module PostForMe
18
18
 
19
19
  attr_reader social_accounts: PostForMe::Resources::SocialAccounts
20
20
 
21
+ attr_reader social_account_feeds: PostForMe::Resources::SocialAccountFeeds
22
+
21
23
  private def auth_headers: -> ::Hash[String, String]
22
24
 
23
25
  def initialize: (