late-sdk 0.0.946 → 0.0.948

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11a5a0391999650568f706eacc803aeaaa440d97708ea4b2d720db0da2f82954
4
- data.tar.gz: 8c2235a143397d96d5518dbf5edf4df0fdc7b88d658c801e5ecc4fc3ed40f235
3
+ metadata.gz: 26673cd0a46be07eba641cb146c5e466ed24d343c95160da101e0d598e165062
4
+ data.tar.gz: 114b23c2bd973baac1c82130f0405310f85c089f76422693e5de22459f11fdb9
5
5
  SHA512:
6
- metadata.gz: ddb310850c27fd598ff2e68a3f398a45edd7b68f2129de41d0385a40c4d40991ad3e3bd6ca8f626a19c70d2cf3139163e618104f8a69a81fead74837009a7192
7
- data.tar.gz: 385395f747c324fab7064bdbf804cabf453114bbacdbd15818f58d0a0d83c7f456aee1e5d28a81dffa82aa0949cabfd3687a2f72fbfb47e13947efb5e2fb263f
6
+ metadata.gz: 639876f453eb93ea2791494d3547f4018040a8f677525e600eeb0699bf818a22a1a40192247b2f406ab28ad49cb44aa70bd102fe5ee3c810b3e2b8a247227826
7
+ data.tar.gz: 9c3dd88d3983cb708ba0ae9c599284e5bbaee35e3202486976bb20a9f2310e7363a8b62e7b15d10745aa8be1accb07c24c171e679896660b32cf38df28bd1f5c
data/README.md CHANGED
@@ -102,6 +102,7 @@ Class | Method | HTTP request | Description
102
102
  *Zernio::AccountsApi* | [**get_slack_settings**](docs/AccountsApi.md#get_slack_settings) | **GET** /v1/accounts/{accountId}/slack-settings | Get Slack account settings
103
103
  *Zernio::AccountsApi* | [**get_tik_tok_creator_info**](docs/AccountsApi.md#get_tik_tok_creator_info) | **GET** /v1/accounts/{accountId}/tiktok/creator-info | Get TikTok creator info
104
104
  *Zernio::AccountsApi* | [**list_accounts**](docs/AccountsApi.md#list_accounts) | **GET** /v1/accounts | List accounts
105
+ *Zernio::AccountsApi* | [**list_tik_tok_commercial_music**](docs/AccountsApi.md#list_tik_tok_commercial_music) | **GET** /v1/accounts/{accountId}/tiktok/commercial-music | List trending commercial music
105
106
  *Zernio::AccountsApi* | [**move_account_to_profile**](docs/AccountsApi.md#move_account_to_profile) | **PATCH** /v1/accounts/{accountId} | Move account to another profile
106
107
  *Zernio::AccountsApi* | [**update_account**](docs/AccountsApi.md#update_account) | **PUT** /v1/accounts/{accountId} | Update account
107
108
  *Zernio::AccountsApi* | [**update_bluesky_settings**](docs/AccountsApi.md#update_bluesky_settings) | **PATCH** /v1/accounts/{accountId}/bluesky-settings | Update Bluesky account settings
@@ -1999,6 +2000,9 @@ Class | Method | HTTP request | Description
1999
2000
  - [Zernio::ListTikTokAdPixels200Response](docs/ListTikTokAdPixels200Response.md)
2000
2001
  - [Zernio::ListTikTokAdPixels200ResponsePixelsInner](docs/ListTikTokAdPixels200ResponsePixelsInner.md)
2001
2002
  - [Zernio::ListTikTokAdPixels200ResponsePixelsInnerEventDetailsInner](docs/ListTikTokAdPixels200ResponsePixelsInnerEventDetailsInner.md)
2003
+ - [Zernio::ListTikTokCommercialMusic200Response](docs/ListTikTokCommercialMusic200Response.md)
2004
+ - [Zernio::ListTikTokCommercialMusic200ResponseTracksInner](docs/ListTikTokCommercialMusic200ResponseTracksInner.md)
2005
+ - [Zernio::ListTikTokCommercialMusic200ResponseTracksInnerClip](docs/ListTikTokCommercialMusic200ResponseTracksInnerClip.md)
2002
2006
  - [Zernio::ListTrackingTagSharedAccounts200Response](docs/ListTrackingTagSharedAccounts200Response.md)
2003
2007
  - [Zernio::ListTrackingTags200Response](docs/ListTrackingTags200Response.md)
2004
2008
  - [Zernio::ListUsers200Response](docs/ListUsers200Response.md)
@@ -2410,6 +2414,7 @@ Class | Method | HTTP request | Description
2410
2414
  - [Zernio::TikTokDryRunVerdict](docs/TikTokDryRunVerdict.md)
2411
2415
  - [Zernio::TikTokDryRunVerdictTiktokInner](docs/TikTokDryRunVerdictTiktokInner.md)
2412
2416
  - [Zernio::TikTokPlatformData](docs/TikTokPlatformData.md)
2417
+ - [Zernio::TikTokPlatformDataMusicSoundInfo](docs/TikTokPlatformDataMusicSoundInfo.md)
2413
2418
  - [Zernio::TrackingTag](docs/TrackingTag.md)
2414
2419
  - [Zernio::TransferVoiceCall200Response](docs/TransferVoiceCall200Response.md)
2415
2420
  - [Zernio::TransferVoiceCallRequest](docs/TransferVoiceCallRequest.md)
data/docs/AccountsApi.md CHANGED
@@ -14,6 +14,7 @@ All URIs are relative to *https://zernio.com/api*
14
14
  | [**get_slack_settings**](AccountsApi.md#get_slack_settings) | **GET** /v1/accounts/{accountId}/slack-settings | Get Slack account settings |
15
15
  | [**get_tik_tok_creator_info**](AccountsApi.md#get_tik_tok_creator_info) | **GET** /v1/accounts/{accountId}/tiktok/creator-info | Get TikTok creator info |
16
16
  | [**list_accounts**](AccountsApi.md#list_accounts) | **GET** /v1/accounts | List accounts |
17
+ | [**list_tik_tok_commercial_music**](AccountsApi.md#list_tik_tok_commercial_music) | **GET** /v1/accounts/{accountId}/tiktok/commercial-music | List trending commercial music |
17
18
  | [**move_account_to_profile**](AccountsApi.md#move_account_to_profile) | **PATCH** /v1/accounts/{accountId} | Move account to another profile |
18
19
  | [**update_account**](AccountsApi.md#update_account) | **PUT** /v1/accounts/{accountId} | Update account |
19
20
  | [**update_bluesky_settings**](AccountsApi.md#update_bluesky_settings) | **PATCH** /v1/accounts/{accountId}/bluesky-settings | Update Bluesky account settings |
@@ -748,6 +749,79 @@ end
748
749
  - **Accept**: application/json
749
750
 
750
751
 
752
+ ## list_tik_tok_commercial_music
753
+
754
+ > <ListTikTokCommercialMusic200Response> list_tik_tok_commercial_music(account_id, opts)
755
+
756
+ List trending commercial music
757
+
758
+ Returns the 100 currently trending tracks of TikTok's Commercial Music Library for a TikTok account connected through the TikTok for Business app. Use a track id as tiktokSettings.musicSoundInfo.musicSoundId when creating a post. The list is not paged; countryCode selects the country chart.
759
+
760
+ ### Examples
761
+
762
+ ```ruby
763
+ require 'time'
764
+ require 'zernio-sdk'
765
+ # setup authorization
766
+ Zernio.configure do |config|
767
+ # Configure Bearer authorization (JWT): bearerAuth
768
+ config.access_token = 'YOUR_BEARER_TOKEN'
769
+ end
770
+
771
+ api_instance = Zernio::AccountsApi.new
772
+ account_id = 'account_id_example' # String | The TikTok account ID
773
+ opts = {
774
+ country_code: 'country_code_example' # String | Two-letter ISO 3166-1 country code of the chart to read (for example ES). Defaults to TikTok's global chart.
775
+ }
776
+
777
+ begin
778
+ # List trending commercial music
779
+ result = api_instance.list_tik_tok_commercial_music(account_id, opts)
780
+ p result
781
+ rescue Zernio::ApiError => e
782
+ puts "Error when calling AccountsApi->list_tik_tok_commercial_music: #{e}"
783
+ end
784
+ ```
785
+
786
+ #### Using the list_tik_tok_commercial_music_with_http_info variant
787
+
788
+ This returns an Array which contains the response data, status code and headers.
789
+
790
+ > <Array(<ListTikTokCommercialMusic200Response>, Integer, Hash)> list_tik_tok_commercial_music_with_http_info(account_id, opts)
791
+
792
+ ```ruby
793
+ begin
794
+ # List trending commercial music
795
+ data, status_code, headers = api_instance.list_tik_tok_commercial_music_with_http_info(account_id, opts)
796
+ p status_code # => 2xx
797
+ p headers # => { ... }
798
+ p data # => <ListTikTokCommercialMusic200Response>
799
+ rescue Zernio::ApiError => e
800
+ puts "Error when calling AccountsApi->list_tik_tok_commercial_music_with_http_info: #{e}"
801
+ end
802
+ ```
803
+
804
+ ### Parameters
805
+
806
+ | Name | Type | Description | Notes |
807
+ | ---- | ---- | ----------- | ----- |
808
+ | **account_id** | **String** | The TikTok account ID | |
809
+ | **country_code** | **String** | Two-letter ISO 3166-1 country code of the chart to read (for example ES). Defaults to TikTok&#39;s global chart. | [optional] |
810
+
811
+ ### Return type
812
+
813
+ [**ListTikTokCommercialMusic200Response**](ListTikTokCommercialMusic200Response.md)
814
+
815
+ ### Authorization
816
+
817
+ [bearerAuth](../README.md#bearerAuth)
818
+
819
+ ### HTTP request headers
820
+
821
+ - **Content-Type**: Not defined
822
+ - **Accept**: application/json
823
+
824
+
751
825
  ## move_account_to_profile
752
826
 
753
827
  > <MoveAccountToProfile200Response> move_account_to_profile(account_id, move_account_to_profile_request)
@@ -0,0 +1,18 @@
1
+ # Zernio::ListTikTokCommercialMusic200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **tracks** | [**Array&lt;ListTikTokCommercialMusic200ResponseTracksInner&gt;**](ListTikTokCommercialMusic200ResponseTracksInner.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'zernio-sdk'
13
+
14
+ instance = Zernio::ListTikTokCommercialMusic200Response.new(
15
+ tracks: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,34 @@
1
+ # Zernio::ListTikTokCommercialMusic200ResponseTracksInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | The commercial_music_id to send as musicSoundId | [optional] |
8
+ | **name** | **String** | | [optional] |
9
+ | **artist** | **String** | | [optional] |
10
+ | **duration_sec** | **Integer** | | [optional] |
11
+ | **genres** | **Array&lt;String&gt;** | | [optional] |
12
+ | **preview_url** | **String** | Preview audio of the full track | [optional] |
13
+ | **thumbnail_url** | **String** | | [optional] |
14
+ | **rank** | **Integer** | Position in the trending chart, 1 first | [optional] |
15
+ | **clip** | [**ListTikTokCommercialMusic200ResponseTracksInnerClip**](ListTikTokCommercialMusic200ResponseTracksInnerClip.md) | | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'zernio-sdk'
21
+
22
+ instance = Zernio::ListTikTokCommercialMusic200ResponseTracksInner.new(
23
+ id: null,
24
+ name: null,
25
+ artist: null,
26
+ duration_sec: null,
27
+ genres: null,
28
+ preview_url: null,
29
+ thumbnail_url: null,
30
+ rank: null,
31
+ clip: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,20 @@
1
+ # Zernio::ListTikTokCommercialMusic200ResponseTracksInnerClip
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **duration_sec** | **Integer** | | [optional] |
8
+ | **preview_url** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::ListTikTokCommercialMusic200ResponseTracksInnerClip.new(
16
+ duration_sec: null,
17
+ preview_url: null
18
+ )
19
+ ```
20
+
@@ -18,7 +18,9 @@
18
18
  | **video_cover_timestamp_ms** | **Integer** | Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second). Ignored when videoCoverImageUrl is provided. | [optional] |
19
19
  | **video_cover_image_url** | **String** | Optional for video posts. URL of a custom thumbnail image (JPG, PNG, or WebP, max 20MB). Any downloadable URL works: we rehost it ourselves. The image is stitched as a single frame at the start of the video to serve as the cover. Accounts connected through the TikTok for Business app hand it to TikTok as the cover instead, with no stitching, falling back to videoCoverTimestampMs without it. Overrides videoCoverTimestampMs when provided. | [optional] |
20
20
  | **photo_cover_index** | **Integer** | Optional for photo carousels. Index of image to use as cover, 0-based (defaults to 0/first image). | [optional] |
21
- | **auto_add_music** | **Boolean** | When true, TikTok may add recommended music (photos only) | [optional] |
21
+ | **auto_add_music** | **Boolean** | When true, TikTok may add recommended music (photos only). With the brand-organic or branded-content toggle on, TikTok allows Commercial Music Library tracks only, so this attaches nothing there; use musicSoundInfo instead. | [optional] |
22
+ | **music_sound_info** | [**TikTokPlatformDataMusicSoundInfo**](TikTokPlatformDataMusicSoundInfo.md) | | [optional] |
23
+ | **video_original_sound_volume** | **Integer** | Volume of the video&#39;s own sound when a commercial track is attached (0 to 100). Requires musicSoundInfo. Video posts only. | [optional] |
22
24
  | **video_made_with_ai** | **Boolean** | Set true to disclose AI-generated content. Accounts connected through the TikTok for Business app carry the disclosure on video posts only: the business photo endpoint has no AI disclosure field, so true on a direct photo post is rejected at creation rather than published undisclosed. Send draft true to publish such a photo post and set the disclosure in the TikTok app. | [optional] |
23
25
  | **description** | **String** | Optional long-form caption for photo posts (max 4000 chars). Recommended when content exceeds 90 chars, as photo titles are auto-truncated. Falls back to the post content when omitted. | [optional] |
24
26
 
@@ -43,6 +45,8 @@ instance = Zernio::TikTokPlatformData.new(
43
45
  video_cover_image_url: null,
44
46
  photo_cover_index: null,
45
47
  auto_add_music: null,
48
+ music_sound_info: null,
49
+ video_original_sound_volume: null,
46
50
  video_made_with_ai: null,
47
51
  description: null
48
52
  )
@@ -0,0 +1,24 @@
1
+ # Zernio::TikTokPlatformDataMusicSoundInfo
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **music_sound_id** | **String** | The commercial_music_id of the track. | |
8
+ | **music_sound_volume** | **Integer** | Track volume. TikTok defaults an omitted volume to 0, which publishes the track silently, so we default to the app&#39;s 50. Video posts only. | [optional][default to 50] |
9
+ | **music_sound_start** | **Integer** | Start point of the track in milliseconds (default 0). Video posts only. | [optional] |
10
+ | **music_sound_end** | **Integer** | End point of the track in milliseconds (default: the video length). Must be greater than musicSoundStart. Video posts only. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zernio-sdk'
16
+
17
+ instance = Zernio::TikTokPlatformDataMusicSoundInfo.new(
18
+ music_sound_id: null,
19
+ music_sound_volume: null,
20
+ music_sound_start: null,
21
+ music_sound_end: null
22
+ )
23
+ ```
24
+
@@ -717,6 +717,80 @@ module Zernio
717
717
  return data, status_code, headers
718
718
  end
719
719
 
720
+ # List trending commercial music
721
+ # Returns the 100 currently trending tracks of TikTok's Commercial Music Library for a TikTok account connected through the TikTok for Business app. Use a track id as tiktokSettings.musicSoundInfo.musicSoundId when creating a post. The list is not paged; countryCode selects the country chart.
722
+ # @param account_id [String] The TikTok account ID
723
+ # @param [Hash] opts the optional parameters
724
+ # @option opts [String] :country_code Two-letter ISO 3166-1 country code of the chart to read (for example ES). Defaults to TikTok&#39;s global chart.
725
+ # @return [ListTikTokCommercialMusic200Response]
726
+ def list_tik_tok_commercial_music(account_id, opts = {})
727
+ data, _status_code, _headers = list_tik_tok_commercial_music_with_http_info(account_id, opts)
728
+ data
729
+ end
730
+
731
+ # List trending commercial music
732
+ # Returns the 100 currently trending tracks of TikTok&#39;s Commercial Music Library for a TikTok account connected through the TikTok for Business app. Use a track id as tiktokSettings.musicSoundInfo.musicSoundId when creating a post. The list is not paged; countryCode selects the country chart.
733
+ # @param account_id [String] The TikTok account ID
734
+ # @param [Hash] opts the optional parameters
735
+ # @option opts [String] :country_code Two-letter ISO 3166-1 country code of the chart to read (for example ES). Defaults to TikTok&#39;s global chart.
736
+ # @return [Array<(ListTikTokCommercialMusic200Response, Integer, Hash)>] ListTikTokCommercialMusic200Response data, response status code and response headers
737
+ def list_tik_tok_commercial_music_with_http_info(account_id, opts = {})
738
+ if @api_client.config.debugging
739
+ @api_client.config.logger.debug 'Calling API: AccountsApi.list_tik_tok_commercial_music ...'
740
+ end
741
+ # verify the required parameter 'account_id' is set
742
+ if @api_client.config.client_side_validation && account_id.nil?
743
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.list_tik_tok_commercial_music"
744
+ end
745
+ if @api_client.config.client_side_validation && !opts[:'country_code'].nil? && opts[:'country_code'].to_s.length > 2
746
+ fail ArgumentError, 'invalid value for "opts[:"country_code"]" when calling AccountsApi.list_tik_tok_commercial_music, the character length must be smaller than or equal to 2.'
747
+ end
748
+
749
+ if @api_client.config.client_side_validation && !opts[:'country_code'].nil? && opts[:'country_code'].to_s.length < 2
750
+ fail ArgumentError, 'invalid value for "opts[:"country_code"]" when calling AccountsApi.list_tik_tok_commercial_music, the character length must be greater than or equal to 2.'
751
+ end
752
+
753
+ # resource path
754
+ local_var_path = '/v1/accounts/{accountId}/tiktok/commercial-music'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
755
+
756
+ # query parameters
757
+ query_params = opts[:query_params] || {}
758
+ query_params[:'countryCode'] = opts[:'country_code'] if !opts[:'country_code'].nil?
759
+
760
+ # header parameters
761
+ header_params = opts[:header_params] || {}
762
+ # HTTP header 'Accept' (if needed)
763
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
764
+
765
+ # form parameters
766
+ form_params = opts[:form_params] || {}
767
+
768
+ # http body (model)
769
+ post_body = opts[:debug_body]
770
+
771
+ # return_type
772
+ return_type = opts[:debug_return_type] || 'ListTikTokCommercialMusic200Response'
773
+
774
+ # auth_names
775
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
776
+
777
+ new_options = opts.merge(
778
+ :operation => :"AccountsApi.list_tik_tok_commercial_music",
779
+ :header_params => header_params,
780
+ :query_params => query_params,
781
+ :form_params => form_params,
782
+ :body => post_body,
783
+ :auth_names => auth_names,
784
+ :return_type => return_type
785
+ )
786
+
787
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
788
+ if @api_client.config.debugging
789
+ @api_client.config.logger.debug "API called: AccountsApi#list_tik_tok_commercial_music\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
790
+ end
791
+ return data, status_code, headers
792
+ end
793
+
720
794
  # Move account to another profile
721
795
  # Moves a connected account to a different profile owned by the same user. The target profile must belong to the same user as the account. For API keys restricted to specific profiles, BOTH the source account's current profile AND the target profile must be in the key's allowed set. Calls with a target profile outside the key's scope return 403.
722
796
  # @param account_id [String]
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Feed posts support up to 10 images (no mixed video+image). Stories require single media (24h, no captions). Reels require single vertical video (9:16, 3-60s). Geo-restriction is a hard visibility restriction: users outside the specified countries cannot see the post. Not supported for stories. Draft, carousel, and colored-background text options live under facebookSettings, see FacebookSettings.
17
+ # Feed posts support up to 10 images (no mixed video+image). Stories require single media (24h, no captions). Reels require a single vertical video (9:16). The Zernio API does not preflight Reel duration. Meta's Reels publishing guide documents 3-90 seconds. Geo-restriction is a hard visibility restriction: users outside the specified countries cannot see the post. Not supported for stories. Draft, carousel, and colored-background text options live under facebookSettings, see FacebookSettings.
18
18
  class FacebookPlatformData < ApiModelBase
19
19
  # Set to 'story' for Page Stories (24h ephemeral) or 'reel' for Reels (short vertical video). Defaults to feed post if omitted.
20
20
  attr_accessor :content_type
@@ -0,0 +1,149 @@
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 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class ListTikTokCommercialMusic200Response < ApiModelBase
18
+ attr_accessor :tracks
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'tracks' => :'tracks'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'tracks' => :'Array<ListTikTokCommercialMusic200ResponseTracksInner>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListTikTokCommercialMusic200Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListTikTokCommercialMusic200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'tracks')
67
+ if (value = attributes[:'tracks']).is_a?(Array)
68
+ self.tracks = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ tracks == o.tracks
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [tracks].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end