Class: Zernio::InstagramAudioAsset
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::InstagramAudioAsset
- Defined in:
- lib/zernio-sdk/models/instagram_audio_asset.rb
Overview
One asset from the Instagram audio catalog. Licensed music carries artist/artwork fields; original sounds carry creator fields instead, so most fields are nullable.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#audio_id ⇒ Object
Audio asset ID.
-
#audio_type ⇒ Object
Catalog type of the asset.
-
#cover_artwork_thumbnail_url ⇒ Object
Cover artwork thumbnail (licensed music only).
-
#display_artist ⇒ Object
Artist name (licensed music only).
-
#download_url ⇒ Object
Temporary preview URL.
-
#duration_in_ms ⇒ Object
Asset duration in milliseconds.
-
#ig_username ⇒ Object
Creator username (original sounds only).
-
#is_ads_eligible ⇒ Object
Whether the asset is eligible for ads use.
-
#on_platform_audio_preview_link ⇒ Object
Instagram web link to preview the audio.
-
#profile_picture_url ⇒ Object
Creator profile picture (original sounds only).
-
#title ⇒ Object
Track or sound title.
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 = {}) ⇒ InstagramAudioAsset
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 = {}) ⇒ InstagramAudioAsset
Initializes the object
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 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 136 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::InstagramAudioAsset` 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::InstagramAudioAsset`. 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?(:'audio_id') self.audio_id = attributes[:'audio_id'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'audio_type') self.audio_type = attributes[:'audio_type'] end if attributes.key?(:'duration_in_ms') self.duration_in_ms = attributes[:'duration_in_ms'] end if attributes.key?(:'display_artist') self.display_artist = attributes[:'display_artist'] end if attributes.key?(:'cover_artwork_thumbnail_url') self.cover_artwork_thumbnail_url = attributes[:'cover_artwork_thumbnail_url'] end if attributes.key?(:'download_url') self.download_url = attributes[:'download_url'] end if attributes.key?(:'ig_username') self.ig_username = attributes[:'ig_username'] end if attributes.key?(:'profile_picture_url') self.profile_picture_url = attributes[:'profile_picture_url'] end if attributes.key?(:'is_ads_eligible') self.is_ads_eligible = attributes[:'is_ads_eligible'] end if attributes.key?(:'on_platform_audio_preview_link') self.on_platform_audio_preview_link = attributes[:'on_platform_audio_preview_link'] end end |
Instance Attribute Details
#audio_id ⇒ Object
Audio asset ID. Pass it as platformSpecificData.audioConfiguration.audioId when creating a Reel.
20 21 22 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 20 def audio_id @audio_id end |
#audio_type ⇒ Object
Catalog type of the asset.
26 27 28 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 26 def audio_type @audio_type end |
#cover_artwork_thumbnail_url ⇒ Object
Cover artwork thumbnail (licensed music only).
35 36 37 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 35 def cover_artwork_thumbnail_url @cover_artwork_thumbnail_url end |
#display_artist ⇒ Object
Artist name (licensed music only).
32 33 34 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 32 def display_artist @display_artist end |
#download_url ⇒ Object
Temporary preview URL. Meta expires it after roughly 1.5 days; re-fetch the asset to refresh it.
38 39 40 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 38 def download_url @download_url end |
#duration_in_ms ⇒ Object
Asset duration in milliseconds.
29 30 31 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 29 def duration_in_ms @duration_in_ms end |
#ig_username ⇒ Object
Creator username (original sounds only).
41 42 43 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 41 def ig_username @ig_username end |
#is_ads_eligible ⇒ Object
Whether the asset is eligible for ads use.
47 48 49 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 47 def is_ads_eligible @is_ads_eligible end |
#on_platform_audio_preview_link ⇒ Object
Instagram web link to preview the audio.
50 51 52 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 50 def on_platform_audio_preview_link @on_platform_audio_preview_link end |
#profile_picture_url ⇒ Object
Creator profile picture (original sounds only).
44 45 46 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 44 def profile_picture_url @profile_picture_url end |
#title ⇒ Object
Track or sound title.
23 24 25 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 23 def title @title end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
92 93 94 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 92 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
97 98 99 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 97 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 75 def self.attribute_map { :'audio_id' => :'audioId', :'title' => :'title', :'audio_type' => :'audioType', :'duration_in_ms' => :'durationInMs', :'display_artist' => :'displayArtist', :'cover_artwork_thumbnail_url' => :'coverArtworkThumbnailUrl', :'download_url' => :'downloadUrl', :'ig_username' => :'igUsername', :'profile_picture_url' => :'profilePictureUrl', :'is_ads_eligible' => :'isAdsEligible', :'on_platform_audio_preview_link' => :'onPlatformAudioPreviewLink' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 255 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
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 119 def self.openapi_nullable Set.new([ :'title', :'audio_type', :'duration_in_ms', :'display_artist', :'cover_artwork_thumbnail_url', :'download_url', :'ig_username', :'profile_picture_url', :'is_ads_eligible', :'on_platform_audio_preview_link' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 102 def self.openapi_types { :'audio_id' => :'String', :'title' => :'String', :'audio_type' => :'String', :'duration_in_ms' => :'Integer', :'display_artist' => :'String', :'cover_artwork_thumbnail_url' => :'String', :'download_url' => :'String', :'ig_username' => :'String', :'profile_picture_url' => :'String', :'is_ads_eligible' => :'Boolean', :'on_platform_audio_preview_link' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 224 def ==(o) return true if self.equal?(o) self.class == o.class && audio_id == o.audio_id && title == o.title && audio_type == o.audio_type && duration_in_ms == o.duration_in_ms && display_artist == o.display_artist && cover_artwork_thumbnail_url == o.cover_artwork_thumbnail_url && download_url == o.download_url && ig_username == o.ig_username && profile_picture_url == o.profile_picture_url && is_ads_eligible == o.is_ads_eligible && on_platform_audio_preview_link == o.on_platform_audio_preview_link end |
#eql?(o) ⇒ Boolean
242 243 244 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 242 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
248 249 250 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 248 def hash [audio_id, title, audio_type, duration_in_ms, display_artist, cover_artwork_thumbnail_url, download_url, ig_username, profile_picture_url, is_ads_eligible, on_platform_audio_preview_link].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
197 198 199 200 201 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 197 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
277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 277 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
205 206 207 208 209 210 |
# File 'lib/zernio-sdk/models/instagram_audio_asset.rb', line 205 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' audio_type_validator = EnumAttributeValidator.new('String', ["music", "original_sound"]) return false unless audio_type_validator.valid?(@audio_type) true end |