Class: Zernio::UpdatePostRequest

Inherits:
ApiModelBase show all
Defined in:
lib/zernio-sdk/models/update_post_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 = {}) ⇒ UpdatePostRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/zernio-sdk/models/update_post_request.rb', line 152

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdatePostRequest` 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::UpdatePostRequest`. 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?(:'title')
    self.title = attributes[:'title']
  end

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

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

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

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

  if attributes.key?(:'publish_now')
    self.publish_now = attributes[:'publish_now']
  else
    self.publish_now = false
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#contentObject

Returns the value of attribute content.



20
21
22
# File 'lib/zernio-sdk/models/update_post_request.rb', line 20

def content
  @content
end

#crossposting_enabledObject

Returns the value of attribute crossposting_enabled.



44
45
46
# File 'lib/zernio-sdk/models/update_post_request.rb', line 44

def crossposting_enabled
  @crossposting_enabled
end

#facebook_settingsObject

Root-level Facebook settings applied to all Facebook platforms. Merged into each platform's platformSpecificData, with platform-specific settings taking precedence.



58
59
60
# File 'lib/zernio-sdk/models/update_post_request.rb', line 58

def facebook_settings
  @facebook_settings
end

#hashtagsObject

Returns the value of attribute hashtags.



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

def hashtags
  @hashtags
end

#is_draftObject

When omitted, the post keeps its current draft status. Send false to promote a draft to scheduled (combined with scheduledFor, publishNow, or a queue).



32
33
34
# File 'lib/zernio-sdk/models/update_post_request.rb', line 32

def is_draft
  @is_draft
end

#media_itemsObject

Returns the value of attribute media_items.



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

def media_items
  @media_items
end

#mentionsObject

Returns the value of attribute mentions.



42
43
44
# File 'lib/zernio-sdk/models/update_post_request.rb', line 42

def mentions
  @mentions
end

#metadataObject

Returns the value of attribute metadata.



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

def 
  @metadata
end

#platformsObject

Target platforms and accounts for this post. Each item must include platform and accountId.



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

def platforms
  @platforms
end

#publish_nowObject

Returns the value of attribute publish_now.



29
30
31
# File 'lib/zernio-sdk/models/update_post_request.rb', line 29

def publish_now
  @publish_now
end

#queue_idObject

Specific queue ID to use when scheduling via queue.



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

def queue_id
  @queue_id
end

#queued_from_profileObject

Profile ID to schedule via queue.



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

def queued_from_profile
  @queued_from_profile
end

#recyclingObject

Returns the value of attribute recycling.



60
61
62
# File 'lib/zernio-sdk/models/update_post_request.rb', line 60

def recycling
  @recycling
end

#scheduled_forObject

Returns the value of attribute scheduled_for.



27
28
29
# File 'lib/zernio-sdk/models/update_post_request.rb', line 27

def scheduled_for
  @scheduled_for
end

#tagsObject

Returns the value of attribute tags.



38
39
40
# File 'lib/zernio-sdk/models/update_post_request.rb', line 38

def tags
  @tags
end

#tiktok_settingsObject

Root-level TikTok settings applied to all TikTok platforms. Merged into each platform's platformSpecificData, with platform-specific settings taking precedence.



55
56
57
# File 'lib/zernio-sdk/models/update_post_request.rb', line 55

def tiktok_settings
  @tiktok_settings
end

#timezoneObject

Returns the value of attribute timezone.



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

def timezone
  @timezone
end

#titleObject

Returns the value of attribute title.



18
19
20
# File 'lib/zernio-sdk/models/update_post_request.rb', line 18

def title
  @title
end

#visibilityObject

Returns the value of attribute visibility.



36
37
38
# File 'lib/zernio-sdk/models/update_post_request.rb', line 36

def visibility
  @visibility
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



110
111
112
# File 'lib/zernio-sdk/models/update_post_request.rb', line 110

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



115
116
117
# File 'lib/zernio-sdk/models/update_post_request.rb', line 115

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/zernio-sdk/models/update_post_request.rb', line 85

def self.attribute_map
  {
    :'title' => :'title',
    :'content' => :'content',
    :'media_items' => :'mediaItems',
    :'platforms' => :'platforms',
    :'scheduled_for' => :'scheduledFor',
    :'publish_now' => :'publishNow',
    :'is_draft' => :'isDraft',
    :'timezone' => :'timezone',
    :'visibility' => :'visibility',
    :'tags' => :'tags',
    :'hashtags' => :'hashtags',
    :'mentions' => :'mentions',
    :'crossposting_enabled' => :'crosspostingEnabled',
    :'metadata' => :'metadata',
    :'queued_from_profile' => :'queuedFromProfile',
    :'queue_id' => :'queueId',
    :'tiktok_settings' => :'tiktokSettings',
    :'facebook_settings' => :'facebookSettings',
    :'recycling' => :'recycling'
  }
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



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/zernio-sdk/models/update_post_request.rb', line 325

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



145
146
147
148
# File 'lib/zernio-sdk/models/update_post_request.rb', line 145

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

.openapi_typesObject

Attribute type mapping.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/zernio-sdk/models/update_post_request.rb', line 120

def self.openapi_types
  {
    :'title' => :'String',
    :'content' => :'String',
    :'media_items' => :'Array<MediaItem>',
    :'platforms' => :'Array<UpdatePostRequestPlatformsInner>',
    :'scheduled_for' => :'Time',
    :'publish_now' => :'Boolean',
    :'is_draft' => :'Boolean',
    :'timezone' => :'String',
    :'visibility' => :'String',
    :'tags' => :'Array<String>',
    :'hashtags' => :'Array<String>',
    :'mentions' => :'Array<String>',
    :'crossposting_enabled' => :'Boolean',
    :'metadata' => :'Hash<String, Object>',
    :'queued_from_profile' => :'String',
    :'queue_id' => :'String',
    :'tiktok_settings' => :'TikTokPlatformData',
    :'facebook_settings' => :'FacebookPlatformData',
    :'recycling' => :'RecyclingConfig'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/zernio-sdk/models/update_post_request.rb', line 286

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      title == o.title &&
      content == o.content &&
      media_items == o.media_items &&
      platforms == o.platforms &&
      scheduled_for == o.scheduled_for &&
      publish_now == o.publish_now &&
      is_draft == o.is_draft &&
      timezone == o.timezone &&
      visibility == o.visibility &&
      tags == o.tags &&
      hashtags == o.hashtags &&
      mentions == o.mentions &&
      crossposting_enabled == o.crossposting_enabled &&
       == o. &&
      queued_from_profile == o.queued_from_profile &&
      queue_id == o.queue_id &&
      tiktok_settings == o.tiktok_settings &&
      facebook_settings == o.facebook_settings &&
      recycling == o.recycling
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


312
313
314
# File 'lib/zernio-sdk/models/update_post_request.rb', line 312

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



318
319
320
# File 'lib/zernio-sdk/models/update_post_request.rb', line 318

def hash
  [title, content, media_items, platforms, scheduled_for, publish_now, is_draft, timezone, visibility, tags, hashtags, mentions, crossposting_enabled, , queued_from_profile, queue_id, tiktok_settings, facebook_settings, recycling].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



259
260
261
262
263
# File 'lib/zernio-sdk/models/update_post_request.rb', line 259

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/zernio-sdk/models/update_post_request.rb', line 347

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



267
268
269
270
271
272
# File 'lib/zernio-sdk/models/update_post_request.rb', line 267

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  visibility_validator = EnumAttributeValidator.new('String', ["public", "private", "unlisted"])
  return false unless visibility_validator.valid?(@visibility)
  true
end