late-sdk 0.0.938 → 0.0.939
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 +4 -0
- data/docs/ConnectApi.md +72 -0
- data/docs/CreateYoutubePlaylist201Response.md +18 -0
- data/docs/CreateYoutubePlaylist201ResponsePlaylist.md +28 -0
- data/docs/CreateYoutubePlaylistRequest.md +22 -0
- data/lib/zernio-sdk/api/connect_api.rb +74 -0
- data/lib/zernio-sdk/models/create_youtube_playlist201_response.rb +164 -0
- data/lib/zernio-sdk/models/create_youtube_playlist201_response_playlist.rb +318 -0
- data/lib/zernio-sdk/models/create_youtube_playlist_request.rb +229 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -0
- data/openapi.yaml +68 -0
- data/spec/api/connect_api_spec.rb +13 -0
- data/spec/models/create_youtube_playlist201_response_playlist_spec.rb +70 -0
- data/spec/models/create_youtube_playlist201_response_spec.rb +36 -0
- data/spec/models/create_youtube_playlist_request_spec.rb +52 -0
- data/zernio-sdk-0.0.939.gem +0 -0
- metadata +15 -3
- data/zernio-sdk-0.0.938.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: e7fee19ee6d79e0037360959f02b218625cc5403fc656a1bce785ba85644294b
|
|
4
|
+
data.tar.gz: 5bf34407d7cdcb8af7bfb57572500b556e9dacd9f1d92e1e7fab4759b37eca8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8de5b9dd890b04f309ea11e07dce086f05db19435fd61173c98051f90e6c1384be51078cf30dd38db11632e31b38820c2287ed065d2ec95e60d714a4ee68c9f
|
|
7
|
+
data.tar.gz: 46c9cb783ddb2e79948b5ac23b451438d413c1915258216e2f1ed209338e190a3b7ca2d4cd2165b0413c8238e0e13fd2140bd21668680494c673c1101aaf11a6
|
data/README.md
CHANGED
|
@@ -380,6 +380,7 @@ Class | Method | HTTP request | Description
|
|
|
380
380
|
*Zernio::ConnectApi* | [**connect_whats_app_credentials**](docs/ConnectApi.md#connect_whats_app_credentials) | **POST** /v1/connect/whatsapp/credentials | Connect WhatsApp via credentials
|
|
381
381
|
*Zernio::ConnectApi* | [**connect_whats_app_embedded_signup**](docs/ConnectApi.md#connect_whats_app_embedded_signup) | **POST** /v1/connect/whatsapp/embedded-signup | Connect WhatsApp from Embedded Signup
|
|
382
382
|
*Zernio::ConnectApi* | [**create_pinterest_board**](docs/ConnectApi.md#create_pinterest_board) | **POST** /v1/accounts/{accountId}/pinterest-boards | Create Pinterest board
|
|
383
|
+
*Zernio::ConnectApi* | [**create_youtube_playlist**](docs/ConnectApi.md#create_youtube_playlist) | **POST** /v1/accounts/{accountId}/youtube-playlists | Create YouTube playlist
|
|
383
384
|
*Zernio::ConnectApi* | [**get_connect_url**](docs/ConnectApi.md#get_connect_url) | **GET** /v1/connect/{platform} | Get OAuth connect URL
|
|
384
385
|
*Zernio::ConnectApi* | [**get_facebook_pages**](docs/ConnectApi.md#get_facebook_pages) | **GET** /v1/accounts/{accountId}/facebook-page | List Facebook pages
|
|
385
386
|
*Zernio::ConnectApi* | [**get_gmb_locations**](docs/ConnectApi.md#get_gmb_locations) | **GET** /v1/accounts/{accountId}/gmb-locations | List Google Business Profile locations
|
|
@@ -1229,6 +1230,9 @@ Class | Method | HTTP request | Description
|
|
|
1229
1230
|
- [Zernio::CreateWorkflow200Response](docs/CreateWorkflow200Response.md)
|
|
1230
1231
|
- [Zernio::CreateWorkflow200ResponseWorkflow](docs/CreateWorkflow200ResponseWorkflow.md)
|
|
1231
1232
|
- [Zernio::CreateWorkflowRequest](docs/CreateWorkflowRequest.md)
|
|
1233
|
+
- [Zernio::CreateYoutubePlaylist201Response](docs/CreateYoutubePlaylist201Response.md)
|
|
1234
|
+
- [Zernio::CreateYoutubePlaylist201ResponsePlaylist](docs/CreateYoutubePlaylist201ResponsePlaylist.md)
|
|
1235
|
+
- [Zernio::CreateYoutubePlaylistRequest](docs/CreateYoutubePlaylistRequest.md)
|
|
1232
1236
|
- [Zernio::CrosspostDiscordMessage200Response](docs/CrosspostDiscordMessage200Response.md)
|
|
1233
1237
|
- [Zernio::CtwaAdRequestBody](docs/CtwaAdRequestBody.md)
|
|
1234
1238
|
- [Zernio::CtwaAdRequestBodyCitiesInner](docs/CtwaAdRequestBodyCitiesInner.md)
|
data/docs/ConnectApi.md
CHANGED
|
@@ -18,6 +18,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
18
18
|
| [**connect_whats_app_credentials**](ConnectApi.md#connect_whats_app_credentials) | **POST** /v1/connect/whatsapp/credentials | Connect WhatsApp via credentials |
|
|
19
19
|
| [**connect_whats_app_embedded_signup**](ConnectApi.md#connect_whats_app_embedded_signup) | **POST** /v1/connect/whatsapp/embedded-signup | Connect WhatsApp from Embedded Signup |
|
|
20
20
|
| [**create_pinterest_board**](ConnectApi.md#create_pinterest_board) | **POST** /v1/accounts/{accountId}/pinterest-boards | Create Pinterest board |
|
|
21
|
+
| [**create_youtube_playlist**](ConnectApi.md#create_youtube_playlist) | **POST** /v1/accounts/{accountId}/youtube-playlists | Create YouTube playlist |
|
|
21
22
|
| [**get_connect_url**](ConnectApi.md#get_connect_url) | **GET** /v1/connect/{platform} | Get OAuth connect URL |
|
|
22
23
|
| [**get_facebook_pages**](ConnectApi.md#get_facebook_pages) | **GET** /v1/accounts/{accountId}/facebook-page | List Facebook pages |
|
|
23
24
|
| [**get_gmb_locations**](ConnectApi.md#get_gmb_locations) | **GET** /v1/accounts/{accountId}/gmb-locations | List Google Business Profile locations |
|
|
@@ -1056,6 +1057,77 @@ end
|
|
|
1056
1057
|
- **Accept**: application/json
|
|
1057
1058
|
|
|
1058
1059
|
|
|
1060
|
+
## create_youtube_playlist
|
|
1061
|
+
|
|
1062
|
+
> <CreateYoutubePlaylist201Response> create_youtube_playlist(account_id, create_youtube_playlist_request)
|
|
1063
|
+
|
|
1064
|
+
Create YouTube playlist
|
|
1065
|
+
|
|
1066
|
+
Creates an empty playlist on the connected YouTube channel. Requires a title; privacy defaults to private. Returns the same playlist shape as the list endpoint. Pass the returned playlist.id as platformSpecificData.playlistId when publishing a video. Does not change the account's default playlist. Requires the youtube or youtube.force-ssl OAuth scope. Costs 50 YouTube quota units. This operation is not idempotent and is not automatically retried: repeating a request can create another playlist, including after a timeout. List playlists before retrying an ambiguous failure. Official series settings are not exposed by YouTube's public API and must be enabled manually in YouTube's desktop playlist settings.
|
|
1067
|
+
|
|
1068
|
+
### Examples
|
|
1069
|
+
|
|
1070
|
+
```ruby
|
|
1071
|
+
require 'time'
|
|
1072
|
+
require 'zernio-sdk'
|
|
1073
|
+
# setup authorization
|
|
1074
|
+
Zernio.configure do |config|
|
|
1075
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
1076
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
1077
|
+
end
|
|
1078
|
+
|
|
1079
|
+
api_instance = Zernio::ConnectApi.new
|
|
1080
|
+
account_id = 'account_id_example' # String |
|
|
1081
|
+
create_youtube_playlist_request = Zernio::CreateYoutubePlaylistRequest.new({title: 'title_example'}) # CreateYoutubePlaylistRequest |
|
|
1082
|
+
|
|
1083
|
+
begin
|
|
1084
|
+
# Create YouTube playlist
|
|
1085
|
+
result = api_instance.create_youtube_playlist(account_id, create_youtube_playlist_request)
|
|
1086
|
+
p result
|
|
1087
|
+
rescue Zernio::ApiError => e
|
|
1088
|
+
puts "Error when calling ConnectApi->create_youtube_playlist: #{e}"
|
|
1089
|
+
end
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
#### Using the create_youtube_playlist_with_http_info variant
|
|
1093
|
+
|
|
1094
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1095
|
+
|
|
1096
|
+
> <Array(<CreateYoutubePlaylist201Response>, Integer, Hash)> create_youtube_playlist_with_http_info(account_id, create_youtube_playlist_request)
|
|
1097
|
+
|
|
1098
|
+
```ruby
|
|
1099
|
+
begin
|
|
1100
|
+
# Create YouTube playlist
|
|
1101
|
+
data, status_code, headers = api_instance.create_youtube_playlist_with_http_info(account_id, create_youtube_playlist_request)
|
|
1102
|
+
p status_code # => 2xx
|
|
1103
|
+
p headers # => { ... }
|
|
1104
|
+
p data # => <CreateYoutubePlaylist201Response>
|
|
1105
|
+
rescue Zernio::ApiError => e
|
|
1106
|
+
puts "Error when calling ConnectApi->create_youtube_playlist_with_http_info: #{e}"
|
|
1107
|
+
end
|
|
1108
|
+
```
|
|
1109
|
+
|
|
1110
|
+
### Parameters
|
|
1111
|
+
|
|
1112
|
+
| Name | Type | Description | Notes |
|
|
1113
|
+
| ---- | ---- | ----------- | ----- |
|
|
1114
|
+
| **account_id** | **String** | | |
|
|
1115
|
+
| **create_youtube_playlist_request** | [**CreateYoutubePlaylistRequest**](CreateYoutubePlaylistRequest.md) | | |
|
|
1116
|
+
|
|
1117
|
+
### Return type
|
|
1118
|
+
|
|
1119
|
+
[**CreateYoutubePlaylist201Response**](CreateYoutubePlaylist201Response.md)
|
|
1120
|
+
|
|
1121
|
+
### Authorization
|
|
1122
|
+
|
|
1123
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
1124
|
+
|
|
1125
|
+
### HTTP request headers
|
|
1126
|
+
|
|
1127
|
+
- **Content-Type**: application/json
|
|
1128
|
+
- **Accept**: application/json
|
|
1129
|
+
|
|
1130
|
+
|
|
1059
1131
|
## get_connect_url
|
|
1060
1132
|
|
|
1061
1133
|
> <GetConnectUrl200Response> get_connect_url(platform, profile_id, opts)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Zernio::CreateYoutubePlaylist201Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **playlist** | [**CreateYoutubePlaylist201ResponsePlaylist**](CreateYoutubePlaylist201ResponsePlaylist.md) | | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'zernio-sdk'
|
|
13
|
+
|
|
14
|
+
instance = Zernio::CreateYoutubePlaylist201Response.new(
|
|
15
|
+
playlist: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Zernio::CreateYoutubePlaylist201ResponsePlaylist
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | |
|
|
8
|
+
| **title** | **String** | | |
|
|
9
|
+
| **description** | **String** | | |
|
|
10
|
+
| **privacy** | **String** | | |
|
|
11
|
+
| **item_count** | **Integer** | | |
|
|
12
|
+
| **thumbnail_url** | **String** | | |
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'zernio-sdk'
|
|
18
|
+
|
|
19
|
+
instance = Zernio::CreateYoutubePlaylist201ResponsePlaylist.new(
|
|
20
|
+
id: null,
|
|
21
|
+
title: null,
|
|
22
|
+
description: null,
|
|
23
|
+
privacy: null,
|
|
24
|
+
item_count: null,
|
|
25
|
+
thumbnail_url: null
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::CreateYoutubePlaylistRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **title** | **String** | Playlist title. Leading and trailing whitespace is removed. | |
|
|
8
|
+
| **description** | **String** | Optional playlist description. | [optional] |
|
|
9
|
+
| **privacy** | **String** | | [optional][default to 'private'] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::CreateYoutubePlaylistRequest.new(
|
|
17
|
+
title: null,
|
|
18
|
+
description: null,
|
|
19
|
+
privacy: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -1027,6 +1027,80 @@ module Zernio
|
|
|
1027
1027
|
return data, status_code, headers
|
|
1028
1028
|
end
|
|
1029
1029
|
|
|
1030
|
+
# Create YouTube playlist
|
|
1031
|
+
# Creates an empty playlist on the connected YouTube channel. Requires a title; privacy defaults to private. Returns the same playlist shape as the list endpoint. Pass the returned playlist.id as platformSpecificData.playlistId when publishing a video. Does not change the account's default playlist. Requires the youtube or youtube.force-ssl OAuth scope. Costs 50 YouTube quota units. This operation is not idempotent and is not automatically retried: repeating a request can create another playlist, including after a timeout. List playlists before retrying an ambiguous failure. Official series settings are not exposed by YouTube's public API and must be enabled manually in YouTube's desktop playlist settings.
|
|
1032
|
+
# @param account_id [String]
|
|
1033
|
+
# @param create_youtube_playlist_request [CreateYoutubePlaylistRequest]
|
|
1034
|
+
# @param [Hash] opts the optional parameters
|
|
1035
|
+
# @return [CreateYoutubePlaylist201Response]
|
|
1036
|
+
def create_youtube_playlist(account_id, create_youtube_playlist_request, opts = {})
|
|
1037
|
+
data, _status_code, _headers = create_youtube_playlist_with_http_info(account_id, create_youtube_playlist_request, opts)
|
|
1038
|
+
data
|
|
1039
|
+
end
|
|
1040
|
+
|
|
1041
|
+
# Create YouTube playlist
|
|
1042
|
+
# Creates an empty playlist on the connected YouTube channel. Requires a title; privacy defaults to private. Returns the same playlist shape as the list endpoint. Pass the returned playlist.id as platformSpecificData.playlistId when publishing a video. Does not change the account's default playlist. Requires the youtube or youtube.force-ssl OAuth scope. Costs 50 YouTube quota units. This operation is not idempotent and is not automatically retried: repeating a request can create another playlist, including after a timeout. List playlists before retrying an ambiguous failure. Official series settings are not exposed by YouTube's public API and must be enabled manually in YouTube's desktop playlist settings.
|
|
1043
|
+
# @param account_id [String]
|
|
1044
|
+
# @param create_youtube_playlist_request [CreateYoutubePlaylistRequest]
|
|
1045
|
+
# @param [Hash] opts the optional parameters
|
|
1046
|
+
# @return [Array<(CreateYoutubePlaylist201Response, Integer, Hash)>] CreateYoutubePlaylist201Response data, response status code and response headers
|
|
1047
|
+
def create_youtube_playlist_with_http_info(account_id, create_youtube_playlist_request, opts = {})
|
|
1048
|
+
if @api_client.config.debugging
|
|
1049
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.create_youtube_playlist ...'
|
|
1050
|
+
end
|
|
1051
|
+
# verify the required parameter 'account_id' is set
|
|
1052
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
1053
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.create_youtube_playlist"
|
|
1054
|
+
end
|
|
1055
|
+
# verify the required parameter 'create_youtube_playlist_request' is set
|
|
1056
|
+
if @api_client.config.client_side_validation && create_youtube_playlist_request.nil?
|
|
1057
|
+
fail ArgumentError, "Missing the required parameter 'create_youtube_playlist_request' when calling ConnectApi.create_youtube_playlist"
|
|
1058
|
+
end
|
|
1059
|
+
# resource path
|
|
1060
|
+
local_var_path = '/v1/accounts/{accountId}/youtube-playlists'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
1061
|
+
|
|
1062
|
+
# query parameters
|
|
1063
|
+
query_params = opts[:query_params] || {}
|
|
1064
|
+
|
|
1065
|
+
# header parameters
|
|
1066
|
+
header_params = opts[:header_params] || {}
|
|
1067
|
+
# HTTP header 'Accept' (if needed)
|
|
1068
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1069
|
+
# HTTP header 'Content-Type'
|
|
1070
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1071
|
+
if !content_type.nil?
|
|
1072
|
+
header_params['Content-Type'] = content_type
|
|
1073
|
+
end
|
|
1074
|
+
|
|
1075
|
+
# form parameters
|
|
1076
|
+
form_params = opts[:form_params] || {}
|
|
1077
|
+
|
|
1078
|
+
# http body (model)
|
|
1079
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_youtube_playlist_request)
|
|
1080
|
+
|
|
1081
|
+
# return_type
|
|
1082
|
+
return_type = opts[:debug_return_type] || 'CreateYoutubePlaylist201Response'
|
|
1083
|
+
|
|
1084
|
+
# auth_names
|
|
1085
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1086
|
+
|
|
1087
|
+
new_options = opts.merge(
|
|
1088
|
+
:operation => :"ConnectApi.create_youtube_playlist",
|
|
1089
|
+
:header_params => header_params,
|
|
1090
|
+
:query_params => query_params,
|
|
1091
|
+
:form_params => form_params,
|
|
1092
|
+
:body => post_body,
|
|
1093
|
+
:auth_names => auth_names,
|
|
1094
|
+
:return_type => return_type
|
|
1095
|
+
)
|
|
1096
|
+
|
|
1097
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1098
|
+
if @api_client.config.debugging
|
|
1099
|
+
@api_client.config.logger.debug "API called: ConnectApi#create_youtube_playlist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1100
|
+
end
|
|
1101
|
+
return data, status_code, headers
|
|
1102
|
+
end
|
|
1103
|
+
|
|
1030
1104
|
# Get OAuth connect URL
|
|
1031
1105
|
# Initiate an OAuth connection flow. Returns an authUrl to redirect the user to. Standard flow: Zernio hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete. TikTok: every connection now goes through the TikTok for Business app. One TikTok account per profile, so connecting on a profile that already holds one replaces it. Reconnecting the SAME account keeps it and all of its history; authorizing a DIFFERENT TikTok account takes the slot over and permanently deletes the previous account's analytics, inbox and DM history. The two are told apart by the `@handle` stored at the last connect, so an account whose handle has been renamed on TikTok since then reads as a different account. An authorization that leaves out a permission the connected account needs changes nothing at all and comes back as `missing_tiktok_permissions`; connect again and accept every permission on TikTok's screen.
|
|
1032
1106
|
# @param platform [String] Social media platform to connect. `snapchat` is a closed beta with no public release date: it returns 403 `PLATFORM_BETA_RESTRICTED` until the account is approved.
|
|
@@ -0,0 +1,164 @@
|
|
|
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 CreateYoutubePlaylist201Response < ApiModelBase
|
|
18
|
+
attr_accessor :playlist
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'playlist' => :'playlist'
|
|
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
|
+
:'playlist' => :'CreateYoutubePlaylist201ResponsePlaylist'
|
|
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::CreateYoutubePlaylist201Response` 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::CreateYoutubePlaylist201Response`. 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?(:'playlist')
|
|
67
|
+
self.playlist = attributes[:'playlist']
|
|
68
|
+
else
|
|
69
|
+
self.playlist = nil
|
|
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
|
+
if @playlist.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "playlist", playlist cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
+
return false if @playlist.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] playlist Value to be assigned
|
|
95
|
+
def playlist=(playlist)
|
|
96
|
+
if playlist.nil?
|
|
97
|
+
fail ArgumentError, 'playlist cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@playlist = playlist
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
playlist == o.playlist
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see the `==` method
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def eql?(o)
|
|
114
|
+
self == o
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Calculates hash code according to all attributes.
|
|
118
|
+
# @return [Integer] Hash code
|
|
119
|
+
def hash
|
|
120
|
+
[playlist].hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def self.build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
transformed_hash = {}
|
|
130
|
+
openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = nil
|
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
134
|
+
# check to ensure the input is an array given that the attribute
|
|
135
|
+
# is documented as an array but the input is not
|
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
new(transformed_hash)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the object in the form of hash
|
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
|
148
|
+
def to_hash
|
|
149
|
+
hash = {}
|
|
150
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
151
|
+
value = self.send(attr)
|
|
152
|
+
if value.nil?
|
|
153
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
154
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
hash[param] = _to_hash(value)
|
|
158
|
+
end
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|