late-sdk 0.0.710 → 0.0.711

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.
@@ -0,0 +1,293 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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
+ # One asset from the Instagram audio catalog. Licensed music carries artist/artwork fields; original sounds carry creator fields instead, so most fields are nullable.
18
+ class InstagramAudioAsset < ApiModelBase
19
+ # Audio asset ID. Pass it as platformSpecificData.audioConfiguration.audioId when creating a Reel.
20
+ attr_accessor :audio_id
21
+
22
+ # Track or sound title.
23
+ attr_accessor :title
24
+
25
+ # Catalog type of the asset.
26
+ attr_accessor :audio_type
27
+
28
+ # Asset duration in milliseconds.
29
+ attr_accessor :duration_in_ms
30
+
31
+ # Artist name (licensed music only).
32
+ attr_accessor :display_artist
33
+
34
+ # Cover artwork thumbnail (licensed music only).
35
+ attr_accessor :cover_artwork_thumbnail_url
36
+
37
+ # Temporary preview URL. Meta expires it after roughly 1.5 days; re-fetch the asset to refresh it.
38
+ attr_accessor :download_url
39
+
40
+ # Creator username (original sounds only).
41
+ attr_accessor :ig_username
42
+
43
+ # Creator profile picture (original sounds only).
44
+ attr_accessor :profile_picture_url
45
+
46
+ # Whether the asset is eligible for ads use.
47
+ attr_accessor :is_ads_eligible
48
+
49
+ # Instagram web link to preview the audio.
50
+ attr_accessor :on_platform_audio_preview_link
51
+
52
+ class EnumAttributeValidator
53
+ attr_reader :datatype
54
+ attr_reader :allowable_values
55
+
56
+ def initialize(datatype, allowable_values)
57
+ @allowable_values = allowable_values.map do |value|
58
+ case datatype.to_s
59
+ when /Integer/i
60
+ value.to_i
61
+ when /Float/i
62
+ value.to_f
63
+ else
64
+ value
65
+ end
66
+ end
67
+ end
68
+
69
+ def valid?(value)
70
+ !value || allowable_values.include?(value)
71
+ end
72
+ end
73
+
74
+ # Attribute mapping from ruby-style variable name to JSON key.
75
+ def self.attribute_map
76
+ {
77
+ :'audio_id' => :'audioId',
78
+ :'title' => :'title',
79
+ :'audio_type' => :'audioType',
80
+ :'duration_in_ms' => :'durationInMs',
81
+ :'display_artist' => :'displayArtist',
82
+ :'cover_artwork_thumbnail_url' => :'coverArtworkThumbnailUrl',
83
+ :'download_url' => :'downloadUrl',
84
+ :'ig_username' => :'igUsername',
85
+ :'profile_picture_url' => :'profilePictureUrl',
86
+ :'is_ads_eligible' => :'isAdsEligible',
87
+ :'on_platform_audio_preview_link' => :'onPlatformAudioPreviewLink'
88
+ }
89
+ end
90
+
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
96
+ # Returns all the JSON keys this model knows about
97
+ def self.acceptable_attributes
98
+ acceptable_attribute_map.values
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.openapi_types
103
+ {
104
+ :'audio_id' => :'String',
105
+ :'title' => :'String',
106
+ :'audio_type' => :'String',
107
+ :'duration_in_ms' => :'Integer',
108
+ :'display_artist' => :'String',
109
+ :'cover_artwork_thumbnail_url' => :'String',
110
+ :'download_url' => :'String',
111
+ :'ig_username' => :'String',
112
+ :'profile_picture_url' => :'String',
113
+ :'is_ads_eligible' => :'Boolean',
114
+ :'on_platform_audio_preview_link' => :'String'
115
+ }
116
+ end
117
+
118
+ # List of attributes with nullable: true
119
+ def self.openapi_nullable
120
+ Set.new([
121
+ :'title',
122
+ :'audio_type',
123
+ :'duration_in_ms',
124
+ :'display_artist',
125
+ :'cover_artwork_thumbnail_url',
126
+ :'download_url',
127
+ :'ig_username',
128
+ :'profile_picture_url',
129
+ :'is_ads_eligible',
130
+ :'on_platform_audio_preview_link'
131
+ ])
132
+ end
133
+
134
+ # Initializes the object
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ def initialize(attributes = {})
137
+ if (!attributes.is_a?(Hash))
138
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::InstagramAudioAsset` initialize method"
139
+ end
140
+
141
+ # check to see if the attribute exists and convert string to symbol for hash key
142
+ acceptable_attribute_map = self.class.acceptable_attribute_map
143
+ attributes = attributes.each_with_object({}) { |(k, v), h|
144
+ if (!acceptable_attribute_map.key?(k.to_sym))
145
+ 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
146
+ end
147
+ h[k.to_sym] = v
148
+ }
149
+
150
+ if attributes.key?(:'audio_id')
151
+ self.audio_id = attributes[:'audio_id']
152
+ end
153
+
154
+ if attributes.key?(:'title')
155
+ self.title = attributes[:'title']
156
+ end
157
+
158
+ if attributes.key?(:'audio_type')
159
+ self.audio_type = attributes[:'audio_type']
160
+ end
161
+
162
+ if attributes.key?(:'duration_in_ms')
163
+ self.duration_in_ms = attributes[:'duration_in_ms']
164
+ end
165
+
166
+ if attributes.key?(:'display_artist')
167
+ self.display_artist = attributes[:'display_artist']
168
+ end
169
+
170
+ if attributes.key?(:'cover_artwork_thumbnail_url')
171
+ self.cover_artwork_thumbnail_url = attributes[:'cover_artwork_thumbnail_url']
172
+ end
173
+
174
+ if attributes.key?(:'download_url')
175
+ self.download_url = attributes[:'download_url']
176
+ end
177
+
178
+ if attributes.key?(:'ig_username')
179
+ self.ig_username = attributes[:'ig_username']
180
+ end
181
+
182
+ if attributes.key?(:'profile_picture_url')
183
+ self.profile_picture_url = attributes[:'profile_picture_url']
184
+ end
185
+
186
+ if attributes.key?(:'is_ads_eligible')
187
+ self.is_ads_eligible = attributes[:'is_ads_eligible']
188
+ end
189
+
190
+ if attributes.key?(:'on_platform_audio_preview_link')
191
+ self.on_platform_audio_preview_link = attributes[:'on_platform_audio_preview_link']
192
+ end
193
+ end
194
+
195
+ # Show invalid properties with the reasons. Usually used together with valid?
196
+ # @return Array for valid properties with the reasons
197
+ def list_invalid_properties
198
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
199
+ invalid_properties = Array.new
200
+ invalid_properties
201
+ end
202
+
203
+ # Check to see if the all the properties in the model are valid
204
+ # @return true if the model is valid
205
+ def valid?
206
+ warn '[DEPRECATED] the `valid?` method is obsolete'
207
+ audio_type_validator = EnumAttributeValidator.new('String', ["music", "original_sound"])
208
+ return false unless audio_type_validator.valid?(@audio_type)
209
+ true
210
+ end
211
+
212
+ # Custom attribute writer method checking allowed values (enum).
213
+ # @param [Object] audio_type Object to be assigned
214
+ def audio_type=(audio_type)
215
+ validator = EnumAttributeValidator.new('String', ["music", "original_sound"])
216
+ unless validator.valid?(audio_type)
217
+ fail ArgumentError, "invalid value for \"audio_type\", must be one of #{validator.allowable_values}."
218
+ end
219
+ @audio_type = audio_type
220
+ end
221
+
222
+ # Checks equality by comparing each attribute.
223
+ # @param [Object] Object to be compared
224
+ def ==(o)
225
+ return true if self.equal?(o)
226
+ self.class == o.class &&
227
+ audio_id == o.audio_id &&
228
+ title == o.title &&
229
+ audio_type == o.audio_type &&
230
+ duration_in_ms == o.duration_in_ms &&
231
+ display_artist == o.display_artist &&
232
+ cover_artwork_thumbnail_url == o.cover_artwork_thumbnail_url &&
233
+ download_url == o.download_url &&
234
+ ig_username == o.ig_username &&
235
+ profile_picture_url == o.profile_picture_url &&
236
+ is_ads_eligible == o.is_ads_eligible &&
237
+ on_platform_audio_preview_link == o.on_platform_audio_preview_link
238
+ end
239
+
240
+ # @see the `==` method
241
+ # @param [Object] Object to be compared
242
+ def eql?(o)
243
+ self == o
244
+ end
245
+
246
+ # Calculates hash code according to all attributes.
247
+ # @return [Integer] Hash code
248
+ def hash
249
+ [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
250
+ end
251
+
252
+ # Builds the object from hash
253
+ # @param [Hash] attributes Model attributes in the form of hash
254
+ # @return [Object] Returns the model itself
255
+ def self.build_from_hash(attributes)
256
+ return nil unless attributes.is_a?(Hash)
257
+ attributes = attributes.transform_keys(&:to_sym)
258
+ transformed_hash = {}
259
+ openapi_types.each_pair do |key, type|
260
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
261
+ transformed_hash["#{key}"] = nil
262
+ elsif type =~ /\AArray<(.*)>/i
263
+ # check to ensure the input is an array given that the attribute
264
+ # is documented as an array but the input is not
265
+ if attributes[attribute_map[key]].is_a?(Array)
266
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
267
+ end
268
+ elsif !attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
270
+ end
271
+ end
272
+ new(transformed_hash)
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ end
292
+
293
+ end
@@ -33,9 +33,11 @@ module Zernio
33
33
  # Tag Instagram users by username. The tag shape depends on the media: photos require x/y coordinates, Reels and videos take username only (coordinates are ignored), stories accept optional coordinates. For carousels, use mediaIndex to target specific slides (defaults to 0); video slides take username-only tags. Photo tags without valid coordinates are skipped.
34
34
  attr_accessor :user_tags
35
35
 
36
- # Custom name for original audio in Reels. Replaces the default \"Original Audio\" label. Can only be set once.
36
+ # Custom name for original audio in Reels. Replaces the default \"Original Audio\" label. Can only be set once. Unrelated to audioConfiguration, which attaches a catalog track.
37
37
  attr_accessor :audio_name
38
38
 
39
+ attr_accessor :audio_configuration
40
+
39
41
  # Millisecond offset from video start for the Reel cover frame. Ignored when instagramThumbnail or reelCover is provided. Defaults to 0.
40
42
  attr_accessor :thumb_offset
41
43
 
@@ -80,6 +82,7 @@ module Zernio
80
82
  :'trial_params' => :'trialParams',
81
83
  :'user_tags' => :'userTags',
82
84
  :'audio_name' => :'audioName',
85
+ :'audio_configuration' => :'audioConfiguration',
83
86
  :'thumb_offset' => :'thumbOffset',
84
87
  :'instagram_thumbnail' => :'instagramThumbnail',
85
88
  :'reel_cover' => :'reelCover',
@@ -107,6 +110,7 @@ module Zernio
107
110
  :'trial_params' => :'InstagramPlatformDataTrialParams',
108
111
  :'user_tags' => :'Array<InstagramPlatformDataUserTagsInner>',
109
112
  :'audio_name' => :'String',
113
+ :'audio_configuration' => :'InstagramPlatformDataAudioConfiguration',
110
114
  :'thumb_offset' => :'Integer',
111
115
  :'instagram_thumbnail' => :'String',
112
116
  :'reel_cover' => :'String',
@@ -170,6 +174,10 @@ module Zernio
170
174
  self.audio_name = attributes[:'audio_name']
171
175
  end
172
176
 
177
+ if attributes.key?(:'audio_configuration')
178
+ self.audio_configuration = attributes[:'audio_configuration']
179
+ end
180
+
173
181
  if attributes.key?(:'thumb_offset')
174
182
  self.thumb_offset = attributes[:'thumb_offset']
175
183
  end
@@ -247,6 +255,7 @@ module Zernio
247
255
  trial_params == o.trial_params &&
248
256
  user_tags == o.user_tags &&
249
257
  audio_name == o.audio_name &&
258
+ audio_configuration == o.audio_configuration &&
250
259
  thumb_offset == o.thumb_offset &&
251
260
  instagram_thumbnail == o.instagram_thumbnail &&
252
261
  reel_cover == o.reel_cover &&
@@ -262,7 +271,7 @@ module Zernio
262
271
  # Calculates hash code according to all attributes.
263
272
  # @return [Integer] Hash code
264
273
  def hash
265
- [content_type, share_to_feed, collaborators, first_comment, trial_params, user_tags, audio_name, thumb_offset, instagram_thumbnail, reel_cover, is_ai_generated].hash
274
+ [content_type, share_to_feed, collaborators, first_comment, trial_params, user_tags, audio_name, audio_configuration, thumb_offset, instagram_thumbnail, reel_cover, is_ai_generated].hash
266
275
  end
267
276
 
268
277
  # Builds the object from hash
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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
+ # Attach a licensed music track or original sound from the Instagram audio catalog to a Reel. Reels only (single video post, not a story or image). Requires an Instagram account connected via Facebook Login; classic Instagram Login accounts get a 400 (instagram_audio_requires_facebook_login). Get audio IDs from GET /v1/accounts/{accountId}/instagram/audio. If the track becomes unavailable by publish time (removed, region-blocked, licensing change), the post fails with a user-error; it is not published without the audio.
18
+ class InstagramPlatformDataAudioConfiguration < ApiModelBase
19
+ # Audio asset ID from the audio search endpoint.
20
+ attr_accessor :audio_id
21
+
22
+ # Volume of the attached audio track, 0-100. Defaults to 100.
23
+ attr_accessor :audio_volume
24
+
25
+ # Volume of the video's own sound, 0-100. Defaults to 100. Set 0 to mute the original video audio.
26
+ attr_accessor :video_volume
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'audio_id' => :'audioId',
32
+ :'audio_volume' => :'audioVolume',
33
+ :'video_volume' => :'videoVolume'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'audio_id' => :'String',
51
+ :'audio_volume' => :'Integer',
52
+ :'video_volume' => :'Integer'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::InstagramPlatformDataAudioConfiguration` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::InstagramPlatformDataAudioConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'audio_id')
79
+ self.audio_id = attributes[:'audio_id']
80
+ else
81
+ self.audio_id = nil
82
+ end
83
+
84
+ if attributes.key?(:'audio_volume')
85
+ self.audio_volume = attributes[:'audio_volume']
86
+ end
87
+
88
+ if attributes.key?(:'video_volume')
89
+ self.video_volume = attributes[:'video_volume']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @audio_id.nil?
99
+ invalid_properties.push('invalid value for "audio_id", audio_id cannot be nil.')
100
+ end
101
+
102
+ if !@audio_volume.nil? && @audio_volume > 100
103
+ invalid_properties.push('invalid value for "audio_volume", must be smaller than or equal to 100.')
104
+ end
105
+
106
+ if !@audio_volume.nil? && @audio_volume < 0
107
+ invalid_properties.push('invalid value for "audio_volume", must be greater than or equal to 0.')
108
+ end
109
+
110
+ if !@video_volume.nil? && @video_volume > 100
111
+ invalid_properties.push('invalid value for "video_volume", must be smaller than or equal to 100.')
112
+ end
113
+
114
+ if !@video_volume.nil? && @video_volume < 0
115
+ invalid_properties.push('invalid value for "video_volume", must be greater than or equal to 0.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @audio_id.nil?
126
+ return false if !@audio_volume.nil? && @audio_volume > 100
127
+ return false if !@audio_volume.nil? && @audio_volume < 0
128
+ return false if !@video_volume.nil? && @video_volume > 100
129
+ return false if !@video_volume.nil? && @video_volume < 0
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] audio_id Value to be assigned
135
+ def audio_id=(audio_id)
136
+ if audio_id.nil?
137
+ fail ArgumentError, 'audio_id cannot be nil'
138
+ end
139
+
140
+ @audio_id = audio_id
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] audio_volume Value to be assigned
145
+ def audio_volume=(audio_volume)
146
+ if audio_volume.nil?
147
+ fail ArgumentError, 'audio_volume cannot be nil'
148
+ end
149
+
150
+ if audio_volume > 100
151
+ fail ArgumentError, 'invalid value for "audio_volume", must be smaller than or equal to 100.'
152
+ end
153
+
154
+ if audio_volume < 0
155
+ fail ArgumentError, 'invalid value for "audio_volume", must be greater than or equal to 0.'
156
+ end
157
+
158
+ @audio_volume = audio_volume
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] video_volume Value to be assigned
163
+ def video_volume=(video_volume)
164
+ if video_volume.nil?
165
+ fail ArgumentError, 'video_volume cannot be nil'
166
+ end
167
+
168
+ if video_volume > 100
169
+ fail ArgumentError, 'invalid value for "video_volume", must be smaller than or equal to 100.'
170
+ end
171
+
172
+ if video_volume < 0
173
+ fail ArgumentError, 'invalid value for "video_volume", must be greater than or equal to 0.'
174
+ end
175
+
176
+ @video_volume = video_volume
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ audio_id == o.audio_id &&
185
+ audio_volume == o.audio_volume &&
186
+ video_volume == o.video_volume
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [audio_id, audio_volume, video_volume].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end