late-sdk 0.0.52 → 0.0.53
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 +32 -0
- data/docs/AnalyticsListResponsePostsInner.md +1 -1
- data/docs/AnalyticsSinglePostResponse.md +7 -1
- data/docs/AnalyticsSinglePostResponseMediaItemsInner.md +22 -0
- data/docs/BookmarkPost200Response.md +24 -0
- data/docs/BookmarkPostRequest.md +20 -0
- data/docs/CommentsApi.md +2 -2
- data/docs/FollowUser200Response.md +26 -0
- data/docs/FollowUserRequest.md +20 -0
- data/docs/GMBLocationDetailsApi.md +4 -4
- data/docs/GbpFreeFormServiceItemLabel.md +20 -0
- data/docs/GbpUpdateFreeFormServiceItemLabel.md +20 -0
- data/docs/GetGoogleBusinessLocationDetails200Response.md +5 -1
- data/docs/GetGoogleBusinessLocationDetails200ResponseCategories.md +20 -0
- data/docs/GetGoogleBusinessLocationDetails200ResponseCategoriesAdditionalCategoriesInner.md +20 -0
- data/docs/GetGoogleBusinessLocationDetails200ResponseCategoriesPrimaryCategory.md +20 -0
- data/docs/GetGoogleBusinessLocationDetails200ResponseServiceItemsInner.md +22 -0
- data/docs/GetGoogleBusinessLocationDetails200ResponseServiceItemsInnerFreeFormServiceItem.md +20 -0
- data/docs/GetGoogleBusinessLocationDetails200ResponseServiceItemsInnerPrice.md +22 -0
- data/docs/GetGoogleBusinessLocationDetails200ResponseServiceItemsInnerStructuredServiceItem.md +20 -0
- data/docs/RemoveBookmark200Response.md +24 -0
- data/docs/RetweetPost200Response.md +24 -0
- data/docs/RetweetPostRequest.md +20 -0
- data/docs/TwitterEngagementApi.md +433 -0
- data/docs/UndoRetweet200Response.md +24 -0
- data/docs/UnfollowUser200Response.md +24 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequest.md +6 -2
- data/docs/UpdateGoogleBusinessLocationDetailsRequestCategories.md +20 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequestCategoriesAdditionalCategoriesInner.md +18 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequestCategoriesPrimaryCategory.md +18 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequestServiceItemsInner.md +22 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequestServiceItemsInnerFreeFormServiceItem.md +20 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequestServiceItemsInnerPrice.md +22 -0
- data/docs/UpdateGoogleBusinessLocationDetailsRequestServiceItemsInnerStructuredServiceItem.md +20 -0
- data/lib/late-sdk/api/comments_api.rb +4 -4
- data/lib/late-sdk/api/gmb_location_details_api.rb +6 -6
- data/lib/late-sdk/api/twitter_engagement_api.rb +439 -0
- data/lib/late-sdk/models/analytics_list_response_posts_inner.rb +4 -3
- data/lib/late-sdk/models/analytics_single_post_response.rb +68 -4
- data/lib/late-sdk/models/analytics_single_post_response_media_items_inner.rb +201 -0
- data/lib/late-sdk/models/bookmark_post200_response.rb +174 -0
- data/lib/late-sdk/models/bookmark_post_request.rb +192 -0
- data/lib/late-sdk/models/follow_user200_response.rb +184 -0
- data/lib/late-sdk/models/follow_user_request.rb +192 -0
- data/lib/late-sdk/models/gbp_free_form_service_item_label.rb +156 -0
- data/lib/late-sdk/models/gbp_update_free_form_service_item_label.rb +158 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response.rb +25 -4
- data/lib/late-sdk/models/get_google_business_location_details200_response_categories.rb +159 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response_categories_additional_categories_inner.rb +156 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response_categories_primary_category.rb +158 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response_service_items_inner.rb +165 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response_service_items_inner_free_form_service_item.rb +156 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response_service_items_inner_price.rb +165 -0
- data/lib/late-sdk/models/get_google_business_location_details200_response_service_items_inner_structured_service_item.rb +156 -0
- data/lib/late-sdk/models/remove_bookmark200_response.rb +174 -0
- data/lib/late-sdk/models/retweet_post200_response.rb +174 -0
- data/lib/late-sdk/models/retweet_post_request.rb +192 -0
- data/lib/late-sdk/models/undo_retweet200_response.rb +174 -0
- data/lib/late-sdk/models/unfollow_user200_response.rb +174 -0
- data/lib/late-sdk/models/update_google_business_location_details_request.rb +26 -5
- data/lib/late-sdk/models/update_google_business_location_details_request_categories.rb +159 -0
- data/lib/late-sdk/models/update_google_business_location_details_request_categories_additional_categories_inner.rb +148 -0
- data/lib/late-sdk/models/update_google_business_location_details_request_categories_primary_category.rb +148 -0
- data/lib/late-sdk/models/update_google_business_location_details_request_service_items_inner.rb +165 -0
- data/lib/late-sdk/models/update_google_business_location_details_request_service_items_inner_free_form_service_item.rb +158 -0
- data/lib/late-sdk/models/update_google_business_location_details_request_service_items_inner_price.rb +169 -0
- data/lib/late-sdk/models/update_google_business_location_details_request_service_items_inner_structured_service_item.rb +159 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +27 -0
- data/openapi.yaml +406 -29
- data/spec/api/comments_api_spec.rb +2 -2
- data/spec/api/gmb_location_details_api_spec.rb +3 -3
- data/spec/api/twitter_engagement_api_spec.rb +110 -0
- data/spec/models/analytics_list_response_posts_inner_spec.rb +1 -1
- data/spec/models/analytics_single_post_response_media_items_inner_spec.rb +52 -0
- data/spec/models/analytics_single_post_response_spec.rb +22 -0
- data/spec/models/bookmark_post200_response_spec.rb +54 -0
- data/spec/models/bookmark_post_request_spec.rb +42 -0
- data/spec/models/follow_user200_response_spec.rb +60 -0
- data/spec/models/follow_user_request_spec.rb +42 -0
- data/spec/models/gbp_free_form_service_item_label_spec.rb +42 -0
- data/spec/models/gbp_update_free_form_service_item_label_spec.rb +42 -0
- data/spec/models/get_google_business_location_details200_response_categories_additional_categories_inner_spec.rb +42 -0
- data/spec/models/get_google_business_location_details200_response_categories_primary_category_spec.rb +42 -0
- data/spec/models/get_google_business_location_details200_response_categories_spec.rb +42 -0
- data/spec/models/get_google_business_location_details200_response_service_items_inner_free_form_service_item_spec.rb +42 -0
- data/spec/models/get_google_business_location_details200_response_service_items_inner_price_spec.rb +48 -0
- data/spec/models/get_google_business_location_details200_response_service_items_inner_spec.rb +48 -0
- data/spec/models/get_google_business_location_details200_response_service_items_inner_structured_service_item_spec.rb +42 -0
- data/spec/models/get_google_business_location_details200_response_spec.rb +12 -0
- data/spec/models/remove_bookmark200_response_spec.rb +54 -0
- data/spec/models/retweet_post200_response_spec.rb +54 -0
- data/spec/models/retweet_post_request_spec.rb +42 -0
- data/spec/models/undo_retweet200_response_spec.rb +54 -0
- data/spec/models/unfollow_user200_response_spec.rb +54 -0
- data/spec/models/update_google_business_location_details_request_categories_additional_categories_inner_spec.rb +36 -0
- data/spec/models/update_google_business_location_details_request_categories_primary_category_spec.rb +36 -0
- data/spec/models/update_google_business_location_details_request_categories_spec.rb +42 -0
- data/spec/models/update_google_business_location_details_request_service_items_inner_free_form_service_item_spec.rb +42 -0
- data/spec/models/update_google_business_location_details_request_service_items_inner_price_spec.rb +48 -0
- data/spec/models/update_google_business_location_details_request_service_items_inner_spec.rb +48 -0
- data/spec/models/update_google_business_location_details_request_service_items_inner_structured_service_item_spec.rb +42 -0
- data/spec/models/update_google_business_location_details_request_spec.rb +12 -0
- metadata +110 -2
|
@@ -20,11 +20,11 @@ module Late
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Get location details
|
|
23
|
-
# Returns detailed GBP location info (hours, description, phone, website, categories). Use readMask to request specific fields.
|
|
23
|
+
# Returns detailed GBP location info (hours, description, phone, website, categories, services). Use readMask to request specific fields.
|
|
24
24
|
# @param account_id [String] The Late account ID (from /v1/accounts)
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @option opts [String] :location_id Override which location to query. If omitted, uses the account's selected location. Use GET /gmb-locations to list valid IDs.
|
|
27
|
-
# @option opts [String] :read_mask Comma-separated fields to return. Available: name, title, phoneNumbers, categories, storefrontAddress, websiteUri, regularHours, specialHours, serviceArea, profile, openInfo, metadata, moreHours.
|
|
27
|
+
# @option opts [String] :read_mask Comma-separated fields to return. Available: name, title, phoneNumbers, categories, storefrontAddress, websiteUri, regularHours, specialHours, serviceArea, serviceItems, profile, openInfo, metadata, moreHours.
|
|
28
28
|
# @return [GetGoogleBusinessLocationDetails200Response]
|
|
29
29
|
def get_google_business_location_details(account_id, opts = {})
|
|
30
30
|
data, _status_code, _headers = get_google_business_location_details_with_http_info(account_id, opts)
|
|
@@ -32,11 +32,11 @@ module Late
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Get location details
|
|
35
|
-
# Returns detailed GBP location info (hours, description, phone, website, categories). Use readMask to request specific fields.
|
|
35
|
+
# Returns detailed GBP location info (hours, description, phone, website, categories, services). Use readMask to request specific fields.
|
|
36
36
|
# @param account_id [String] The Late account ID (from /v1/accounts)
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
38
|
# @option opts [String] :location_id Override which location to query. If omitted, uses the account's selected location. Use GET /gmb-locations to list valid IDs.
|
|
39
|
-
# @option opts [String] :read_mask Comma-separated fields to return. Available: name, title, phoneNumbers, categories, storefrontAddress, websiteUri, regularHours, specialHours, serviceArea, profile, openInfo, metadata, moreHours.
|
|
39
|
+
# @option opts [String] :read_mask Comma-separated fields to return. Available: name, title, phoneNumbers, categories, storefrontAddress, websiteUri, regularHours, specialHours, serviceArea, serviceItems, profile, openInfo, metadata, moreHours.
|
|
40
40
|
# @return [Array<(GetGoogleBusinessLocationDetails200Response, Integer, Hash)>] GetGoogleBusinessLocationDetails200Response data, response status code and response headers
|
|
41
41
|
def get_google_business_location_details_with_http_info(account_id, opts = {})
|
|
42
42
|
if @api_client.config.debugging
|
|
@@ -89,7 +89,7 @@ module Late
|
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
# Update location details
|
|
92
|
-
# Updates GBP location details
|
|
92
|
+
# Updates GBP location details. The updateMask field is required and specifies which fields to update. This endpoint proxies Google's Business Information API locations.patch, so any valid updateMask field is supported. Common fields: regularHours, specialHours, profile.description, websiteUri, phoneNumbers, categories, serviceItems.
|
|
93
93
|
# @param account_id [String] The Late account ID (from /v1/accounts)
|
|
94
94
|
# @param update_google_business_location_details_request [UpdateGoogleBusinessLocationDetailsRequest]
|
|
95
95
|
# @param [Hash] opts the optional parameters
|
|
@@ -101,7 +101,7 @@ module Late
|
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
# Update location details
|
|
104
|
-
# Updates GBP location details
|
|
104
|
+
# Updates GBP location details. The updateMask field is required and specifies which fields to update. This endpoint proxies Google's Business Information API locations.patch, so any valid updateMask field is supported. Common fields: regularHours, specialHours, profile.description, websiteUri, phoneNumbers, categories, serviceItems.
|
|
105
105
|
# @param account_id [String] The Late account ID (from /v1/accounts)
|
|
106
106
|
# @param update_google_business_location_details_request [UpdateGoogleBusinessLocationDetailsRequest]
|
|
107
107
|
# @param [Hash] opts the optional parameters
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Late API
|
|
3
|
+
|
|
4
|
+
#API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@getlate.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Late
|
|
16
|
+
class TwitterEngagementApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Bookmark a tweet
|
|
23
|
+
# Bookmark a tweet by ID. Requires X API Basic tier ($200/mo) or higher. Requires the bookmark.write OAuth scope. Rate limit: 50 requests per 15-min window.
|
|
24
|
+
# @param bookmark_post_request [BookmarkPostRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [BookmarkPost200Response]
|
|
27
|
+
def bookmark_post(bookmark_post_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = bookmark_post_with_http_info(bookmark_post_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Bookmark a tweet
|
|
33
|
+
# Bookmark a tweet by ID. Requires X API Basic tier ($200/mo) or higher. Requires the bookmark.write OAuth scope. Rate limit: 50 requests per 15-min window.
|
|
34
|
+
# @param bookmark_post_request [BookmarkPostRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(BookmarkPost200Response, Integer, Hash)>] BookmarkPost200Response data, response status code and response headers
|
|
37
|
+
def bookmark_post_with_http_info(bookmark_post_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.bookmark_post ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'bookmark_post_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && bookmark_post_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'bookmark_post_request' when calling TwitterEngagementApi.bookmark_post"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/twitter/bookmark'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(bookmark_post_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'BookmarkPost200Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"TwitterEngagementApi.bookmark_post",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#bookmark_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Follow a user
|
|
91
|
+
# Follow a user on X/Twitter. Requires X API Basic tier ($200/mo) or higher. Requires the follows.write OAuth scope. For protected accounts, a follow request is sent instead (pending_follow will be true).
|
|
92
|
+
# @param follow_user_request [FollowUserRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [FollowUser200Response]
|
|
95
|
+
def follow_user(follow_user_request, opts = {})
|
|
96
|
+
data, _status_code, _headers = follow_user_with_http_info(follow_user_request, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Follow a user
|
|
101
|
+
# Follow a user on X/Twitter. Requires X API Basic tier ($200/mo) or higher. Requires the follows.write OAuth scope. For protected accounts, a follow request is sent instead (pending_follow will be true).
|
|
102
|
+
# @param follow_user_request [FollowUserRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(FollowUser200Response, Integer, Hash)>] FollowUser200Response data, response status code and response headers
|
|
105
|
+
def follow_user_with_http_info(follow_user_request, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.follow_user ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'follow_user_request' is set
|
|
110
|
+
if @api_client.config.client_side_validation && follow_user_request.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'follow_user_request' when calling TwitterEngagementApi.follow_user"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/twitter/follow'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(follow_user_request)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'FollowUser200Response'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"TwitterEngagementApi.follow_user",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#follow_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Remove bookmark
|
|
159
|
+
# Remove a bookmark from a tweet.
|
|
160
|
+
# @param account_id [String]
|
|
161
|
+
# @param tweet_id [String] The ID of the tweet to unbookmark
|
|
162
|
+
# @param [Hash] opts the optional parameters
|
|
163
|
+
# @return [RemoveBookmark200Response]
|
|
164
|
+
def remove_bookmark(account_id, tweet_id, opts = {})
|
|
165
|
+
data, _status_code, _headers = remove_bookmark_with_http_info(account_id, tweet_id, opts)
|
|
166
|
+
data
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Remove bookmark
|
|
170
|
+
# Remove a bookmark from a tweet.
|
|
171
|
+
# @param account_id [String]
|
|
172
|
+
# @param tweet_id [String] The ID of the tweet to unbookmark
|
|
173
|
+
# @param [Hash] opts the optional parameters
|
|
174
|
+
# @return [Array<(RemoveBookmark200Response, Integer, Hash)>] RemoveBookmark200Response data, response status code and response headers
|
|
175
|
+
def remove_bookmark_with_http_info(account_id, tweet_id, opts = {})
|
|
176
|
+
if @api_client.config.debugging
|
|
177
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.remove_bookmark ...'
|
|
178
|
+
end
|
|
179
|
+
# verify the required parameter 'account_id' is set
|
|
180
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
181
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.remove_bookmark"
|
|
182
|
+
end
|
|
183
|
+
# verify the required parameter 'tweet_id' is set
|
|
184
|
+
if @api_client.config.client_side_validation && tweet_id.nil?
|
|
185
|
+
fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterEngagementApi.remove_bookmark"
|
|
186
|
+
end
|
|
187
|
+
# resource path
|
|
188
|
+
local_var_path = '/v1/twitter/bookmark'
|
|
189
|
+
|
|
190
|
+
# query parameters
|
|
191
|
+
query_params = opts[:query_params] || {}
|
|
192
|
+
query_params[:'accountId'] = account_id
|
|
193
|
+
query_params[:'tweetId'] = tweet_id
|
|
194
|
+
|
|
195
|
+
# header parameters
|
|
196
|
+
header_params = opts[:header_params] || {}
|
|
197
|
+
# HTTP header 'Accept' (if needed)
|
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
199
|
+
|
|
200
|
+
# form parameters
|
|
201
|
+
form_params = opts[:form_params] || {}
|
|
202
|
+
|
|
203
|
+
# http body (model)
|
|
204
|
+
post_body = opts[:debug_body]
|
|
205
|
+
|
|
206
|
+
# return_type
|
|
207
|
+
return_type = opts[:debug_return_type] || 'RemoveBookmark200Response'
|
|
208
|
+
|
|
209
|
+
# auth_names
|
|
210
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
211
|
+
|
|
212
|
+
new_options = opts.merge(
|
|
213
|
+
:operation => :"TwitterEngagementApi.remove_bookmark",
|
|
214
|
+
:header_params => header_params,
|
|
215
|
+
:query_params => query_params,
|
|
216
|
+
:form_params => form_params,
|
|
217
|
+
:body => post_body,
|
|
218
|
+
:auth_names => auth_names,
|
|
219
|
+
:return_type => return_type
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
223
|
+
if @api_client.config.debugging
|
|
224
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#remove_bookmark\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
225
|
+
end
|
|
226
|
+
return data, status_code, headers
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Retweet a post
|
|
230
|
+
# Retweet (repost) a tweet by ID. Requires X API Basic tier ($200/mo) or higher. Rate limit: 50 requests per 15-min window. Shares the 300/3hr creation limit with tweet creation.
|
|
231
|
+
# @param retweet_post_request [RetweetPostRequest]
|
|
232
|
+
# @param [Hash] opts the optional parameters
|
|
233
|
+
# @return [RetweetPost200Response]
|
|
234
|
+
def retweet_post(retweet_post_request, opts = {})
|
|
235
|
+
data, _status_code, _headers = retweet_post_with_http_info(retweet_post_request, opts)
|
|
236
|
+
data
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Retweet a post
|
|
240
|
+
# Retweet (repost) a tweet by ID. Requires X API Basic tier ($200/mo) or higher. Rate limit: 50 requests per 15-min window. Shares the 300/3hr creation limit with tweet creation.
|
|
241
|
+
# @param retweet_post_request [RetweetPostRequest]
|
|
242
|
+
# @param [Hash] opts the optional parameters
|
|
243
|
+
# @return [Array<(RetweetPost200Response, Integer, Hash)>] RetweetPost200Response data, response status code and response headers
|
|
244
|
+
def retweet_post_with_http_info(retweet_post_request, opts = {})
|
|
245
|
+
if @api_client.config.debugging
|
|
246
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.retweet_post ...'
|
|
247
|
+
end
|
|
248
|
+
# verify the required parameter 'retweet_post_request' is set
|
|
249
|
+
if @api_client.config.client_side_validation && retweet_post_request.nil?
|
|
250
|
+
fail ArgumentError, "Missing the required parameter 'retweet_post_request' when calling TwitterEngagementApi.retweet_post"
|
|
251
|
+
end
|
|
252
|
+
# resource path
|
|
253
|
+
local_var_path = '/v1/twitter/retweet'
|
|
254
|
+
|
|
255
|
+
# query parameters
|
|
256
|
+
query_params = opts[:query_params] || {}
|
|
257
|
+
|
|
258
|
+
# header parameters
|
|
259
|
+
header_params = opts[:header_params] || {}
|
|
260
|
+
# HTTP header 'Accept' (if needed)
|
|
261
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
262
|
+
# HTTP header 'Content-Type'
|
|
263
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
264
|
+
if !content_type.nil?
|
|
265
|
+
header_params['Content-Type'] = content_type
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# form parameters
|
|
269
|
+
form_params = opts[:form_params] || {}
|
|
270
|
+
|
|
271
|
+
# http body (model)
|
|
272
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(retweet_post_request)
|
|
273
|
+
|
|
274
|
+
# return_type
|
|
275
|
+
return_type = opts[:debug_return_type] || 'RetweetPost200Response'
|
|
276
|
+
|
|
277
|
+
# auth_names
|
|
278
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
279
|
+
|
|
280
|
+
new_options = opts.merge(
|
|
281
|
+
:operation => :"TwitterEngagementApi.retweet_post",
|
|
282
|
+
:header_params => header_params,
|
|
283
|
+
:query_params => query_params,
|
|
284
|
+
:form_params => form_params,
|
|
285
|
+
:body => post_body,
|
|
286
|
+
:auth_names => auth_names,
|
|
287
|
+
:return_type => return_type
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
291
|
+
if @api_client.config.debugging
|
|
292
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#retweet_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
293
|
+
end
|
|
294
|
+
return data, status_code, headers
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Undo retweet
|
|
298
|
+
# Undo a retweet (un-repost a tweet).
|
|
299
|
+
# @param account_id [String]
|
|
300
|
+
# @param tweet_id [String] The ID of the original tweet to un-retweet
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @return [UndoRetweet200Response]
|
|
303
|
+
def undo_retweet(account_id, tweet_id, opts = {})
|
|
304
|
+
data, _status_code, _headers = undo_retweet_with_http_info(account_id, tweet_id, opts)
|
|
305
|
+
data
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Undo retweet
|
|
309
|
+
# Undo a retweet (un-repost a tweet).
|
|
310
|
+
# @param account_id [String]
|
|
311
|
+
# @param tweet_id [String] The ID of the original tweet to un-retweet
|
|
312
|
+
# @param [Hash] opts the optional parameters
|
|
313
|
+
# @return [Array<(UndoRetweet200Response, Integer, Hash)>] UndoRetweet200Response data, response status code and response headers
|
|
314
|
+
def undo_retweet_with_http_info(account_id, tweet_id, opts = {})
|
|
315
|
+
if @api_client.config.debugging
|
|
316
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.undo_retweet ...'
|
|
317
|
+
end
|
|
318
|
+
# verify the required parameter 'account_id' is set
|
|
319
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
320
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.undo_retweet"
|
|
321
|
+
end
|
|
322
|
+
# verify the required parameter 'tweet_id' is set
|
|
323
|
+
if @api_client.config.client_side_validation && tweet_id.nil?
|
|
324
|
+
fail ArgumentError, "Missing the required parameter 'tweet_id' when calling TwitterEngagementApi.undo_retweet"
|
|
325
|
+
end
|
|
326
|
+
# resource path
|
|
327
|
+
local_var_path = '/v1/twitter/retweet'
|
|
328
|
+
|
|
329
|
+
# query parameters
|
|
330
|
+
query_params = opts[:query_params] || {}
|
|
331
|
+
query_params[:'accountId'] = account_id
|
|
332
|
+
query_params[:'tweetId'] = tweet_id
|
|
333
|
+
|
|
334
|
+
# header parameters
|
|
335
|
+
header_params = opts[:header_params] || {}
|
|
336
|
+
# HTTP header 'Accept' (if needed)
|
|
337
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
338
|
+
|
|
339
|
+
# form parameters
|
|
340
|
+
form_params = opts[:form_params] || {}
|
|
341
|
+
|
|
342
|
+
# http body (model)
|
|
343
|
+
post_body = opts[:debug_body]
|
|
344
|
+
|
|
345
|
+
# return_type
|
|
346
|
+
return_type = opts[:debug_return_type] || 'UndoRetweet200Response'
|
|
347
|
+
|
|
348
|
+
# auth_names
|
|
349
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
350
|
+
|
|
351
|
+
new_options = opts.merge(
|
|
352
|
+
:operation => :"TwitterEngagementApi.undo_retweet",
|
|
353
|
+
:header_params => header_params,
|
|
354
|
+
:query_params => query_params,
|
|
355
|
+
:form_params => form_params,
|
|
356
|
+
:body => post_body,
|
|
357
|
+
:auth_names => auth_names,
|
|
358
|
+
:return_type => return_type
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
362
|
+
if @api_client.config.debugging
|
|
363
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#undo_retweet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
364
|
+
end
|
|
365
|
+
return data, status_code, headers
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Unfollow a user
|
|
369
|
+
# Unfollow a user on X/Twitter.
|
|
370
|
+
# @param account_id [String]
|
|
371
|
+
# @param target_user_id [String] The Twitter ID of the user to unfollow
|
|
372
|
+
# @param [Hash] opts the optional parameters
|
|
373
|
+
# @return [UnfollowUser200Response]
|
|
374
|
+
def unfollow_user(account_id, target_user_id, opts = {})
|
|
375
|
+
data, _status_code, _headers = unfollow_user_with_http_info(account_id, target_user_id, opts)
|
|
376
|
+
data
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# Unfollow a user
|
|
380
|
+
# Unfollow a user on X/Twitter.
|
|
381
|
+
# @param account_id [String]
|
|
382
|
+
# @param target_user_id [String] The Twitter ID of the user to unfollow
|
|
383
|
+
# @param [Hash] opts the optional parameters
|
|
384
|
+
# @return [Array<(UnfollowUser200Response, Integer, Hash)>] UnfollowUser200Response data, response status code and response headers
|
|
385
|
+
def unfollow_user_with_http_info(account_id, target_user_id, opts = {})
|
|
386
|
+
if @api_client.config.debugging
|
|
387
|
+
@api_client.config.logger.debug 'Calling API: TwitterEngagementApi.unfollow_user ...'
|
|
388
|
+
end
|
|
389
|
+
# verify the required parameter 'account_id' is set
|
|
390
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
391
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling TwitterEngagementApi.unfollow_user"
|
|
392
|
+
end
|
|
393
|
+
# verify the required parameter 'target_user_id' is set
|
|
394
|
+
if @api_client.config.client_side_validation && target_user_id.nil?
|
|
395
|
+
fail ArgumentError, "Missing the required parameter 'target_user_id' when calling TwitterEngagementApi.unfollow_user"
|
|
396
|
+
end
|
|
397
|
+
# resource path
|
|
398
|
+
local_var_path = '/v1/twitter/follow'
|
|
399
|
+
|
|
400
|
+
# query parameters
|
|
401
|
+
query_params = opts[:query_params] || {}
|
|
402
|
+
query_params[:'accountId'] = account_id
|
|
403
|
+
query_params[:'targetUserId'] = target_user_id
|
|
404
|
+
|
|
405
|
+
# header parameters
|
|
406
|
+
header_params = opts[:header_params] || {}
|
|
407
|
+
# HTTP header 'Accept' (if needed)
|
|
408
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
409
|
+
|
|
410
|
+
# form parameters
|
|
411
|
+
form_params = opts[:form_params] || {}
|
|
412
|
+
|
|
413
|
+
# http body (model)
|
|
414
|
+
post_body = opts[:debug_body]
|
|
415
|
+
|
|
416
|
+
# return_type
|
|
417
|
+
return_type = opts[:debug_return_type] || 'UnfollowUser200Response'
|
|
418
|
+
|
|
419
|
+
# auth_names
|
|
420
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
421
|
+
|
|
422
|
+
new_options = opts.merge(
|
|
423
|
+
:operation => :"TwitterEngagementApi.unfollow_user",
|
|
424
|
+
:header_params => header_params,
|
|
425
|
+
:query_params => query_params,
|
|
426
|
+
:form_params => form_params,
|
|
427
|
+
:body => post_body,
|
|
428
|
+
:auth_names => auth_names,
|
|
429
|
+
:return_type => return_type
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
433
|
+
if @api_client.config.debugging
|
|
434
|
+
@api_client.config.logger.debug "API called: TwitterEngagementApi#unfollow_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
435
|
+
end
|
|
436
|
+
return data, status_code, headers
|
|
437
|
+
end
|
|
438
|
+
end
|
|
439
|
+
end
|
|
@@ -39,6 +39,7 @@ module Late
|
|
|
39
39
|
|
|
40
40
|
attr_accessor :media_type
|
|
41
41
|
|
|
42
|
+
# All media items for this post. Carousel posts contain one entry per slide.
|
|
42
43
|
attr_accessor :media_items
|
|
43
44
|
|
|
44
45
|
class EnumAttributeValidator
|
|
@@ -107,7 +108,7 @@ module Late
|
|
|
107
108
|
:'is_external' => :'Boolean',
|
|
108
109
|
:'thumbnail_url' => :'String',
|
|
109
110
|
:'media_type' => :'String',
|
|
110
|
-
:'media_items' => :'Array<
|
|
111
|
+
:'media_items' => :'Array<AnalyticsSinglePostResponseMediaItemsInner>'
|
|
111
112
|
}
|
|
112
113
|
end
|
|
113
114
|
|
|
@@ -202,7 +203,7 @@ module Late
|
|
|
202
203
|
# @return true if the model is valid
|
|
203
204
|
def valid?
|
|
204
205
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
205
|
-
media_type_validator = EnumAttributeValidator.new('String', ["image", "video", "gif", "document"])
|
|
206
|
+
media_type_validator = EnumAttributeValidator.new('String', ["image", "video", "gif", "document", "carousel", "text"])
|
|
206
207
|
return false unless media_type_validator.valid?(@media_type)
|
|
207
208
|
true
|
|
208
209
|
end
|
|
@@ -210,7 +211,7 @@ module Late
|
|
|
210
211
|
# Custom attribute writer method checking allowed values (enum).
|
|
211
212
|
# @param [Object] media_type Object to be assigned
|
|
212
213
|
def media_type=(media_type)
|
|
213
|
-
validator = EnumAttributeValidator.new('String', ["image", "video", "gif", "document"])
|
|
214
|
+
validator = EnumAttributeValidator.new('String', ["image", "video", "gif", "document", "carousel", "text"])
|
|
214
215
|
unless validator.valid?(media_type)
|
|
215
216
|
fail ArgumentError, "invalid value for \"media_type\", must be one of #{validator.allowable_values}."
|
|
216
217
|
end
|
|
@@ -35,6 +35,35 @@ module Late
|
|
|
35
35
|
|
|
36
36
|
attr_accessor :is_external
|
|
37
37
|
|
|
38
|
+
attr_accessor :thumbnail_url
|
|
39
|
+
|
|
40
|
+
attr_accessor :media_type
|
|
41
|
+
|
|
42
|
+
# All media items for this post. Carousel posts contain one entry per slide.
|
|
43
|
+
attr_accessor :media_items
|
|
44
|
+
|
|
45
|
+
class EnumAttributeValidator
|
|
46
|
+
attr_reader :datatype
|
|
47
|
+
attr_reader :allowable_values
|
|
48
|
+
|
|
49
|
+
def initialize(datatype, allowable_values)
|
|
50
|
+
@allowable_values = allowable_values.map do |value|
|
|
51
|
+
case datatype.to_s
|
|
52
|
+
when /Integer/i
|
|
53
|
+
value.to_i
|
|
54
|
+
when /Float/i
|
|
55
|
+
value.to_f
|
|
56
|
+
else
|
|
57
|
+
value
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def valid?(value)
|
|
63
|
+
!value || allowable_values.include?(value)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
38
67
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
68
|
def self.attribute_map
|
|
40
69
|
{
|
|
@@ -47,7 +76,10 @@ module Late
|
|
|
47
76
|
:'platform_analytics' => :'platformAnalytics',
|
|
48
77
|
:'platform' => :'platform',
|
|
49
78
|
:'platform_post_url' => :'platformPostUrl',
|
|
50
|
-
:'is_external' => :'isExternal'
|
|
79
|
+
:'is_external' => :'isExternal',
|
|
80
|
+
:'thumbnail_url' => :'thumbnailUrl',
|
|
81
|
+
:'media_type' => :'mediaType',
|
|
82
|
+
:'media_items' => :'mediaItems'
|
|
51
83
|
}
|
|
52
84
|
end
|
|
53
85
|
|
|
@@ -73,7 +105,10 @@ module Late
|
|
|
73
105
|
:'platform_analytics' => :'Array<PlatformAnalytics>',
|
|
74
106
|
:'platform' => :'String',
|
|
75
107
|
:'platform_post_url' => :'String',
|
|
76
|
-
:'is_external' => :'Boolean'
|
|
108
|
+
:'is_external' => :'Boolean',
|
|
109
|
+
:'thumbnail_url' => :'String',
|
|
110
|
+
:'media_type' => :'String',
|
|
111
|
+
:'media_items' => :'Array<AnalyticsSinglePostResponseMediaItemsInner>'
|
|
77
112
|
}
|
|
78
113
|
end
|
|
79
114
|
|
|
@@ -140,6 +175,20 @@ module Late
|
|
|
140
175
|
if attributes.key?(:'is_external')
|
|
141
176
|
self.is_external = attributes[:'is_external']
|
|
142
177
|
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'thumbnail_url')
|
|
180
|
+
self.thumbnail_url = attributes[:'thumbnail_url']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'media_type')
|
|
184
|
+
self.media_type = attributes[:'media_type']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'media_items')
|
|
188
|
+
if (value = attributes[:'media_items']).is_a?(Array)
|
|
189
|
+
self.media_items = value
|
|
190
|
+
end
|
|
191
|
+
end
|
|
143
192
|
end
|
|
144
193
|
|
|
145
194
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -154,9 +203,21 @@ module Late
|
|
|
154
203
|
# @return true if the model is valid
|
|
155
204
|
def valid?
|
|
156
205
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
206
|
+
media_type_validator = EnumAttributeValidator.new('String', ["image", "video", "carousel", "text"])
|
|
207
|
+
return false unless media_type_validator.valid?(@media_type)
|
|
157
208
|
true
|
|
158
209
|
end
|
|
159
210
|
|
|
211
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
212
|
+
# @param [Object] media_type Object to be assigned
|
|
213
|
+
def media_type=(media_type)
|
|
214
|
+
validator = EnumAttributeValidator.new('String', ["image", "video", "carousel", "text"])
|
|
215
|
+
unless validator.valid?(media_type)
|
|
216
|
+
fail ArgumentError, "invalid value for \"media_type\", must be one of #{validator.allowable_values}."
|
|
217
|
+
end
|
|
218
|
+
@media_type = media_type
|
|
219
|
+
end
|
|
220
|
+
|
|
160
221
|
# Checks equality by comparing each attribute.
|
|
161
222
|
# @param [Object] Object to be compared
|
|
162
223
|
def ==(o)
|
|
@@ -171,7 +232,10 @@ module Late
|
|
|
171
232
|
platform_analytics == o.platform_analytics &&
|
|
172
233
|
platform == o.platform &&
|
|
173
234
|
platform_post_url == o.platform_post_url &&
|
|
174
|
-
is_external == o.is_external
|
|
235
|
+
is_external == o.is_external &&
|
|
236
|
+
thumbnail_url == o.thumbnail_url &&
|
|
237
|
+
media_type == o.media_type &&
|
|
238
|
+
media_items == o.media_items
|
|
175
239
|
end
|
|
176
240
|
|
|
177
241
|
# @see the `==` method
|
|
@@ -183,7 +247,7 @@ module Late
|
|
|
183
247
|
# Calculates hash code according to all attributes.
|
|
184
248
|
# @return [Integer] Hash code
|
|
185
249
|
def hash
|
|
186
|
-
[post_id, status, content, scheduled_for, published_at, analytics, platform_analytics, platform, platform_post_url, is_external].hash
|
|
250
|
+
[post_id, status, content, scheduled_for, published_at, analytics, platform_analytics, platform, platform_post_url, is_external, thumbnail_url, media_type, media_items].hash
|
|
187
251
|
end
|
|
188
252
|
|
|
189
253
|
# Builds the object from hash
|