Class: Zernio::PlatformTarget
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::PlatformTarget
- Defined in:
- lib/zernio-sdk/models/platform_target.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#custom_content ⇒ Object
Platform-specific text override.
-
#custom_media ⇒ Object
Returns the value of attribute custom_media.
-
#error_category ⇒ Object
Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown.
-
#error_message ⇒ Object
Human-readable error message when status is failed.
-
#error_source ⇒ Object
Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare).
-
#is_trial_reel ⇒ Object
Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams).
-
#platform ⇒ Object
Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram.
-
#platform_post_id ⇒ Object
The native post ID on the platform (populated after successful publish).
-
#platform_post_url ⇒ Object
Public URL of the published post.
-
#platform_specific_data ⇒ Object
Returns the value of attribute platform_specific_data.
-
#published_at ⇒ Object
Timestamp when the post was published to this platform.
-
#removed_from_platform_at ⇒ Object
Set when a post that was successfully published later disappears from the platform (deleted on-platform or taken down by the platform).
-
#scheduled_for ⇒ Object
Optional per-platform scheduled time override (uses post.scheduledFor when omitted).
-
#status ⇒ Object
Platform-specific status: pending, publishing, published, failed.
-
#trial_graduation_strategy ⇒ Object
Graduation strategy the trial reel was launched with.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PlatformTarget
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ PlatformTarget
Initializes the object
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 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 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 148 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::PlatformTarget` 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::PlatformTarget`. 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'] end if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] end if attributes.key?(:'custom_content') self.custom_content = attributes[:'custom_content'] end if attributes.key?(:'custom_media') if (value = attributes[:'custom_media']).is_a?(Array) self.custom_media = value end end if attributes.key?(:'scheduled_for') self.scheduled_for = attributes[:'scheduled_for'] end if attributes.key?(:'platform_specific_data') self.platform_specific_data = attributes[:'platform_specific_data'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'platform_post_id') self.platform_post_id = attributes[:'platform_post_id'] end if attributes.key?(:'platform_post_url') self.platform_post_url = attributes[:'platform_post_url'] end if attributes.key?(:'published_at') self.published_at = attributes[:'published_at'] end if attributes.key?(:'removed_from_platform_at') self.removed_from_platform_at = attributes[:'removed_from_platform_at'] end if attributes.key?(:'is_trial_reel') self.is_trial_reel = attributes[:'is_trial_reel'] end if attributes.key?(:'trial_graduation_strategy') self.trial_graduation_strategy = attributes[:'trial_graduation_strategy'] end if attributes.key?(:'error_message') self. = attributes[:'error_message'] end if attributes.key?(:'error_category') self.error_category = attributes[:'error_category'] end if attributes.key?(:'error_source') self.error_source = attributes[:'error_source'] end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
21 22 23 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 21 def account_id @account_id end |
#custom_content ⇒ Object
Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters).
24 25 26 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 24 def custom_content @custom_content end |
#custom_media ⇒ Object
Returns the value of attribute custom_media.
26 27 28 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 26 def custom_media @custom_media end |
#error_category ⇒ Object
Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown
58 59 60 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 58 def error_category @error_category end |
#error_message ⇒ Object
Human-readable error message when status is failed. Contains platform-specific error details explaining why the publish failed.
55 56 57 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 55 def @error_message end |
#error_source ⇒ Object
Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare)
61 62 63 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 61 def error_source @error_source end |
#is_trial_reel ⇒ Object
Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics. Note: Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only. It indicates the reel STARTED as a trial, not whether or when it graduated.
49 50 51 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 49 def is_trial_reel @is_trial_reel end |
#platform ⇒ Object
Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
19 20 21 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 19 def platform @platform end |
#platform_post_id ⇒ Object
The native post ID on the platform (populated after successful publish)
37 38 39 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 37 def platform_post_id @platform_post_id end |
#platform_post_url ⇒ Object
Public URL of the published post. Included in the response for immediate posts; for scheduled posts, fetch via GET /v1/posts/postId after publish time.
40 41 42 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 40 def platform_post_url @platform_post_url end |
#platform_specific_data ⇒ Object
Returns the value of attribute platform_specific_data.
31 32 33 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 31 def platform_specific_data @platform_specific_data end |
#published_at ⇒ Object
Timestamp when the post was published to this platform
43 44 45 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 43 def published_at @published_at end |
#removed_from_platform_at ⇒ Object
Set when a post that was successfully published later disappears from the platform (deleted on-platform or taken down by the platform). status stays "published" (it reflects the publish outcome); poll this field to detect post-publish removals. Absent while the post is live, and cleared if the post reappears. Detection runs with the analytics sync, so expect up to a few hours of lag.
46 47 48 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 46 def removed_from_platform_at @removed_from_platform_at end |
#scheduled_for ⇒ Object
Optional per-platform scheduled time override (uses post.scheduledFor when omitted)
29 30 31 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 29 def scheduled_for @scheduled_for end |
#status ⇒ Object
Platform-specific status: pending, publishing, published, failed
34 35 36 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 34 def status @status end |
#trial_graduation_strategy ⇒ Object
Graduation strategy the trial reel was launched with. Present only when isTrialReel is true.
52 53 54 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 52 def trial_graduation_strategy @trial_graduation_strategy end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
108 109 110 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 108 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
113 114 115 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 113 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 86 def self.attribute_map { :'platform' => :'platform', :'account_id' => :'accountId', :'custom_content' => :'customContent', :'custom_media' => :'customMedia', :'scheduled_for' => :'scheduledFor', :'platform_specific_data' => :'platformSpecificData', :'status' => :'status', :'platform_post_id' => :'platformPostId', :'platform_post_url' => :'platformPostUrl', :'published_at' => :'publishedAt', :'removed_from_platform_at' => :'removedFromPlatformAt', :'is_trial_reel' => :'isTrialReel', :'trial_graduation_strategy' => :'trialGraduationStrategy', :'error_message' => :'errorMessage', :'error_category' => :'errorCategory', :'error_source' => :'errorSource' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 318 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_nullable ⇒ Object
List of attributes with nullable: true
140 141 142 143 144 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 140 def self.openapi_nullable Set.new([ :'removed_from_platform_at', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 118 def self.openapi_types { :'platform' => :'String', :'account_id' => :'PlatformTargetAccountId', :'custom_content' => :'String', :'custom_media' => :'Array<MediaItem>', :'scheduled_for' => :'Time', :'platform_specific_data' => :'PlatformTargetPlatformSpecificData', :'status' => :'String', :'platform_post_id' => :'String', :'platform_post_url' => :'String', :'published_at' => :'Time', :'removed_from_platform_at' => :'Time', :'is_trial_reel' => :'Boolean', :'trial_graduation_strategy' => :'String', :'error_message' => :'String', :'error_category' => :'String', :'error_source' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 282 def ==(o) return true if self.equal?(o) self.class == o.class && platform == o.platform && account_id == o.account_id && custom_content == o.custom_content && custom_media == o.custom_media && scheduled_for == o.scheduled_for && platform_specific_data == o.platform_specific_data && status == o.status && platform_post_id == o.platform_post_id && platform_post_url == o.platform_post_url && published_at == o.published_at && removed_from_platform_at == o.removed_from_platform_at && is_trial_reel == o.is_trial_reel && trial_graduation_strategy == o.trial_graduation_strategy && == o. && error_category == o.error_category && error_source == o.error_source end |
#eql?(o) ⇒ Boolean
305 306 307 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 305 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
311 312 313 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 311 def hash [platform, account_id, custom_content, custom_media, scheduled_for, platform_specific_data, status, platform_post_id, platform_post_url, published_at, removed_from_platform_at, is_trial_reel, trial_graduation_strategy, , error_category, error_source].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
231 232 233 234 235 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 231 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 340 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
239 240 241 242 243 244 245 246 247 248 |
# File 'lib/zernio-sdk/models/platform_target.rb', line 239 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' trial_graduation_strategy_validator = EnumAttributeValidator.new('String', ["MANUAL", "SS_PERFORMANCE"]) return false unless trial_graduation_strategy_validator.valid?(@trial_graduation_strategy) error_category_validator = EnumAttributeValidator.new('String', ["auth_expired", "user_content", "user_abuse", "account_issue", "platform_rejected", "platform_error", "system_error", "unknown"]) return false unless error_category_validator.valid?(@error_category) error_source_validator = EnumAttributeValidator.new('String', ["user", "platform", "system"]) return false unless error_source_validator.valid?(@error_source) true end |