Class: Zernio::UpdatePostMetadataRequest

Inherits:
ApiModelBase show all
Defined in:
lib/zernio-sdk/models/update_post_metadata_request.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ UpdatePostMetadataRequest

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 130

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdatePostMetadataRequest` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdatePostMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'platform')
    self.platform = attributes[:'platform']
  else
    self.platform = nil
  end

  if attributes.key?(:'video_id')
    self.video_id = attributes[:'video_id']
  end

  if attributes.key?(:'account_id')
    self. = attributes[:'account_id']
  end

  if attributes.key?(:'title')
    self.title = attributes[:'title']
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  end

  if attributes.key?(:'category_id')
    self.category_id = attributes[:'category_id']
  end

  if attributes.key?(:'privacy_status')
    self.privacy_status = attributes[:'privacy_status']
  end

  if attributes.key?(:'thumbnail_url')
    self.thumbnail_url = attributes[:'thumbnail_url']
  end

  if attributes.key?(:'made_for_kids')
    self.made_for_kids = attributes[:'made_for_kids']
  end

  if attributes.key?(:'contains_synthetic_media')
    self.contains_synthetic_media = attributes[:'contains_synthetic_media']
  end

  if attributes.key?(:'playlist_id')
    self.playlist_id = attributes[:'playlist_id']
  end
end

Instance Attribute Details

#account_idObject

Zernio social account ID (required for direct mode, ignored for post-based mode)



25
26
27
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 25

def 
  @account_id
end

#category_idObject

YouTube video category ID



37
38
39
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 37

def category_id
  @category_id
end

#contains_synthetic_mediaObject

AI-generated content disclosure. Set true if the video contains synthetic content that could be mistaken for real. YouTube may add a label.



49
50
51
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 49

def contains_synthetic_media
  @contains_synthetic_media
end

#descriptionObject

New video description



31
32
33
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 31

def description
  @description
end

#made_for_kidsObject

COPPA compliance flag. Set true for child-directed content (restricts comments, notifications, ad targeting).



46
47
48
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 46

def made_for_kids
  @made_for_kids
end

#platformObject

The platform to update metadata on



19
20
21
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 19

def platform
  @platform
end

#playlist_idObject

YouTube playlist ID to add the video to (e.g. 'PLxxxxxxxxxxxxx'). Use GET /v1/accounts/id/youtube-playlists to list available playlists. Only playlists owned by the channel are supported.



52
53
54
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 52

def playlist_id
  @playlist_id
end

#privacy_statusObject

Video privacy setting



40
41
42
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 40

def privacy_status
  @privacy_status
end

#tagsObject

Array of keyword tags (max 500 characters combined for YouTube)



34
35
36
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 34

def tags
  @tags
end

#thumbnail_urlObject

Public URL of a custom thumbnail image (JPEG, PNG, or GIF, max 2 MB, recommended 1280x720). Works on any video you own, including existing videos not published through Zernio. The channel must be verified (phone verification) to set custom thumbnails.



43
44
45
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 43

def thumbnail_url
  @thumbnail_url
end

#titleObject

New video title (max 100 characters for YouTube)



28
29
30
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 28

def title
  @title
end

#video_idObject

YouTube video ID (required for direct mode, ignored for post-based mode)



22
23
24
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 22

def video_id
  @video_id
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



95
96
97
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 95

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



100
101
102
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 100

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 77

def self.attribute_map
  {
    :'platform' => :'platform',
    :'video_id' => :'videoId',
    :'account_id' => :'accountId',
    :'title' => :'title',
    :'description' => :'description',
    :'tags' => :'tags',
    :'category_id' => :'categoryId',
    :'privacy_status' => :'privacyStatus',
    :'thumbnail_url' => :'thumbnailUrl',
    :'made_for_kids' => :'madeForKids',
    :'contains_synthetic_media' => :'containsSyntheticMedia',
    :'playlist_id' => :'playlistId'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 294

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



123
124
125
126
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 123

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 105

def self.openapi_types
  {
    :'platform' => :'String',
    :'video_id' => :'String',
    :'account_id' => :'String',
    :'title' => :'String',
    :'description' => :'String',
    :'tags' => :'Array<String>',
    :'category_id' => :'String',
    :'privacy_status' => :'String',
    :'thumbnail_url' => :'String',
    :'made_for_kids' => :'Boolean',
    :'contains_synthetic_media' => :'Boolean',
    :'playlist_id' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 262

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      platform == o.platform &&
      video_id == o.video_id &&
       == o. &&
      title == o.title &&
      description == o.description &&
      tags == o.tags &&
      category_id == o.category_id &&
      privacy_status == o.privacy_status &&
      thumbnail_url == o.thumbnail_url &&
      made_for_kids == o.made_for_kids &&
      contains_synthetic_media == o.contains_synthetic_media &&
      playlist_id == o.playlist_id
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


281
282
283
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 281

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



287
288
289
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 287

def hash
  [platform, video_id, , title, description, tags, category_id, privacy_status, thumbnail_url, made_for_kids, contains_synthetic_media, playlist_id].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 199

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @platform.nil?
    invalid_properties.push('invalid value for "platform", platform cannot be nil.')
  end

  if !@title.nil? && @title.to_s.length > 100
    invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 100.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 316

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



215
216
217
218
219
220
221
222
223
224
# File 'lib/zernio-sdk/models/update_post_metadata_request.rb', line 215

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @platform.nil?
  platform_validator = EnumAttributeValidator.new('String', ["youtube"])
  return false unless platform_validator.valid?(@platform)
  return false if !@title.nil? && @title.to_s.length > 100
  privacy_status_validator = EnumAttributeValidator.new('String', ["public", "private", "unlisted"])
  return false unless privacy_status_validator.valid?(@privacy_status)
  true
end