zernio-sdk 0.0.776 → 0.0.777

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96dda00c5e3643aed1d96709e80c4499c5757cc9894d238b517daab936693aad
4
- data.tar.gz: 05fe03faca11463fd629f3e225c18baeba0a51bb4bb23e81230e35bff0c527e8
3
+ metadata.gz: 5dd40b8855f75e21840ad56956968fb6fe7c84d18c8605441f58d3474da993c5
4
+ data.tar.gz: 85a23adf6dc681060de37e9d7cdb2e7a029cb5c314838f320c29f8c223161d92
5
5
  SHA512:
6
- metadata.gz: 5fdd0a9c883624929618895d902c8d3cafa6e0f1296695944626c89d2dcf76fc0d45e439b60aab8c3bb54aa95157b2e18a3ca5c2257938af3537b1da6d42adae
7
- data.tar.gz: 61a51275a5b0d0d01ad57fed4422faef5200b451fc21827fd9b50575717a89d5d315d50733e56a5bdecae4bc2427cbc159254c2731f0e9cc3c5757e7a6201705
6
+ metadata.gz: 8e67f22340fe7e10006368d7207286792ba834d0f2af2f37928f9b9515ce3b3c8d72285d2bf221a29a1ef76add6a23e2f447d91e2f11f65f6a0c58a9c408f6d1
7
+ data.tar.gz: e44910cd9963b03ded467773b5a2a938729cb4511ac4ef5af6d7a1269616a38b592909821b937fdc53fd1274ad0800224346e036ed1a03858bae3b48e35c1e6b
data/README.md CHANGED
@@ -1721,6 +1721,7 @@ Class | Method | HTTP request | Description
1721
1721
  - [Zernio::ListWorkflows200ResponseWorkflowsInner](docs/ListWorkflows200ResponseWorkflowsInner.md)
1722
1722
  - [Zernio::LookupSmsNumber200Response](docs/LookupSmsNumber200Response.md)
1723
1723
  - [Zernio::MarkConversationRead200Response](docs/MarkConversationRead200Response.md)
1724
+ - [Zernio::MediaContentType](docs/MediaContentType.md)
1724
1725
  - [Zernio::MediaItem](docs/MediaItem.md)
1725
1726
  - [Zernio::MediaUploadResponse](docs/MediaUploadResponse.md)
1726
1727
  - [Zernio::MetaAdsPlatformData](docs/MetaAdsPlatformData.md)
@@ -1756,7 +1757,6 @@ Class | Method | HTTP request | Description
1756
1757
  - [Zernio::PlatformAnalytics](docs/PlatformAnalytics.md)
1757
1758
  - [Zernio::PlatformTarget](docs/PlatformTarget.md)
1758
1759
  - [Zernio::PlatformTargetAccountId](docs/PlatformTargetAccountId.md)
1759
- - [Zernio::PlatformTargetPlatformSpecificData](docs/PlatformTargetPlatformSpecificData.md)
1760
1760
  - [Zernio::Post](docs/Post.md)
1761
1761
  - [Zernio::PostAnalytics](docs/PostAnalytics.md)
1762
1762
  - [Zernio::PostCreateResponse](docs/PostCreateResponse.md)
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **filename** | **String** | Name of the file to upload | |
8
- | **content_type** | **String** | MIME type of the file | |
8
+ | **content_type** | [**MediaContentType**](MediaContentType.md) | | |
9
9
  | **size** | **Integer** | Optional file size in bytes for pre-validation (max 5GB) | [optional] |
10
10
 
11
11
  ## Example
@@ -15,7 +15,7 @@ require 'zernio-sdk'
15
15
 
16
16
  instance = Zernio::GetMediaPresignedUrlRequest.new(
17
17
  filename: my-video.mp4,
18
- content_type: video/mp4,
18
+ content_type: null,
19
19
  size: 15234567
20
20
  )
21
21
  ```
data/docs/MediaApi.md CHANGED
@@ -27,7 +27,7 @@ Zernio.configure do |config|
27
27
  end
28
28
 
29
29
  api_instance = Zernio::MediaApi.new
30
- get_media_presigned_url_request = Zernio::GetMediaPresignedUrlRequest.new({filename: 'my-video.mp4', content_type: 'image/jpeg'}) # GetMediaPresignedUrlRequest |
30
+ get_media_presigned_url_request = Zernio::GetMediaPresignedUrlRequest.new({filename: 'my-video.mp4', content_type: Zernio::MediaContentType::IMAGE_JPEG}) # GetMediaPresignedUrlRequest |
31
31
 
32
32
  begin
33
33
  # Get upload URL
@@ -0,0 +1,15 @@
1
+ # Zernio::MediaContentType
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'zernio-sdk'
12
+
13
+ instance = Zernio::MediaContentType.new()
14
+ ```
15
+
@@ -9,7 +9,7 @@
9
9
  | **custom_content** | **String** | 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). | [optional] |
10
10
  | **custom_media** | [**Array<MediaItem>**](MediaItem.md) | | [optional] |
11
11
  | **scheduled_for** | **Time** | Optional per-platform scheduled time override (uses post.scheduledFor when omitted) | [optional] |
12
- | **platform_specific_data** | [**PlatformTargetPlatformSpecificData**](PlatformTargetPlatformSpecificData.md) | | [optional] |
12
+ | **platform_specific_data** | **Hash<String, Object>** | The platform-specific options stored on this target, echoed back as they were sent. Typed per platform on the way in (see the *PlatformData schemas on the request body); free-form on the way out, because a response is not guaranteed to match exactly one of those variants and generated clients that pick a variant by structure reject the entire response when it doesn't. Zernio's internal publishing state (snapshots, container ids, publish stage) is never returned here, and the key is omitted rather than sent as an empty object. | [optional] |
13
13
  | **status** | **String** | Platform-specific status: pending, publishing, published, failed | [optional] |
14
14
  | **platform_post_id** | **String** | The native post ID on the platform (populated after successful publish) | [optional] |
15
15
  | **platform_post_url** | **String** | 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. Empty when the platform confirmed the publish without returning an id a permalink can be built from (TikTok returns a publish id for some uploads); the TikTok reconcile cron backfills it later. | [optional] |
@@ -18,7 +18,6 @@ module Zernio
18
18
  # Name of the file to upload
19
19
  attr_accessor :filename
20
20
 
21
- # MIME type of the file
22
21
  attr_accessor :content_type
23
22
 
24
23
  # Optional file size in bytes for pre-validation (max 5GB)
@@ -69,7 +68,7 @@ module Zernio
69
68
  def self.openapi_types
70
69
  {
71
70
  :'filename' => :'String',
72
- :'content_type' => :'String',
71
+ :'content_type' => :'MediaContentType',
73
72
  :'size' => :'Integer'
74
73
  }
75
74
  end
@@ -135,8 +134,6 @@ module Zernio
135
134
  warn '[DEPRECATED] the `valid?` method is obsolete'
136
135
  return false if @filename.nil?
137
136
  return false if @content_type.nil?
138
- content_type_validator = EnumAttributeValidator.new('String', ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/gif", "video/mp4", "video/mpeg", "video/quicktime", "video/avi", "video/x-msvideo", "video/webm", "video/x-m4v", "application/pdf", "audio/mpeg", "audio/mp4", "audio/aac", "audio/ogg", "audio/wav", "audio/webm", "audio/x-m4a"])
139
- return false unless content_type_validator.valid?(@content_type)
140
137
  true
141
138
  end
142
139
 
@@ -150,13 +147,13 @@ module Zernio
150
147
  @filename = filename
151
148
  end
152
149
 
153
- # Custom attribute writer method checking allowed values (enum).
154
- # @param [Object] content_type Object to be assigned
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] content_type Value to be assigned
155
152
  def content_type=(content_type)
156
- validator = EnumAttributeValidator.new('String', ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/gif", "video/mp4", "video/mpeg", "video/quicktime", "video/avi", "video/x-msvideo", "video/webm", "video/x-m4v", "application/pdf", "audio/mpeg", "audio/mp4", "audio/aac", "audio/ogg", "audio/wav", "audio/webm", "audio/x-m4a"])
157
- unless validator.valid?(content_type)
158
- fail ArgumentError, "invalid value for \"content_type\", must be one of #{validator.allowable_values}."
153
+ if content_type.nil?
154
+ fail ArgumentError, 'content_type cannot be nil'
159
155
  end
156
+
160
157
  @content_type = content_type
161
158
  end
162
159
 
@@ -0,0 +1,58 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
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
+ class MediaContentType
18
+ IMAGE_JPEG = "image/jpeg".freeze
19
+ IMAGE_JPG = "image/jpg".freeze
20
+ IMAGE_PNG = "image/png".freeze
21
+ IMAGE_WEBP = "image/webp".freeze
22
+ IMAGE_GIF = "image/gif".freeze
23
+ VIDEO_MP4 = "video/mp4".freeze
24
+ VIDEO_MPEG = "video/mpeg".freeze
25
+ VIDEO_QUICKTIME = "video/quicktime".freeze
26
+ VIDEO_AVI = "video/avi".freeze
27
+ VIDEO_X_MSVIDEO = "video/x-msvideo".freeze
28
+ VIDEO_WEBM = "video/webm".freeze
29
+ VIDEO_X_M4V = "video/x-m4v".freeze
30
+ APPLICATION_PDF = "application/pdf".freeze
31
+ AUDIO_MPEG = "audio/mpeg".freeze
32
+ AUDIO_MP4 = "audio/mp4".freeze
33
+ AUDIO_AAC = "audio/aac".freeze
34
+ AUDIO_OGG = "audio/ogg".freeze
35
+ AUDIO_WAV = "audio/wav".freeze
36
+ AUDIO_WEBM = "audio/webm".freeze
37
+ AUDIO_X_M4A = "audio/x-m4a".freeze
38
+
39
+ def self.all_vars
40
+ @all_vars ||= [IMAGE_JPEG, IMAGE_JPG, IMAGE_PNG, IMAGE_WEBP, IMAGE_GIF, VIDEO_MP4, VIDEO_MPEG, VIDEO_QUICKTIME, VIDEO_AVI, VIDEO_X_MSVIDEO, VIDEO_WEBM, VIDEO_X_M4V, APPLICATION_PDF, AUDIO_MPEG, AUDIO_MP4, AUDIO_AAC, AUDIO_OGG, AUDIO_WAV, AUDIO_WEBM, AUDIO_X_M4A].freeze
41
+ end
42
+
43
+ # Builds the enum from string
44
+ # @param [String] The enum value in the form of the string
45
+ # @return [String] The enum value
46
+ def self.build_from_hash(value)
47
+ new.build_from_hash(value)
48
+ end
49
+
50
+ # Builds the enum from string
51
+ # @param [String] The enum value in the form of the string
52
+ # @return [String] The enum value
53
+ def build_from_hash(value)
54
+ return value if MediaContentType.all_vars.include?(value)
55
+ raise "Invalid ENUM value #{value} for class #MediaContentType"
56
+ end
57
+ end
58
+ end
@@ -28,6 +28,7 @@ module Zernio
28
28
  # Optional per-platform scheduled time override (uses post.scheduledFor when omitted)
29
29
  attr_accessor :scheduled_for
30
30
 
31
+ # The platform-specific options stored on this target, echoed back as they were sent. Typed per platform on the way in (see the *PlatformData schemas on the request body); free-form on the way out, because a response is not guaranteed to match exactly one of those variants and generated clients that pick a variant by structure reject the entire response when it doesn't. Zernio's internal publishing state (snapshots, container ids, publish stage) is never returned here, and the key is omitted rather than sent as an empty object.
31
32
  attr_accessor :platform_specific_data
32
33
 
33
34
  # Platform-specific status: pending, publishing, published, failed
@@ -122,7 +123,7 @@ module Zernio
122
123
  :'custom_content' => :'String',
123
124
  :'custom_media' => :'Array<MediaItem>',
124
125
  :'scheduled_for' => :'Time',
125
- :'platform_specific_data' => :'PlatformTargetPlatformSpecificData',
126
+ :'platform_specific_data' => :'Hash<String, Object>',
126
127
  :'status' => :'String',
127
128
  :'platform_post_id' => :'String',
128
129
  :'platform_post_url' => :'String',
@@ -183,7 +184,9 @@ module Zernio
183
184
  end
184
185
 
185
186
  if attributes.key?(:'platform_specific_data')
186
- self.platform_specific_data = attributes[:'platform_specific_data']
187
+ if (value = attributes[:'platform_specific_data']).is_a?(Hash)
188
+ self.platform_specific_data = value
189
+ end
187
190
  end
188
191
 
189
192
  if attributes.key?(:'status')
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.776'
14
+ VERSION = '0.0.777'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -1072,6 +1072,7 @@ require 'zernio-sdk/models/list_workflows200_response'
1072
1072
  require 'zernio-sdk/models/list_workflows200_response_workflows_inner'
1073
1073
  require 'zernio-sdk/models/lookup_sms_number200_response'
1074
1074
  require 'zernio-sdk/models/mark_conversation_read200_response'
1075
+ require 'zernio-sdk/models/media_content_type'
1075
1076
  require 'zernio-sdk/models/media_item'
1076
1077
  require 'zernio-sdk/models/media_upload_response'
1077
1078
  require 'zernio-sdk/models/meta_ads_platform_data'
@@ -1107,7 +1108,6 @@ require 'zernio-sdk/models/pinterest_platform_data'
1107
1108
  require 'zernio-sdk/models/platform_analytics'
1108
1109
  require 'zernio-sdk/models/platform_target'
1109
1110
  require 'zernio-sdk/models/platform_target_account_id'
1110
- require 'zernio-sdk/models/platform_target_platform_specific_data'
1111
1111
  require 'zernio-sdk/models/post'
1112
1112
  require 'zernio-sdk/models/post_analytics'
1113
1113
  require 'zernio-sdk/models/post_create_response'
data/openapi.yaml CHANGED
@@ -4864,6 +4864,34 @@ components:
4864
4864
  type: string
4865
4865
  enum: [platform_withheld]
4866
4866
  description: 'Why the file is missing. platform_withheld means the platform declined to return it and retrying will not help.'
4867
+ MediaContentType:
4868
+ type: string
4869
+ description: >-
4870
+ MIME type of the file to upload. Rejected with a 400 (INVALID_FIELD_VALUE
4871
+ on contentType) when it is not one of these values, so generic types such
4872
+ as application/octet-stream are not accepted here.
4873
+ example: "video/mp4"
4874
+ enum:
4875
+ - image/jpeg
4876
+ - image/jpg
4877
+ - image/png
4878
+ - image/webp
4879
+ - image/gif
4880
+ - video/mp4
4881
+ - video/mpeg
4882
+ - video/quicktime
4883
+ - video/avi
4884
+ - video/x-msvideo
4885
+ - video/webm
4886
+ - video/x-m4v
4887
+ - application/pdf
4888
+ - audio/mpeg
4889
+ - audio/mp4
4890
+ - audio/aac
4891
+ - audio/ogg
4892
+ - audio/wav
4893
+ - audio/webm
4894
+ - audio/x-m4a
4867
4895
  PlatformTarget:
4868
4896
  type: object
4869
4897
  properties:
@@ -4887,24 +4915,18 @@ components:
4887
4915
  format: date-time
4888
4916
  description: Optional per-platform scheduled time override (uses post.scheduledFor when omitted)
4889
4917
  platformSpecificData:
4890
- description: Platform-specific overrides and options.
4891
- oneOf:
4892
- - $ref: '#/components/schemas/TwitterPlatformData'
4893
- - $ref: '#/components/schemas/ThreadsPlatformData'
4894
- - $ref: '#/components/schemas/FacebookPlatformData'
4895
- - $ref: '#/components/schemas/InstagramPlatformData'
4896
- - $ref: '#/components/schemas/LinkedInPlatformData'
4897
- - $ref: '#/components/schemas/PinterestPlatformData'
4898
- - $ref: '#/components/schemas/YouTubePlatformData'
4899
- - $ref: '#/components/schemas/GoogleBusinessPlatformData'
4900
- - $ref: '#/components/schemas/TikTokPlatformData'
4901
- - $ref: '#/components/schemas/TelegramPlatformData'
4902
- - $ref: '#/components/schemas/SnapchatPlatformData'
4903
- - $ref: '#/components/schemas/RedditPlatformData'
4904
- - $ref: '#/components/schemas/BlueskyPlatformData'
4905
- - $ref: '#/components/schemas/DiscordPlatformData'
4906
- - $ref: '#/components/schemas/SlackPlatformData'
4918
+ type: object
4907
4919
  additionalProperties: true
4920
+ description: >-
4921
+ The platform-specific options stored on this target, echoed back as
4922
+ they were sent. Typed per platform on the way in (see the
4923
+ *PlatformData schemas on the request body); free-form on the way
4924
+ out, because a response is not guaranteed to match exactly one of
4925
+ those variants and generated clients that pick a variant by
4926
+ structure reject the entire response when it doesn't. Zernio's
4927
+ internal publishing state (snapshots, container ids, publish stage)
4928
+ is never returned here, and the key is omitted rather than sent as
4929
+ an empty object.
4908
4930
  status:
4909
4931
  type: string
4910
4932
  example: pending
@@ -13506,30 +13528,7 @@ paths:
13506
13528
  description: Name of the file to upload
13507
13529
  example: "my-video.mp4"
13508
13530
  contentType:
13509
- type: string
13510
- description: MIME type of the file
13511
- enum:
13512
- - image/jpeg
13513
- - image/jpg
13514
- - image/png
13515
- - image/webp
13516
- - image/gif
13517
- - video/mp4
13518
- - video/mpeg
13519
- - video/quicktime
13520
- - video/avi
13521
- - video/x-msvideo
13522
- - video/webm
13523
- - video/x-m4v
13524
- - application/pdf
13525
- - audio/mpeg
13526
- - audio/mp4
13527
- - audio/aac
13528
- - audio/ogg
13529
- - audio/wav
13530
- - audio/webm
13531
- - audio/x-m4a
13532
- example: "video/mp4"
13531
+ $ref: '#/components/schemas/MediaContentType'
13533
13532
  size:
13534
13533
  type: integer
13535
13534
  description: Optional file size in bytes for pre-validation (max 5GB)
@@ -36,10 +36,6 @@ describe Zernio::GetMediaPresignedUrlRequest do
36
36
  describe 'test attribute "content_type"' do
37
37
  it 'should work' do
38
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/gif", "video/mp4", "video/mpeg", "video/quicktime", "video/avi", "video/x-msvideo", "video/webm", "video/x-m4v", "application/pdf", "audio/mpeg", "audio/mp4", "audio/aac", "audio/ogg", "audio/wav", "audio/webm", "audio/x-m4a"])
40
- # validator.allowable_values.each do |value|
41
- # expect { instance.content_type = value }.not_to raise_error
42
- # end
43
39
  end
44
40
  end
45
41
 
@@ -14,19 +14,17 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for Zernio::PlatformTargetPlatformSpecificData
17
+ # Unit tests for Zernio::MediaContentType
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe Zernio::PlatformTargetPlatformSpecificData do
21
- describe '.openapi_one_of' do
22
- it 'lists the items referenced in the oneOf array' do
23
- expect(described_class.openapi_one_of).to_not be_empty
24
- end
25
- end
20
+ describe Zernio::MediaContentType do
21
+ #let(:instance) { Zernio::MediaContentType.new }
26
22
 
27
- describe '.build' do
28
- it 'returns the correct model' do
29
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
23
+ describe 'test an instance of MediaContentType' do
24
+ it 'should create an instance of MediaContentType' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::MediaContentType)
30
27
  end
31
28
  end
29
+
32
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zernio-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.776
4
+ version: 0.0.777
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-26 00:00:00.000000000 Z
11
+ date: 2026-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -1159,6 +1159,7 @@ files:
1159
1159
  - docs/LookupSmsNumber200Response.md
1160
1160
  - docs/MarkConversationRead200Response.md
1161
1161
  - docs/MediaApi.md
1162
+ - docs/MediaContentType.md
1162
1163
  - docs/MediaItem.md
1163
1164
  - docs/MediaUploadResponse.md
1164
1165
  - docs/MentionsApi.md
@@ -1198,7 +1199,6 @@ files:
1198
1199
  - docs/PlatformAnalytics.md
1199
1200
  - docs/PlatformTarget.md
1200
1201
  - docs/PlatformTargetAccountId.md
1201
- - docs/PlatformTargetPlatformSpecificData.md
1202
1202
  - docs/Post.md
1203
1203
  - docs/PostAnalytics.md
1204
1204
  - docs/PostCreateResponse.md
@@ -2990,6 +2990,7 @@ files:
2990
2990
  - lib/zernio-sdk/models/list_workflows200_response_workflows_inner.rb
2991
2991
  - lib/zernio-sdk/models/lookup_sms_number200_response.rb
2992
2992
  - lib/zernio-sdk/models/mark_conversation_read200_response.rb
2993
+ - lib/zernio-sdk/models/media_content_type.rb
2993
2994
  - lib/zernio-sdk/models/media_item.rb
2994
2995
  - lib/zernio-sdk/models/media_upload_response.rb
2995
2996
  - lib/zernio-sdk/models/meta_ads_platform_data.rb
@@ -3025,7 +3026,6 @@ files:
3025
3026
  - lib/zernio-sdk/models/platform_analytics.rb
3026
3027
  - lib/zernio-sdk/models/platform_target.rb
3027
3028
  - lib/zernio-sdk/models/platform_target_account_id.rb
3028
- - lib/zernio-sdk/models/platform_target_platform_specific_data.rb
3029
3029
  - lib/zernio-sdk/models/post.rb
3030
3030
  - lib/zernio-sdk/models/post_analytics.rb
3031
3031
  - lib/zernio-sdk/models/post_create_response.rb
@@ -4787,6 +4787,7 @@ files:
4787
4787
  - spec/models/list_workflows200_response_workflows_inner_spec.rb
4788
4788
  - spec/models/lookup_sms_number200_response_spec.rb
4789
4789
  - spec/models/mark_conversation_read200_response_spec.rb
4790
+ - spec/models/media_content_type_spec.rb
4790
4791
  - spec/models/media_item_spec.rb
4791
4792
  - spec/models/media_upload_response_spec.rb
4792
4793
  - spec/models/meta_ads_platform_data_spec.rb
@@ -4821,7 +4822,6 @@ files:
4821
4822
  - spec/models/pinterest_platform_data_spec.rb
4822
4823
  - spec/models/platform_analytics_spec.rb
4823
4824
  - spec/models/platform_target_account_id_spec.rb
4824
- - spec/models/platform_target_platform_specific_data_spec.rb
4825
4825
  - spec/models/platform_target_spec.rb
4826
4826
  - spec/models/post_analytics_spec.rb
4827
4827
  - spec/models/post_create_response_spec.rb
@@ -6778,7 +6778,6 @@ test_files:
6778
6778
  - spec/models/update_broadcast200_response_broadcast_spec.rb
6779
6779
  - spec/models/restore_workflow_version200_response_spec.rb
6780
6780
  - spec/models/move_account_to_profile200_response_spec.rb
6781
- - spec/models/platform_target_platform_specific_data_spec.rb
6782
6781
  - spec/models/send_conversions200_response_spec.rb
6783
6782
  - spec/models/usage_stats_limits_spec.rb
6784
6783
  - spec/models/conversion_event_spec.rb
@@ -6989,6 +6988,7 @@ test_files:
6989
6988
  - spec/models/list_broadcasts200_response_broadcasts_inner_spec.rb
6990
6989
  - spec/models/set_instagram_ice_breakers_request_spec.rb
6991
6990
  - spec/models/x_article_entity_one_of2_value_spec.rb
6991
+ - spec/models/media_content_type_spec.rb
6992
6992
  - spec/models/list_sip_trunks200_response_trunks_inner_spec.rb
6993
6993
  - spec/models/send_whats_app_conversion_request_spec.rb
6994
6994
  - spec/models/get_linked_in_supply_forecast200_response_forecast_inner_time_series_inner_spec.rb
@@ -1,75 +0,0 @@
1
- # Zernio::PlatformTargetPlatformSpecificData
2
-
3
- ## Class instance methods
4
-
5
- ### `openapi_one_of`
6
-
7
- Returns the list of classes defined in oneOf.
8
-
9
- #### Example
10
-
11
- ```ruby
12
- require 'zernio-sdk'
13
-
14
- Zernio::PlatformTargetPlatformSpecificData.openapi_one_of
15
- # =>
16
- # [
17
- # :'BlueskyPlatformData',
18
- # :'DiscordPlatformData',
19
- # :'FacebookPlatformData',
20
- # :'GoogleBusinessPlatformData',
21
- # :'InstagramPlatformData',
22
- # :'LinkedInPlatformData',
23
- # :'PinterestPlatformData',
24
- # :'RedditPlatformData',
25
- # :'SlackPlatformData',
26
- # :'SnapchatPlatformData',
27
- # :'TelegramPlatformData',
28
- # :'ThreadsPlatformData',
29
- # :'TikTokPlatformData',
30
- # :'TwitterPlatformData',
31
- # :'YouTubePlatformData'
32
- # ]
33
- ```
34
-
35
- ### build
36
-
37
- Find the appropriate object from the `openapi_one_of` list and casts the data into it.
38
-
39
- #### Example
40
-
41
- ```ruby
42
- require 'zernio-sdk'
43
-
44
- Zernio::PlatformTargetPlatformSpecificData.build(data)
45
- # => #<BlueskyPlatformData:0x00007fdd4aab02a0>
46
-
47
- Zernio::PlatformTargetPlatformSpecificData.build(data_that_doesnt_match)
48
- # => nil
49
- ```
50
-
51
- #### Parameters
52
-
53
- | Name | Type | Description |
54
- | ---- | ---- | ----------- |
55
- | **data** | **Mixed** | data to be matched against the list of oneOf items |
56
-
57
- #### Return type
58
-
59
- - `BlueskyPlatformData`
60
- - `DiscordPlatformData`
61
- - `FacebookPlatformData`
62
- - `GoogleBusinessPlatformData`
63
- - `InstagramPlatformData`
64
- - `LinkedInPlatformData`
65
- - `PinterestPlatformData`
66
- - `RedditPlatformData`
67
- - `SlackPlatformData`
68
- - `SnapchatPlatformData`
69
- - `TelegramPlatformData`
70
- - `ThreadsPlatformData`
71
- - `TikTokPlatformData`
72
- - `TwitterPlatformData`
73
- - `YouTubePlatformData`
74
- - `nil` (if no type matches)
75
-
@@ -1,118 +0,0 @@
1
- =begin
2
- #Zernio API
3
-
4
- #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
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
- # Platform-specific overrides and options.
18
- module PlatformTargetPlatformSpecificData
19
- class << self
20
- # List of class defined in oneOf (OpenAPI v3)
21
- def openapi_one_of
22
- [
23
- :'BlueskyPlatformData',
24
- :'DiscordPlatformData',
25
- :'FacebookPlatformData',
26
- :'GoogleBusinessPlatformData',
27
- :'InstagramPlatformData',
28
- :'LinkedInPlatformData',
29
- :'PinterestPlatformData',
30
- :'RedditPlatformData',
31
- :'SlackPlatformData',
32
- :'SnapchatPlatformData',
33
- :'TelegramPlatformData',
34
- :'ThreadsPlatformData',
35
- :'TikTokPlatformData',
36
- :'TwitterPlatformData',
37
- :'YouTubePlatformData'
38
- ]
39
- end
40
-
41
- # Builds the object
42
- # @param [Mixed] Data to be matched against the list of oneOf items
43
- # @return [Object] Returns the model or the data itself
44
- def build(data)
45
- # Go through the list of oneOf items and attempt to identify the appropriate one.
46
- # Note:
47
- # - We do not attempt to check whether exactly one item matches.
48
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
49
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
50
- # - TODO: scalar values are de facto behaving as if they were nullable.
51
- # - TODO: logging when debugging is set.
52
- openapi_one_of.each do |klass|
53
- begin
54
- next if klass == :AnyType # "nullable: true"
55
- return find_and_cast_into_type(klass, data)
56
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
57
- end
58
- end
59
-
60
- openapi_one_of.include?(:AnyType) ? data : nil
61
- end
62
-
63
- private
64
-
65
- SchemaMismatchError = Class.new(StandardError)
66
-
67
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
68
- def find_and_cast_into_type(klass, data)
69
- return if data.nil?
70
-
71
- case klass.to_s
72
- when 'Boolean'
73
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
74
- when 'Float'
75
- return data if data.instance_of?(Float)
76
- when 'Integer'
77
- return data if data.instance_of?(Integer)
78
- when 'Time'
79
- return Time.parse(data)
80
- when 'Date'
81
- return Date.iso8601(data)
82
- when 'String'
83
- return data if data.instance_of?(String)
84
- when 'Object' # "type: object"
85
- return data if data.instance_of?(Hash)
86
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
87
- if data.instance_of?(Array)
88
- sub_type = Regexp.last_match[:sub_type]
89
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
90
- end
91
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
92
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
93
- sub_type = Regexp.last_match[:sub_type]
94
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
95
- end
96
- else # model
97
- const = Zernio.const_get(klass)
98
- if const
99
- if const.respond_to?(:openapi_one_of) # nested oneOf model
100
- model = const.build(data)
101
- return model if model
102
- else
103
- # raise if data contains keys that are not known to the model
104
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
105
- model = const.build_from_hash(data)
106
- return model if model
107
- end
108
- end
109
- end
110
-
111
- raise # if no match by now, raise
112
- rescue
113
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
114
- end
115
- end
116
- end
117
-
118
- end