late-sdk 0.0.910 → 0.0.912
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 +3 -0
- data/docs/CreateCommentAutomationRequest.md +1 -1
- data/docs/DownloadTikTokVideo200Response.md +30 -0
- data/docs/DownloadTikTokVideo200ResponseFormatsInner.md +34 -0
- data/docs/GetInboxPostComments200ResponseCommentsInner.md +1 -1
- data/docs/LeadGenApi.md +2 -2
- data/docs/LikeInboxComment200Response.md +4 -0
- data/docs/LikePost200Response.md +5 -1
- data/docs/ToolsApi.md +83 -0
- data/lib/zernio-sdk/api/lead_gen_api.rb +10 -2
- data/lib/zernio-sdk/api/tools_api.rb +96 -0
- data/lib/zernio-sdk/models/create_comment_automation_request.rb +22 -1
- data/lib/zernio-sdk/models/download_tik_tok_video200_response.rb +242 -0
- data/lib/zernio-sdk/models/download_tik_tok_video200_response_formats_inner.rb +219 -0
- data/lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb +1 -1
- data/lib/zernio-sdk/models/like_inbox_comment200_response.rb +21 -1
- data/lib/zernio-sdk/models/like_post200_response.rb +24 -4
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -0
- data/openapi.yaml +133 -3
- data/spec/api/lead_gen_api_spec.rb +1 -1
- data/spec/api/tools_api_spec.rb +49 -0
- data/spec/models/download_tik_tok_video200_response_formats_inner_spec.rb +84 -0
- data/spec/models/download_tik_tok_video200_response_spec.rb +72 -0
- data/spec/models/like_inbox_comment200_response_spec.rb +12 -0
- data/spec/models/like_post200_response_spec.rb +12 -0
- data/zernio-sdk-0.0.912.gem +0 -0
- metadata +14 -2
- data/zernio-sdk-0.0.910.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65646410c1f9d86e5027bdc7148dcf2298cc8ea4ee9f20d7672581ee74f897b3
|
|
4
|
+
data.tar.gz: 54217672f8f2f751bf7c39c98630e06125127ecb038d6f1dc84cbf25c7087dd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e47f2c88476391e6e7bbef95e6a399231a5e940c96728a8c4fe8fbe89a04d31ef4a3b89669fb17fd34b65a37e6f5cb27cc5e35e811e0a9a87d2023e981bde68
|
|
7
|
+
data.tar.gz: 4ff1403b30bd9b4017661cb56365bb3e5225d2d71fd6dae443e471bcd1c6af5e78b372006af365767eee8561d2f0114703bbc6a9827935ee060566a55b644bdb
|
data/README.md
CHANGED
|
@@ -628,6 +628,7 @@ Class | Method | HTTP request | Description
|
|
|
628
628
|
*Zernio::SequencesApi* | [**unenroll_contact**](docs/SequencesApi.md#unenroll_contact) | **DELETE** /v1/sequences/{sequenceId}/enroll/{contactId} | Unenroll contact
|
|
629
629
|
*Zernio::SequencesApi* | [**update_sequence**](docs/SequencesApi.md#update_sequence) | **PATCH** /v1/sequences/{sequenceId} | Update sequence
|
|
630
630
|
*Zernio::SlackApi* | [**list_slack_members**](docs/SlackApi.md#list_slack_members) | **GET** /v1/accounts/{accountId}/slack-members | List Slack workspace members
|
|
631
|
+
*Zernio::ToolsApi* | [**download_tik_tok_video**](docs/ToolsApi.md#download_tik_tok_video) | **GET** /v1/tools/tiktok/download | Download a TikTok video
|
|
631
632
|
*Zernio::TrackingTagsApi* | [**add_tracking_tag_shared_account**](docs/TrackingTagsApi.md#add_tracking_tag_shared_account) | **POST** /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts | Share with an ad account
|
|
632
633
|
*Zernio::TrackingTagsApi* | [**create_tracking_tag**](docs/TrackingTagsApi.md#create_tracking_tag) | **POST** /v1/accounts/{accountId}/tracking-tags | Create a tracking tag
|
|
633
634
|
*Zernio::TrackingTagsApi* | [**get_ad_tracking_tags**](docs/TrackingTagsApi.md#get_ad_tracking_tags) | **GET** /v1/ads/{adId}/tracking-tags | Get ad tracking tags
|
|
@@ -1276,6 +1277,8 @@ Class | Method | HTTP request | Description
|
|
|
1276
1277
|
- [Zernio::DiscordScheduledEvent](docs/DiscordScheduledEvent.md)
|
|
1277
1278
|
- [Zernio::DiscordScheduledEventEntityMetadata](docs/DiscordScheduledEventEntityMetadata.md)
|
|
1278
1279
|
- [Zernio::DmButton](docs/DmButton.md)
|
|
1280
|
+
- [Zernio::DownloadTikTokVideo200Response](docs/DownloadTikTokVideo200Response.md)
|
|
1281
|
+
- [Zernio::DownloadTikTokVideo200ResponseFormatsInner](docs/DownloadTikTokVideo200ResponseFormatsInner.md)
|
|
1279
1282
|
- [Zernio::DuplicateAd200Response](docs/DuplicateAd200Response.md)
|
|
1280
1283
|
- [Zernio::DuplicateAdCampaign200Response](docs/DuplicateAdCampaign200Response.md)
|
|
1281
1284
|
- [Zernio::DuplicateAdCampaignRequest](docs/DuplicateAdCampaignRequest.md)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
| **account_id** | **String** | Instagram or Facebook account ID | |
|
|
9
9
|
| **trigger** | **String** | What fires the automation. 'comment' (keyword comment on a post) or 'story_reply' (keyword reply to an Instagram story). For 'story_reply', platformPostId is the story media id (omit for any story). | [optional][default to 'comment'] |
|
|
10
10
|
| **platform_post_id** | **String** | Platform media/post ID (or story media id when trigger=story_reply). Omit for an account-wide (any-post / any-story) automation. | [optional] |
|
|
11
|
-
| **post_id** | **String** | Zernio post ID. Optional and never required. Use it INSTEAD of platformPostId to bind a per-post automation to a not-yet-published Zernio post: the automation stays pending and arms itself when that post publishes. For a post already live on the platform, pass platformPostId alone and omit this. | [optional] |
|
|
11
|
+
| **post_id** | **String** | Zernio post ID (24 hexadecimal characters); platform IDs return 400. Optional and never required. Use it INSTEAD of platformPostId to bind a per-post automation to a not-yet-published Zernio post: the automation stays pending and arms itself when that post publishes. For a post already live on the platform, pass platformPostId alone and omit this. | [optional] |
|
|
12
12
|
| **post_title** | **String** | Post content snippet for display | [optional] |
|
|
13
13
|
| **name** | **String** | Automation label | |
|
|
14
14
|
| **keywords** | **Array<String>** | Trigger keywords (empty = any comment triggers) | [optional] |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Zernio::DownloadTikTokVideo200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **success** | **Boolean** | | |
|
|
8
|
+
| **title** | **String** | | |
|
|
9
|
+
| **format** | **String** | Selected format label for action=download. | [optional] |
|
|
10
|
+
| **download_url** | **String** | Media download URL for action=download. | [optional] |
|
|
11
|
+
| **duration** | **Float** | Duration in seconds for action=formats. | [optional] |
|
|
12
|
+
| **cover** | **String** | Thumbnail URL for action=formats. | [optional] |
|
|
13
|
+
| **formats** | [**Array<DownloadTikTokVideo200ResponseFormatsInner>**](DownloadTikTokVideo200ResponseFormatsInner.md) | Available formats for action=formats. | [optional] |
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'zernio-sdk'
|
|
19
|
+
|
|
20
|
+
instance = Zernio::DownloadTikTokVideo200Response.new(
|
|
21
|
+
success: null,
|
|
22
|
+
title: null,
|
|
23
|
+
format: null,
|
|
24
|
+
download_url: null,
|
|
25
|
+
duration: null,
|
|
26
|
+
cover: null,
|
|
27
|
+
formats: null
|
|
28
|
+
)
|
|
29
|
+
```
|
|
30
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Zernio::DownloadTikTokVideo200ResponseFormatsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | [optional] |
|
|
8
|
+
| **label** | **String** | | [optional] |
|
|
9
|
+
| **ext** | **String** | | [optional] |
|
|
10
|
+
| **type** | **String** | | [optional] |
|
|
11
|
+
| **height** | **Float** | | [optional] |
|
|
12
|
+
| **width** | **Float** | | [optional] |
|
|
13
|
+
| **fps** | **Float** | | [optional] |
|
|
14
|
+
| **has_audio** | **Boolean** | | [optional] |
|
|
15
|
+
| **has_video** | **Boolean** | | [optional] |
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
require 'zernio-sdk'
|
|
21
|
+
|
|
22
|
+
instance = Zernio::DownloadTikTokVideo200ResponseFormatsInner.new(
|
|
23
|
+
id: null,
|
|
24
|
+
label: null,
|
|
25
|
+
ext: null,
|
|
26
|
+
type: null,
|
|
27
|
+
height: null,
|
|
28
|
+
width: null,
|
|
29
|
+
fps: null,
|
|
30
|
+
has_audio: null,
|
|
31
|
+
has_video: null
|
|
32
|
+
)
|
|
33
|
+
```
|
|
34
|
+
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| **can_reply** | **Boolean** | | [optional] |
|
|
18
18
|
| **can_delete** | **Boolean** | | [optional] |
|
|
19
19
|
| **can_hide** | **Boolean** | Whether this comment can be hidden (Facebook, Instagram, Threads) | [optional] |
|
|
20
|
-
| **can_like** | **Boolean** | Whether this comment can be liked (Facebook, X, Bluesky, Reddit) | [optional] |
|
|
20
|
+
| **can_like** | **Boolean** | Whether this comment can be liked (Facebook, X, Bluesky, Reddit, LinkedIn) | [optional] |
|
|
21
21
|
| **is_hidden** | **Boolean** | Whether the comment is currently hidden | [optional] |
|
|
22
22
|
| **is_liked** | **Boolean** | Whether the current user has liked this comment | [optional] |
|
|
23
23
|
| **like_uri** | **String** | Bluesky like URI for unliking | [optional] |
|
data/docs/LeadGenApi.md
CHANGED
|
@@ -474,7 +474,7 @@ opts = {
|
|
|
474
474
|
account_id: 'account_id_example', # String | Filter to a single connected account. LinkedIn ads accounts switch to the live fetch.
|
|
475
475
|
ad_account_id: 'ad_account_id_example', # String | LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder).
|
|
476
476
|
limit: 56, # Integer |
|
|
477
|
-
since:
|
|
477
|
+
since: 1757404800, # Integer | Unix seconds; only leads created at/after this timestamp. Millisecond timestamps return 400 with instructions to divide by 1000.
|
|
478
478
|
cursor: 'cursor_example' # String | Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset).
|
|
479
479
|
}
|
|
480
480
|
|
|
@@ -513,7 +513,7 @@ end
|
|
|
513
513
|
| **account_id** | **String** | Filter to a single connected account. LinkedIn ads accounts switch to the live fetch. | [optional] |
|
|
514
514
|
| **ad_account_id** | **String** | LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder). | [optional] |
|
|
515
515
|
| **limit** | **Integer** | | [optional][default to 25] |
|
|
516
|
-
| **since** | **Integer** | Unix seconds; only leads created at/after this timestamp. | [optional] |
|
|
516
|
+
| **since** | **Integer** | Unix seconds; only leads created at/after this timestamp. Millisecond timestamps return 400 with instructions to divide by 1000. | [optional] |
|
|
517
517
|
| **cursor** | **String** | Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset). | [optional] |
|
|
518
518
|
|
|
519
519
|
### Return type
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
| **comment_id** | **String** | | [optional] |
|
|
9
9
|
| **liked** | **Boolean** | | [optional] |
|
|
10
10
|
| **like_uri** | **String** | (Bluesky only) URI to use for unliking | [optional] |
|
|
11
|
+
| **already_reacted** | **Boolean** | LinkedIn only: the account already had this exact reaction, so nothing was created | [optional] |
|
|
12
|
+
| **reaction_type** | **String** | LinkedIn only: the reaction type now in effect | [optional] |
|
|
11
13
|
| **platform** | **String** | | [optional] |
|
|
12
14
|
|
|
13
15
|
## Example
|
|
@@ -20,6 +22,8 @@ instance = Zernio::LikeInboxComment200Response.new(
|
|
|
20
22
|
comment_id: null,
|
|
21
23
|
liked: null,
|
|
22
24
|
like_uri: null,
|
|
25
|
+
already_reacted: null,
|
|
26
|
+
reaction_type: null,
|
|
23
27
|
platform: null
|
|
24
28
|
)
|
|
25
29
|
```
|
data/docs/LikePost200Response.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
| **platform** | **String** | | [optional] |
|
|
10
10
|
| **liked** | **Boolean** | | [optional] |
|
|
11
11
|
| **like_uri** | **String** | (Bluesky only) URI to use for unliking | [optional] |
|
|
12
|
+
| **already_reacted** | **Boolean** | LinkedIn only: the account already had this exact reaction, so nothing was created | [optional] |
|
|
13
|
+
| **reaction_type** | **String** | LinkedIn only: the reaction type now in effect | [optional] |
|
|
12
14
|
|
|
13
15
|
## Example
|
|
14
16
|
|
|
@@ -20,7 +22,9 @@ instance = Zernio::LikePost200Response.new(
|
|
|
20
22
|
post_id: null,
|
|
21
23
|
platform: null,
|
|
22
24
|
liked: null,
|
|
23
|
-
like_uri: null
|
|
25
|
+
like_uri: null,
|
|
26
|
+
already_reacted: null,
|
|
27
|
+
reaction_type: null
|
|
24
28
|
)
|
|
25
29
|
```
|
|
26
30
|
|
data/docs/ToolsApi.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Zernio::ToolsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://zernio.com/api*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**download_tik_tok_video**](ToolsApi.md#download_tik_tok_video) | **GET** /v1/tools/tiktok/download | Download a TikTok video |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## download_tik_tok_video
|
|
11
|
+
|
|
12
|
+
> <DownloadTikTokVideo200Response> download_tik_tok_video(url, opts)
|
|
13
|
+
|
|
14
|
+
Download a TikTok video
|
|
15
|
+
|
|
16
|
+
Get a download URL or list available formats for a TikTok video. Requires Tools API access and uses the Tools API rate limit. Provider gateway failures and provider-side access blocks return 503; an unavailable video returns 404.
|
|
17
|
+
|
|
18
|
+
### Examples
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
require 'time'
|
|
22
|
+
require 'zernio-sdk'
|
|
23
|
+
# setup authorization
|
|
24
|
+
Zernio.configure do |config|
|
|
25
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
26
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
api_instance = Zernio::ToolsApi.new
|
|
30
|
+
url = 'https://www.tiktok.com/@example/video/7412345678901234567' # String | TikTok video URL or numeric video ID.
|
|
31
|
+
opts = {
|
|
32
|
+
action: 'download', # String | Return a download URL or the available formats.
|
|
33
|
+
format_id: 'format_id_example' # String | Format ID from the formats response. Omit to select the first available format.
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
begin
|
|
37
|
+
# Download a TikTok video
|
|
38
|
+
result = api_instance.download_tik_tok_video(url, opts)
|
|
39
|
+
p result
|
|
40
|
+
rescue Zernio::ApiError => e
|
|
41
|
+
puts "Error when calling ToolsApi->download_tik_tok_video: #{e}"
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Using the download_tik_tok_video_with_http_info variant
|
|
46
|
+
|
|
47
|
+
This returns an Array which contains the response data, status code and headers.
|
|
48
|
+
|
|
49
|
+
> <Array(<DownloadTikTokVideo200Response>, Integer, Hash)> download_tik_tok_video_with_http_info(url, opts)
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
begin
|
|
53
|
+
# Download a TikTok video
|
|
54
|
+
data, status_code, headers = api_instance.download_tik_tok_video_with_http_info(url, opts)
|
|
55
|
+
p status_code # => 2xx
|
|
56
|
+
p headers # => { ... }
|
|
57
|
+
p data # => <DownloadTikTokVideo200Response>
|
|
58
|
+
rescue Zernio::ApiError => e
|
|
59
|
+
puts "Error when calling ToolsApi->download_tik_tok_video_with_http_info: #{e}"
|
|
60
|
+
end
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
| Name | Type | Description | Notes |
|
|
66
|
+
| ---- | ---- | ----------- | ----- |
|
|
67
|
+
| **url** | **String** | TikTok video URL or numeric video ID. | |
|
|
68
|
+
| **action** | **String** | Return a download URL or the available formats. | [optional][default to 'download'] |
|
|
69
|
+
| **format_id** | **String** | Format ID from the formats response. Omit to select the first available format. | [optional] |
|
|
70
|
+
|
|
71
|
+
### Return type
|
|
72
|
+
|
|
73
|
+
[**DownloadTikTokVideo200Response**](DownloadTikTokVideo200Response.md)
|
|
74
|
+
|
|
75
|
+
### Authorization
|
|
76
|
+
|
|
77
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
78
|
+
|
|
79
|
+
### HTTP request headers
|
|
80
|
+
|
|
81
|
+
- **Content-Type**: Not defined
|
|
82
|
+
- **Accept**: application/json
|
|
83
|
+
|
|
@@ -474,7 +474,7 @@ module Zernio
|
|
|
474
474
|
# @option opts [String] :account_id Filter to a single connected account. LinkedIn ads accounts switch to the live fetch.
|
|
475
475
|
# @option opts [String] :ad_account_id LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder).
|
|
476
476
|
# @option opts [Integer] :limit (default to 25)
|
|
477
|
-
# @option opts [Integer] :since Unix seconds; only leads created at/after this timestamp.
|
|
477
|
+
# @option opts [Integer] :since Unix seconds; only leads created at/after this timestamp. Millisecond timestamps return 400 with instructions to divide by 1000.
|
|
478
478
|
# @option opts [String] :cursor Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset).
|
|
479
479
|
# @return [ListLeads200Response]
|
|
480
480
|
def list_leads(opts = {})
|
|
@@ -489,7 +489,7 @@ module Zernio
|
|
|
489
489
|
# @option opts [String] :account_id Filter to a single connected account. LinkedIn ads accounts switch to the live fetch.
|
|
490
490
|
# @option opts [String] :ad_account_id LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder).
|
|
491
491
|
# @option opts [Integer] :limit (default to 25)
|
|
492
|
-
# @option opts [Integer] :since Unix seconds; only leads created at/after this timestamp.
|
|
492
|
+
# @option opts [Integer] :since Unix seconds; only leads created at/after this timestamp. Millisecond timestamps return 400 with instructions to divide by 1000.
|
|
493
493
|
# @option opts [String] :cursor Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset).
|
|
494
494
|
# @return [Array<(ListLeads200Response, Integer, Hash)>] ListLeads200Response data, response status code and response headers
|
|
495
495
|
def list_leads_with_http_info(opts = {})
|
|
@@ -504,6 +504,14 @@ module Zernio
|
|
|
504
504
|
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_leads, must be greater than or equal to 1.'
|
|
505
505
|
end
|
|
506
506
|
|
|
507
|
+
if @api_client.config.client_side_validation && !opts[:'since'].nil? && opts[:'since'] > 253402300799
|
|
508
|
+
fail ArgumentError, 'invalid value for "opts[:"since"]" when calling LeadGenApi.list_leads, must be smaller than or equal to 253402300799.'
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
if @api_client.config.client_side_validation && !opts[:'since'].nil? && opts[:'since'] < 1
|
|
512
|
+
fail ArgumentError, 'invalid value for "opts[:"since"]" when calling LeadGenApi.list_leads, must be greater than or equal to 1.'
|
|
513
|
+
end
|
|
514
|
+
|
|
507
515
|
# resource path
|
|
508
516
|
local_var_path = '/v1/ads/leads'
|
|
509
517
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Zernio
|
|
16
|
+
class ToolsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Download a TikTok video
|
|
23
|
+
# Get a download URL or list available formats for a TikTok video. Requires Tools API access and uses the Tools API rate limit. Provider gateway failures and provider-side access blocks return 503; an unavailable video returns 404.
|
|
24
|
+
# @param url [String] TikTok video URL or numeric video ID.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :action Return a download URL or the available formats. (default to 'download')
|
|
27
|
+
# @option opts [String] :format_id Format ID from the formats response. Omit to select the first available format.
|
|
28
|
+
# @return [DownloadTikTokVideo200Response]
|
|
29
|
+
def download_tik_tok_video(url, opts = {})
|
|
30
|
+
data, _status_code, _headers = download_tik_tok_video_with_http_info(url, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Download a TikTok video
|
|
35
|
+
# Get a download URL or list available formats for a TikTok video. Requires Tools API access and uses the Tools API rate limit. Provider gateway failures and provider-side access blocks return 503; an unavailable video returns 404.
|
|
36
|
+
# @param url [String] TikTok video URL or numeric video ID.
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [String] :action Return a download URL or the available formats. (default to 'download')
|
|
39
|
+
# @option opts [String] :format_id Format ID from the formats response. Omit to select the first available format.
|
|
40
|
+
# @return [Array<(DownloadTikTokVideo200Response, Integer, Hash)>] DownloadTikTokVideo200Response data, response status code and response headers
|
|
41
|
+
def download_tik_tok_video_with_http_info(url, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: ToolsApi.download_tik_tok_video ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'url' is set
|
|
46
|
+
if @api_client.config.client_side_validation && url.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'url' when calling ToolsApi.download_tik_tok_video"
|
|
48
|
+
end
|
|
49
|
+
allowable_values = ["download", "formats"]
|
|
50
|
+
if @api_client.config.client_side_validation && opts[:'action'] && !allowable_values.include?(opts[:'action'])
|
|
51
|
+
fail ArgumentError, "invalid value for \"action\", must be one of #{allowable_values}"
|
|
52
|
+
end
|
|
53
|
+
# resource path
|
|
54
|
+
local_var_path = '/v1/tools/tiktok/download'
|
|
55
|
+
|
|
56
|
+
# query parameters
|
|
57
|
+
query_params = opts[:query_params] || {}
|
|
58
|
+
query_params[:'url'] = url
|
|
59
|
+
query_params[:'action'] = opts[:'action'] if !opts[:'action'].nil?
|
|
60
|
+
query_params[:'formatId'] = opts[:'format_id'] if !opts[:'format_id'].nil?
|
|
61
|
+
|
|
62
|
+
# header parameters
|
|
63
|
+
header_params = opts[:header_params] || {}
|
|
64
|
+
# HTTP header 'Accept' (if needed)
|
|
65
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body]
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'DownloadTikTokVideo200Response'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"ToolsApi.download_tik_tok_video",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: ToolsApi#download_tik_tok_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -26,7 +26,7 @@ module Zernio
|
|
|
26
26
|
# Platform media/post ID (or story media id when trigger=story_reply). Omit for an account-wide (any-post / any-story) automation.
|
|
27
27
|
attr_accessor :platform_post_id
|
|
28
28
|
|
|
29
|
-
# Zernio post ID. Optional and never required. Use it INSTEAD of platformPostId to bind a per-post automation to a not-yet-published Zernio post: the automation stays pending and arms itself when that post publishes. For a post already live on the platform, pass platformPostId alone and omit this.
|
|
29
|
+
# Zernio post ID (24 hexadecimal characters); platform IDs return 400. Optional and never required. Use it INSTEAD of platformPostId to bind a per-post automation to a not-yet-published Zernio post: the automation stays pending and arms itself when that post publishes. For a post already live on the platform, pass platformPostId alone and omit this.
|
|
30
30
|
attr_accessor :post_id
|
|
31
31
|
|
|
32
32
|
# Post content snippet for display
|
|
@@ -335,6 +335,11 @@ module Zernio
|
|
|
335
335
|
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
336
336
|
end
|
|
337
337
|
|
|
338
|
+
pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
339
|
+
if !@post_id.nil? && @post_id !~ pattern
|
|
340
|
+
invalid_properties.push("invalid value for \"post_id\", must conform to the pattern #{pattern}.")
|
|
341
|
+
end
|
|
342
|
+
|
|
338
343
|
if @name.nil?
|
|
339
344
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
340
345
|
end
|
|
@@ -382,6 +387,7 @@ module Zernio
|
|
|
382
387
|
return false if @account_id.nil?
|
|
383
388
|
trigger_validator = EnumAttributeValidator.new('String', ["comment", "story_reply"])
|
|
384
389
|
return false unless trigger_validator.valid?(@trigger)
|
|
390
|
+
return false if !@post_id.nil? && @post_id !~ Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
385
391
|
return false if @name.nil?
|
|
386
392
|
match_mode_validator = EnumAttributeValidator.new('String', ["exact", "contains", "word"])
|
|
387
393
|
return false unless match_mode_validator.valid?(@match_mode)
|
|
@@ -426,6 +432,21 @@ module Zernio
|
|
|
426
432
|
@trigger = trigger
|
|
427
433
|
end
|
|
428
434
|
|
|
435
|
+
# Custom attribute writer method with validation
|
|
436
|
+
# @param [Object] post_id Value to be assigned
|
|
437
|
+
def post_id=(post_id)
|
|
438
|
+
if post_id.nil?
|
|
439
|
+
fail ArgumentError, 'post_id cannot be nil'
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
443
|
+
if post_id !~ pattern
|
|
444
|
+
fail ArgumentError, "invalid value for \"post_id\", must conform to the pattern #{pattern}."
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
@post_id = post_id
|
|
448
|
+
end
|
|
449
|
+
|
|
429
450
|
# Custom attribute writer method with validation
|
|
430
451
|
# @param [Object] name Value to be assigned
|
|
431
452
|
def name=(name)
|