late-sdk 0.0.103 → 0.0.104

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.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -52
  3. data/lib/late-sdk/version.rb +1 -1
  4. data/lib/late-sdk.rb +0 -41
  5. data/openapi.yaml +1 -731
  6. data/zernio-sdk-0.0.104.gem +0 -0
  7. metadata +2 -166
  8. data/docs/CaptionResponse.md +0 -18
  9. data/docs/CheckInstagramHashtags200Response.md +0 -22
  10. data/docs/CheckInstagramHashtags200ResponseResultsInner.md +0 -24
  11. data/docs/CheckInstagramHashtags200ResponseSummary.md +0 -22
  12. data/docs/CheckInstagramHashtagsRequest.md +0 -18
  13. data/docs/DownloadBlueskyMedia200Response.md +0 -26
  14. data/docs/DownloadFacebookVideo200Response.md +0 -24
  15. data/docs/DownloadFormat.md +0 -26
  16. data/docs/DownloadInstagramMedia200Response.md +0 -22
  17. data/docs/DownloadResponse.md +0 -26
  18. data/docs/DownloadTikTokVideo200Response.md +0 -24
  19. data/docs/DownloadTikTokVideo200ResponseFormatsInner.md +0 -22
  20. data/docs/DownloadYouTubeVideo200Response.md +0 -24
  21. data/docs/DownloadYouTubeVideo200ResponseFormatsInner.md +0 -28
  22. data/docs/GetYouTubeTranscript200Response.md +0 -26
  23. data/docs/GetYouTubeTranscript200ResponseSegmentsInner.md +0 -22
  24. data/docs/HashtagCheckResponse.md +0 -18
  25. data/docs/HashtagInfo.md +0 -22
  26. data/docs/ToolsApi.md +0 -663
  27. data/docs/TranscriptResponse.md +0 -22
  28. data/docs/TranscriptSegment.md +0 -22
  29. data/docs/ValidateApi.md +0 -287
  30. data/docs/ValidateMedia200Response.md +0 -32
  31. data/docs/ValidateMedia200ResponsePlatformLimitsValue.md +0 -22
  32. data/docs/ValidateMediaRequest.md +0 -18
  33. data/docs/ValidatePost200Response.md +0 -49
  34. data/docs/ValidatePost200ResponseOneOf.md +0 -22
  35. data/docs/ValidatePost200ResponseOneOf1.md +0 -22
  36. data/docs/ValidatePost200ResponseOneOf1ErrorsInner.md +0 -20
  37. data/docs/ValidatePost200ResponseOneOfWarningsInner.md +0 -20
  38. data/docs/ValidatePostLength200Response.md +0 -20
  39. data/docs/ValidatePostLength200ResponsePlatformsValue.md +0 -22
  40. data/docs/ValidatePostLengthRequest.md +0 -18
  41. data/docs/ValidatePostRequest.md +0 -22
  42. data/docs/ValidatePostRequestMediaItemsInner.md +0 -20
  43. data/docs/ValidatePostRequestPlatformsInner.md +0 -24
  44. data/docs/ValidatePostRequestPlatformsInnerCustomMediaInner.md +0 -20
  45. data/docs/ValidateSubreddit200Response.md +0 -49
  46. data/docs/ValidateSubreddit200ResponseOneOf.md +0 -20
  47. data/docs/ValidateSubreddit200ResponseOneOf1.md +0 -20
  48. data/docs/ValidateSubreddit200ResponseOneOfSubreddit.md +0 -32
  49. data/lib/late-sdk/api/tools_api.rb +0 -649
  50. data/lib/late-sdk/api/validate_api.rb +0 -290
  51. data/lib/late-sdk/models/caption_response.rb +0 -147
  52. data/lib/late-sdk/models/check_instagram_hashtags200_response.rb +0 -167
  53. data/lib/late-sdk/models/check_instagram_hashtags200_response_results_inner.rb +0 -208
  54. data/lib/late-sdk/models/check_instagram_hashtags200_response_summary.rb +0 -165
  55. data/lib/late-sdk/models/check_instagram_hashtags_request.rb +0 -175
  56. data/lib/late-sdk/models/download_bluesky_media200_response.rb +0 -183
  57. data/lib/late-sdk/models/download_facebook_video200_response.rb +0 -174
  58. data/lib/late-sdk/models/download_format.rb +0 -183
  59. data/lib/late-sdk/models/download_instagram_media200_response.rb +0 -165
  60. data/lib/late-sdk/models/download_response.rb +0 -185
  61. data/lib/late-sdk/models/download_tik_tok_video200_response.rb +0 -176
  62. data/lib/late-sdk/models/download_tik_tok_video200_response_formats_inner.rb +0 -165
  63. data/lib/late-sdk/models/download_you_tube_video200_response.rb +0 -176
  64. data/lib/late-sdk/models/download_you_tube_video200_response_formats_inner.rb +0 -192
  65. data/lib/late-sdk/models/get_you_tube_transcript200_response.rb +0 -185
  66. data/lib/late-sdk/models/get_you_tube_transcript200_response_segments_inner.rb +0 -165
  67. data/lib/late-sdk/models/hashtag_check_response.rb +0 -149
  68. data/lib/late-sdk/models/hashtag_info.rb +0 -199
  69. data/lib/late-sdk/models/transcript_response.rb +0 -167
  70. data/lib/late-sdk/models/transcript_segment.rb +0 -165
  71. data/lib/late-sdk/models/validate_media200_response.rb +0 -249
  72. data/lib/late-sdk/models/validate_media200_response_platform_limits_value.rb +0 -166
  73. data/lib/late-sdk/models/validate_media_request.rb +0 -165
  74. data/lib/late-sdk/models/validate_post200_response.rb +0 -104
  75. data/lib/late-sdk/models/validate_post200_response_one_of.rb +0 -168
  76. data/lib/late-sdk/models/validate_post200_response_one_of1.rb +0 -170
  77. data/lib/late-sdk/models/validate_post200_response_one_of1_errors_inner.rb +0 -156
  78. data/lib/late-sdk/models/validate_post200_response_one_of_warnings_inner.rb +0 -156
  79. data/lib/late-sdk/models/validate_post_length200_response.rb +0 -158
  80. data/lib/late-sdk/models/validate_post_length200_response_platforms_value.rb +0 -168
  81. data/lib/late-sdk/models/validate_post_length_request.rb +0 -165
  82. data/lib/late-sdk/models/validate_post_request.rb +0 -189
  83. data/lib/late-sdk/models/validate_post_request_media_items_inner.rb +0 -190
  84. data/lib/late-sdk/models/validate_post_request_platforms_inner.rb +0 -217
  85. data/lib/late-sdk/models/validate_post_request_platforms_inner_custom_media_inner.rb +0 -190
  86. data/lib/late-sdk/models/validate_subreddit200_response.rb +0 -104
  87. data/lib/late-sdk/models/validate_subreddit200_response_one_of.rb +0 -157
  88. data/lib/late-sdk/models/validate_subreddit200_response_one_of1.rb +0 -157
  89. data/lib/late-sdk/models/validate_subreddit200_response_one_of_subreddit.rb +0 -244
  90. data/spec/api/tools_api_spec.rb +0 -152
  91. data/spec/api/validate_api_spec.rb +0 -83
  92. data/spec/models/caption_response_spec.rb +0 -36
  93. data/spec/models/check_instagram_hashtags200_response_results_inner_spec.rb +0 -58
  94. data/spec/models/check_instagram_hashtags200_response_spec.rb +0 -48
  95. data/spec/models/check_instagram_hashtags200_response_summary_spec.rb +0 -48
  96. data/spec/models/check_instagram_hashtags_request_spec.rb +0 -36
  97. data/spec/models/download_bluesky_media200_response_spec.rb +0 -60
  98. data/spec/models/download_facebook_video200_response_spec.rb +0 -54
  99. data/spec/models/download_format_spec.rb +0 -60
  100. data/spec/models/download_instagram_media200_response_spec.rb +0 -48
  101. data/spec/models/download_response_spec.rb +0 -60
  102. data/spec/models/download_tik_tok_video200_response_formats_inner_spec.rb +0 -48
  103. data/spec/models/download_tik_tok_video200_response_spec.rb +0 -54
  104. data/spec/models/download_you_tube_video200_response_formats_inner_spec.rb +0 -66
  105. data/spec/models/download_you_tube_video200_response_spec.rb +0 -54
  106. data/spec/models/get_you_tube_transcript200_response_segments_inner_spec.rb +0 -48
  107. data/spec/models/get_you_tube_transcript200_response_spec.rb +0 -60
  108. data/spec/models/hashtag_check_response_spec.rb +0 -36
  109. data/spec/models/hashtag_info_spec.rb +0 -52
  110. data/spec/models/transcript_response_spec.rb +0 -48
  111. data/spec/models/transcript_segment_spec.rb +0 -48
  112. data/spec/models/validate_media200_response_platform_limits_value_spec.rb +0 -48
  113. data/spec/models/validate_media200_response_spec.rb +0 -82
  114. data/spec/models/validate_media_request_spec.rb +0 -36
  115. data/spec/models/validate_post200_response_one_of1_errors_inner_spec.rb +0 -42
  116. data/spec/models/validate_post200_response_one_of1_spec.rb +0 -48
  117. data/spec/models/validate_post200_response_one_of_spec.rb +0 -48
  118. data/spec/models/validate_post200_response_one_of_warnings_inner_spec.rb +0 -42
  119. data/spec/models/validate_post200_response_spec.rb +0 -32
  120. data/spec/models/validate_post_length200_response_platforms_value_spec.rb +0 -48
  121. data/spec/models/validate_post_length200_response_spec.rb +0 -42
  122. data/spec/models/validate_post_length_request_spec.rb +0 -36
  123. data/spec/models/validate_post_request_media_items_inner_spec.rb +0 -46
  124. data/spec/models/validate_post_request_platforms_inner_custom_media_inner_spec.rb +0 -46
  125. data/spec/models/validate_post_request_platforms_inner_spec.rb +0 -58
  126. data/spec/models/validate_post_request_spec.rb +0 -48
  127. data/spec/models/validate_subreddit200_response_one_of1_spec.rb +0 -42
  128. data/spec/models/validate_subreddit200_response_one_of_spec.rb +0 -42
  129. data/spec/models/validate_subreddit200_response_one_of_subreddit_spec.rb +0 -82
  130. data/spec/models/validate_subreddit200_response_spec.rb +0 -32
  131. data/zernio-sdk-0.0.103.gem +0 -0
@@ -1,190 +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
5
-
6
- The version of the OpenAPI document: 1.0.1
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 Late
17
- class ValidatePostRequestMediaItemsInner < ApiModelBase
18
- attr_accessor :url
19
-
20
- attr_accessor :type
21
-
22
- class EnumAttributeValidator
23
- attr_reader :datatype
24
- attr_reader :allowable_values
25
-
26
- def initialize(datatype, allowable_values)
27
- @allowable_values = allowable_values.map do |value|
28
- case datatype.to_s
29
- when /Integer/i
30
- value.to_i
31
- when /Float/i
32
- value.to_f
33
- else
34
- value
35
- end
36
- end
37
- end
38
-
39
- def valid?(value)
40
- !value || allowable_values.include?(value)
41
- end
42
- end
43
-
44
- # Attribute mapping from ruby-style variable name to JSON key.
45
- def self.attribute_map
46
- {
47
- :'url' => :'url',
48
- :'type' => :'type'
49
- }
50
- end
51
-
52
- # Returns attribute mapping this model knows about
53
- def self.acceptable_attribute_map
54
- attribute_map
55
- end
56
-
57
- # Returns all the JSON keys this model knows about
58
- def self.acceptable_attributes
59
- acceptable_attribute_map.values
60
- end
61
-
62
- # Attribute type mapping.
63
- def self.openapi_types
64
- {
65
- :'url' => :'String',
66
- :'type' => :'String'
67
- }
68
- end
69
-
70
- # List of attributes with nullable: true
71
- def self.openapi_nullable
72
- Set.new([
73
- ])
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePostRequestMediaItemsInner` initialize method"
81
- end
82
-
83
- # check to see if the attribute exists and convert string to symbol for hash key
84
- acceptable_attribute_map = self.class.acceptable_attribute_map
85
- attributes = attributes.each_with_object({}) { |(k, v), h|
86
- if (!acceptable_attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePostRequestMediaItemsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
- end
89
- h[k.to_sym] = v
90
- }
91
-
92
- if attributes.key?(:'url')
93
- self.url = attributes[:'url']
94
- end
95
-
96
- if attributes.key?(:'type')
97
- self.type = attributes[:'type']
98
- end
99
- end
100
-
101
- # Show invalid properties with the reasons. Usually used together with valid?
102
- # @return Array for valid properties with the reasons
103
- def list_invalid_properties
104
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
- invalid_properties = Array.new
106
- invalid_properties
107
- end
108
-
109
- # Check to see if the all the properties in the model are valid
110
- # @return true if the model is valid
111
- def valid?
112
- warn '[DEPRECATED] the `valid?` method is obsolete'
113
- type_validator = EnumAttributeValidator.new('String', ["image", "video"])
114
- return false unless type_validator.valid?(@type)
115
- true
116
- end
117
-
118
- # Custom attribute writer method checking allowed values (enum).
119
- # @param [Object] type Object to be assigned
120
- def type=(type)
121
- validator = EnumAttributeValidator.new('String', ["image", "video"])
122
- unless validator.valid?(type)
123
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
124
- end
125
- @type = type
126
- end
127
-
128
- # Checks equality by comparing each attribute.
129
- # @param [Object] Object to be compared
130
- def ==(o)
131
- return true if self.equal?(o)
132
- self.class == o.class &&
133
- url == o.url &&
134
- type == o.type
135
- end
136
-
137
- # @see the `==` method
138
- # @param [Object] Object to be compared
139
- def eql?(o)
140
- self == o
141
- end
142
-
143
- # Calculates hash code according to all attributes.
144
- # @return [Integer] Hash code
145
- def hash
146
- [url, type].hash
147
- end
148
-
149
- # Builds the object from hash
150
- # @param [Hash] attributes Model attributes in the form of hash
151
- # @return [Object] Returns the model itself
152
- def self.build_from_hash(attributes)
153
- return nil unless attributes.is_a?(Hash)
154
- attributes = attributes.transform_keys(&:to_sym)
155
- transformed_hash = {}
156
- openapi_types.each_pair do |key, type|
157
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
- transformed_hash["#{key}"] = nil
159
- elsif type =~ /\AArray<(.*)>/i
160
- # check to ensure the input is an array given that the attribute
161
- # is documented as an array but the input is not
162
- if attributes[attribute_map[key]].is_a?(Array)
163
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
- end
165
- elsif !attributes[attribute_map[key]].nil?
166
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
- end
168
- end
169
- new(transformed_hash)
170
- end
171
-
172
- # Returns the object in the form of hash
173
- # @return [Hash] Returns the object in the form of hash
174
- def to_hash
175
- hash = {}
176
- self.class.attribute_map.each_pair do |attr, param|
177
- value = self.send(attr)
178
- if value.nil?
179
- is_nullable = self.class.openapi_nullable.include?(attr)
180
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
- end
182
-
183
- hash[param] = _to_hash(value)
184
- end
185
- hash
186
- end
187
-
188
- end
189
-
190
- end
@@ -1,217 +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
5
-
6
- The version of the OpenAPI document: 1.0.1
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 Late
17
- class ValidatePostRequestPlatformsInner < ApiModelBase
18
- attr_accessor :platform
19
-
20
- attr_accessor :custom_content
21
-
22
- attr_accessor :platform_specific_data
23
-
24
- attr_accessor :custom_media
25
-
26
- class EnumAttributeValidator
27
- attr_reader :datatype
28
- attr_reader :allowable_values
29
-
30
- def initialize(datatype, allowable_values)
31
- @allowable_values = allowable_values.map do |value|
32
- case datatype.to_s
33
- when /Integer/i
34
- value.to_i
35
- when /Float/i
36
- value.to_f
37
- else
38
- value
39
- end
40
- end
41
- end
42
-
43
- def valid?(value)
44
- !value || allowable_values.include?(value)
45
- end
46
- end
47
-
48
- # Attribute mapping from ruby-style variable name to JSON key.
49
- def self.attribute_map
50
- {
51
- :'platform' => :'platform',
52
- :'custom_content' => :'customContent',
53
- :'platform_specific_data' => :'platformSpecificData',
54
- :'custom_media' => :'customMedia'
55
- }
56
- end
57
-
58
- # Returns attribute mapping this model knows about
59
- def self.acceptable_attribute_map
60
- attribute_map
61
- end
62
-
63
- # Returns all the JSON keys this model knows about
64
- def self.acceptable_attributes
65
- acceptable_attribute_map.values
66
- end
67
-
68
- # Attribute type mapping.
69
- def self.openapi_types
70
- {
71
- :'platform' => :'String',
72
- :'custom_content' => :'String',
73
- :'platform_specific_data' => :'Object',
74
- :'custom_media' => :'Array<ValidatePostRequestPlatformsInnerCustomMediaInner>'
75
- }
76
- end
77
-
78
- # List of attributes with nullable: true
79
- def self.openapi_nullable
80
- Set.new([
81
- ])
82
- end
83
-
84
- # Initializes the object
85
- # @param [Hash] attributes Model attributes in the form of hash
86
- def initialize(attributes = {})
87
- if (!attributes.is_a?(Hash))
88
- fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePostRequestPlatformsInner` initialize method"
89
- end
90
-
91
- # check to see if the attribute exists and convert string to symbol for hash key
92
- acceptable_attribute_map = self.class.acceptable_attribute_map
93
- attributes = attributes.each_with_object({}) { |(k, v), h|
94
- if (!acceptable_attribute_map.key?(k.to_sym))
95
- fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePostRequestPlatformsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
- end
97
- h[k.to_sym] = v
98
- }
99
-
100
- if attributes.key?(:'platform')
101
- self.platform = attributes[:'platform']
102
- else
103
- self.platform = nil
104
- end
105
-
106
- if attributes.key?(:'custom_content')
107
- self.custom_content = attributes[:'custom_content']
108
- end
109
-
110
- if attributes.key?(:'platform_specific_data')
111
- self.platform_specific_data = attributes[:'platform_specific_data']
112
- end
113
-
114
- if attributes.key?(:'custom_media')
115
- if (value = attributes[:'custom_media']).is_a?(Array)
116
- self.custom_media = value
117
- end
118
- end
119
- end
120
-
121
- # Show invalid properties with the reasons. Usually used together with valid?
122
- # @return Array for valid properties with the reasons
123
- def list_invalid_properties
124
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
- invalid_properties = Array.new
126
- if @platform.nil?
127
- invalid_properties.push('invalid value for "platform", platform cannot be nil.')
128
- end
129
-
130
- invalid_properties
131
- end
132
-
133
- # Check to see if the all the properties in the model are valid
134
- # @return true if the model is valid
135
- def valid?
136
- warn '[DEPRECATED] the `valid?` method is obsolete'
137
- return false if @platform.nil?
138
- platform_validator = EnumAttributeValidator.new('String', ["twitter", "instagram", "tiktok", "youtube", "facebook", "linkedin", "bluesky", "threads", "reddit", "pinterest", "telegram", "snapchat", "googlebusiness"])
139
- return false unless platform_validator.valid?(@platform)
140
- true
141
- end
142
-
143
- # Custom attribute writer method checking allowed values (enum).
144
- # @param [Object] platform Object to be assigned
145
- def platform=(platform)
146
- validator = EnumAttributeValidator.new('String', ["twitter", "instagram", "tiktok", "youtube", "facebook", "linkedin", "bluesky", "threads", "reddit", "pinterest", "telegram", "snapchat", "googlebusiness"])
147
- unless validator.valid?(platform)
148
- fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
149
- end
150
- @platform = platform
151
- end
152
-
153
- # Checks equality by comparing each attribute.
154
- # @param [Object] Object to be compared
155
- def ==(o)
156
- return true if self.equal?(o)
157
- self.class == o.class &&
158
- platform == o.platform &&
159
- custom_content == o.custom_content &&
160
- platform_specific_data == o.platform_specific_data &&
161
- custom_media == o.custom_media
162
- end
163
-
164
- # @see the `==` method
165
- # @param [Object] Object to be compared
166
- def eql?(o)
167
- self == o
168
- end
169
-
170
- # Calculates hash code according to all attributes.
171
- # @return [Integer] Hash code
172
- def hash
173
- [platform, custom_content, platform_specific_data, custom_media].hash
174
- end
175
-
176
- # Builds the object from hash
177
- # @param [Hash] attributes Model attributes in the form of hash
178
- # @return [Object] Returns the model itself
179
- def self.build_from_hash(attributes)
180
- return nil unless attributes.is_a?(Hash)
181
- attributes = attributes.transform_keys(&:to_sym)
182
- transformed_hash = {}
183
- openapi_types.each_pair do |key, type|
184
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
- transformed_hash["#{key}"] = nil
186
- elsif type =~ /\AArray<(.*)>/i
187
- # check to ensure the input is an array given that the attribute
188
- # is documented as an array but the input is not
189
- if attributes[attribute_map[key]].is_a?(Array)
190
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
- end
192
- elsif !attributes[attribute_map[key]].nil?
193
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
- end
195
- end
196
- new(transformed_hash)
197
- end
198
-
199
- # Returns the object in the form of hash
200
- # @return [Hash] Returns the object in the form of hash
201
- def to_hash
202
- hash = {}
203
- self.class.attribute_map.each_pair do |attr, param|
204
- value = self.send(attr)
205
- if value.nil?
206
- is_nullable = self.class.openapi_nullable.include?(attr)
207
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
- end
209
-
210
- hash[param] = _to_hash(value)
211
- end
212
- hash
213
- end
214
-
215
- end
216
-
217
- end
@@ -1,190 +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
5
-
6
- The version of the OpenAPI document: 1.0.1
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 Late
17
- class ValidatePostRequestPlatformsInnerCustomMediaInner < ApiModelBase
18
- attr_accessor :url
19
-
20
- attr_accessor :type
21
-
22
- class EnumAttributeValidator
23
- attr_reader :datatype
24
- attr_reader :allowable_values
25
-
26
- def initialize(datatype, allowable_values)
27
- @allowable_values = allowable_values.map do |value|
28
- case datatype.to_s
29
- when /Integer/i
30
- value.to_i
31
- when /Float/i
32
- value.to_f
33
- else
34
- value
35
- end
36
- end
37
- end
38
-
39
- def valid?(value)
40
- !value || allowable_values.include?(value)
41
- end
42
- end
43
-
44
- # Attribute mapping from ruby-style variable name to JSON key.
45
- def self.attribute_map
46
- {
47
- :'url' => :'url',
48
- :'type' => :'type'
49
- }
50
- end
51
-
52
- # Returns attribute mapping this model knows about
53
- def self.acceptable_attribute_map
54
- attribute_map
55
- end
56
-
57
- # Returns all the JSON keys this model knows about
58
- def self.acceptable_attributes
59
- acceptable_attribute_map.values
60
- end
61
-
62
- # Attribute type mapping.
63
- def self.openapi_types
64
- {
65
- :'url' => :'String',
66
- :'type' => :'String'
67
- }
68
- end
69
-
70
- # List of attributes with nullable: true
71
- def self.openapi_nullable
72
- Set.new([
73
- ])
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePostRequestPlatformsInnerCustomMediaInner` initialize method"
81
- end
82
-
83
- # check to see if the attribute exists and convert string to symbol for hash key
84
- acceptable_attribute_map = self.class.acceptable_attribute_map
85
- attributes = attributes.each_with_object({}) { |(k, v), h|
86
- if (!acceptable_attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePostRequestPlatformsInnerCustomMediaInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
- end
89
- h[k.to_sym] = v
90
- }
91
-
92
- if attributes.key?(:'url')
93
- self.url = attributes[:'url']
94
- end
95
-
96
- if attributes.key?(:'type')
97
- self.type = attributes[:'type']
98
- end
99
- end
100
-
101
- # Show invalid properties with the reasons. Usually used together with valid?
102
- # @return Array for valid properties with the reasons
103
- def list_invalid_properties
104
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
- invalid_properties = Array.new
106
- invalid_properties
107
- end
108
-
109
- # Check to see if the all the properties in the model are valid
110
- # @return true if the model is valid
111
- def valid?
112
- warn '[DEPRECATED] the `valid?` method is obsolete'
113
- type_validator = EnumAttributeValidator.new('String', ["image", "video"])
114
- return false unless type_validator.valid?(@type)
115
- true
116
- end
117
-
118
- # Custom attribute writer method checking allowed values (enum).
119
- # @param [Object] type Object to be assigned
120
- def type=(type)
121
- validator = EnumAttributeValidator.new('String', ["image", "video"])
122
- unless validator.valid?(type)
123
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
124
- end
125
- @type = type
126
- end
127
-
128
- # Checks equality by comparing each attribute.
129
- # @param [Object] Object to be compared
130
- def ==(o)
131
- return true if self.equal?(o)
132
- self.class == o.class &&
133
- url == o.url &&
134
- type == o.type
135
- end
136
-
137
- # @see the `==` method
138
- # @param [Object] Object to be compared
139
- def eql?(o)
140
- self == o
141
- end
142
-
143
- # Calculates hash code according to all attributes.
144
- # @return [Integer] Hash code
145
- def hash
146
- [url, type].hash
147
- end
148
-
149
- # Builds the object from hash
150
- # @param [Hash] attributes Model attributes in the form of hash
151
- # @return [Object] Returns the model itself
152
- def self.build_from_hash(attributes)
153
- return nil unless attributes.is_a?(Hash)
154
- attributes = attributes.transform_keys(&:to_sym)
155
- transformed_hash = {}
156
- openapi_types.each_pair do |key, type|
157
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
- transformed_hash["#{key}"] = nil
159
- elsif type =~ /\AArray<(.*)>/i
160
- # check to ensure the input is an array given that the attribute
161
- # is documented as an array but the input is not
162
- if attributes[attribute_map[key]].is_a?(Array)
163
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
- end
165
- elsif !attributes[attribute_map[key]].nil?
166
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
- end
168
- end
169
- new(transformed_hash)
170
- end
171
-
172
- # Returns the object in the form of hash
173
- # @return [Hash] Returns the object in the form of hash
174
- def to_hash
175
- hash = {}
176
- self.class.attribute_map.each_pair do |attr, param|
177
- value = self.send(attr)
178
- if value.nil?
179
- is_nullable = self.class.openapi_nullable.include?(attr)
180
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
- end
182
-
183
- hash[param] = _to_hash(value)
184
- end
185
- hash
186
- end
187
-
188
- end
189
-
190
- end
@@ -1,104 +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
5
-
6
- The version of the OpenAPI document: 1.0.1
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 Late
17
- module ValidateSubreddit200Response
18
- class << self
19
- # List of class defined in oneOf (OpenAPI v3)
20
- def openapi_one_of
21
- [
22
- :'ValidateSubreddit200ResponseOneOf',
23
- :'ValidateSubreddit200ResponseOneOf1'
24
- ]
25
- end
26
-
27
- # Builds the object
28
- # @param [Mixed] Data to be matched against the list of oneOf items
29
- # @return [Object] Returns the model or the data itself
30
- def build(data)
31
- # Go through the list of oneOf items and attempt to identify the appropriate one.
32
- # Note:
33
- # - We do not attempt to check whether exactly one item matches.
34
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
- # - TODO: scalar values are de facto behaving as if they were nullable.
37
- # - TODO: logging when debugging is set.
38
- openapi_one_of.each do |klass|
39
- begin
40
- next if klass == :AnyType # "nullable: true"
41
- return find_and_cast_into_type(klass, data)
42
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
- end
44
- end
45
-
46
- openapi_one_of.include?(:AnyType) ? data : nil
47
- end
48
-
49
- private
50
-
51
- SchemaMismatchError = Class.new(StandardError)
52
-
53
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
- def find_and_cast_into_type(klass, data)
55
- return if data.nil?
56
-
57
- case klass.to_s
58
- when 'Boolean'
59
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
- when 'Float'
61
- return data if data.instance_of?(Float)
62
- when 'Integer'
63
- return data if data.instance_of?(Integer)
64
- when 'Time'
65
- return Time.parse(data)
66
- when 'Date'
67
- return Date.iso8601(data)
68
- when 'String'
69
- return data if data.instance_of?(String)
70
- when 'Object' # "type: object"
71
- return data if data.instance_of?(Hash)
72
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
- if data.instance_of?(Array)
74
- sub_type = Regexp.last_match[:sub_type]
75
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
- end
77
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
- sub_type = Regexp.last_match[:sub_type]
80
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
- end
82
- else # model
83
- const = Late.const_get(klass)
84
- if const
85
- if const.respond_to?(:openapi_one_of) # nested oneOf model
86
- model = const.build(data)
87
- return model if model
88
- else
89
- # raise if data contains keys that are not known to the model
90
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
- model = const.build_from_hash(data)
92
- return model if model
93
- end
94
- end
95
- end
96
-
97
- raise # if no match by now, raise
98
- rescue
99
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
- end
101
- end
102
- end
103
-
104
- end