late-sdk 0.0.104 → 0.0.105

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -0
  3. data/docs/AdCampaignsApi.md +86 -0
  4. data/docs/AdTreeAdSet.md +30 -0
  5. data/docs/AdTreeCampaign.md +40 -0
  6. data/docs/GetAdTree200Response.md +20 -0
  7. data/docs/ValidateApi.md +287 -0
  8. data/docs/ValidateMedia200Response.md +32 -0
  9. data/docs/ValidateMedia200ResponsePlatformLimitsValue.md +22 -0
  10. data/docs/ValidateMediaRequest.md +18 -0
  11. data/docs/ValidatePost200Response.md +49 -0
  12. data/docs/ValidatePost200ResponseOneOf.md +22 -0
  13. data/docs/ValidatePost200ResponseOneOf1.md +22 -0
  14. data/docs/ValidatePost200ResponseOneOf1ErrorsInner.md +20 -0
  15. data/docs/ValidatePost200ResponseOneOfWarningsInner.md +20 -0
  16. data/docs/ValidatePostLength200Response.md +20 -0
  17. data/docs/ValidatePostLength200ResponsePlatformsValue.md +22 -0
  18. data/docs/ValidatePostLengthRequest.md +18 -0
  19. data/docs/ValidatePostRequest.md +22 -0
  20. data/docs/ValidatePostRequestMediaItemsInner.md +20 -0
  21. data/docs/ValidatePostRequestPlatformsInner.md +24 -0
  22. data/docs/ValidatePostRequestPlatformsInnerCustomMediaInner.md +20 -0
  23. data/docs/ValidateSubreddit200Response.md +49 -0
  24. data/docs/ValidateSubreddit200ResponseOneOf.md +20 -0
  25. data/docs/ValidateSubreddit200ResponseOneOf1.md +20 -0
  26. data/docs/ValidateSubreddit200ResponseOneOfSubreddit.md +32 -0
  27. data/lib/late-sdk/api/ad_campaigns_api.rb +105 -0
  28. data/lib/late-sdk/api/validate_api.rb +290 -0
  29. data/lib/late-sdk/models/ad_tree_ad_set.rb +240 -0
  30. data/lib/late-sdk/models/ad_tree_campaign.rb +297 -0
  31. data/lib/late-sdk/models/get_ad_tree200_response.rb +158 -0
  32. data/lib/late-sdk/models/validate_media200_response.rb +249 -0
  33. data/lib/late-sdk/models/validate_media200_response_platform_limits_value.rb +166 -0
  34. data/lib/late-sdk/models/validate_media_request.rb +165 -0
  35. data/lib/late-sdk/models/validate_post200_response.rb +104 -0
  36. data/lib/late-sdk/models/validate_post200_response_one_of.rb +168 -0
  37. data/lib/late-sdk/models/validate_post200_response_one_of1.rb +170 -0
  38. data/lib/late-sdk/models/validate_post200_response_one_of1_errors_inner.rb +156 -0
  39. data/lib/late-sdk/models/validate_post200_response_one_of_warnings_inner.rb +156 -0
  40. data/lib/late-sdk/models/validate_post_length200_response.rb +158 -0
  41. data/lib/late-sdk/models/validate_post_length200_response_platforms_value.rb +168 -0
  42. data/lib/late-sdk/models/validate_post_length_request.rb +165 -0
  43. data/lib/late-sdk/models/validate_post_request.rb +189 -0
  44. data/lib/late-sdk/models/validate_post_request_media_items_inner.rb +190 -0
  45. data/lib/late-sdk/models/validate_post_request_platforms_inner.rb +217 -0
  46. data/lib/late-sdk/models/validate_post_request_platforms_inner_custom_media_inner.rb +190 -0
  47. data/lib/late-sdk/models/validate_subreddit200_response.rb +104 -0
  48. data/lib/late-sdk/models/validate_subreddit200_response_one_of.rb +157 -0
  49. data/lib/late-sdk/models/validate_subreddit200_response_one_of1.rb +157 -0
  50. data/lib/late-sdk/models/validate_subreddit200_response_one_of_subreddit.rb +244 -0
  51. data/lib/late-sdk/version.rb +1 -1
  52. data/lib/late-sdk.rb +23 -0
  53. data/openapi.yaml +330 -1
  54. data/spec/api/ad_campaigns_api_spec.rb +19 -0
  55. data/spec/api/validate_api_spec.rb +83 -0
  56. data/spec/models/ad_tree_ad_set_spec.rb +76 -0
  57. data/spec/models/ad_tree_campaign_spec.rb +110 -0
  58. data/spec/models/get_ad_tree200_response_spec.rb +42 -0
  59. data/spec/models/validate_media200_response_platform_limits_value_spec.rb +48 -0
  60. data/spec/models/validate_media200_response_spec.rb +82 -0
  61. data/spec/models/validate_media_request_spec.rb +36 -0
  62. data/spec/models/validate_post200_response_one_of1_errors_inner_spec.rb +42 -0
  63. data/spec/models/validate_post200_response_one_of1_spec.rb +48 -0
  64. data/spec/models/validate_post200_response_one_of_spec.rb +48 -0
  65. data/spec/models/validate_post200_response_one_of_warnings_inner_spec.rb +42 -0
  66. data/spec/models/validate_post200_response_spec.rb +32 -0
  67. data/spec/models/validate_post_length200_response_platforms_value_spec.rb +48 -0
  68. data/spec/models/validate_post_length200_response_spec.rb +42 -0
  69. data/spec/models/validate_post_length_request_spec.rb +36 -0
  70. data/spec/models/validate_post_request_media_items_inner_spec.rb +46 -0
  71. data/spec/models/validate_post_request_platforms_inner_custom_media_inner_spec.rb +46 -0
  72. data/spec/models/validate_post_request_platforms_inner_spec.rb +58 -0
  73. data/spec/models/validate_post_request_spec.rb +48 -0
  74. data/spec/models/validate_subreddit200_response_one_of1_spec.rb +42 -0
  75. data/spec/models/validate_subreddit200_response_one_of_spec.rb +42 -0
  76. data/spec/models/validate_subreddit200_response_one_of_subreddit_spec.rb +82 -0
  77. data/spec/models/validate_subreddit200_response_spec.rb +32 -0
  78. data/zernio-sdk-0.0.105.gem +0 -0
  79. metadata +94 -2
  80. data/zernio-sdk-0.0.104.gem +0 -0
@@ -0,0 +1,168 @@
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 ValidatePostLength200ResponsePlatformsValue < ApiModelBase
18
+ # Character count for this platform
19
+ attr_accessor :count
20
+
21
+ # Maximum allowed characters
22
+ attr_accessor :limit
23
+
24
+ # Whether the text is within the limit
25
+ attr_accessor :valid
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'count' => :'count',
31
+ :'limit' => :'limit',
32
+ :'valid' => :'valid'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'count' => :'Integer',
50
+ :'limit' => :'Integer',
51
+ :'valid' => :'Boolean'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePostLength200ResponsePlatformsValue` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePostLength200ResponsePlatformsValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'count')
78
+ self.count = attributes[:'count']
79
+ end
80
+
81
+ if attributes.key?(:'limit')
82
+ self.limit = attributes[:'limit']
83
+ end
84
+
85
+ if attributes.key?(:'valid')
86
+ self.valid = attributes[:'valid']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ count == o.count &&
111
+ limit == o.limit &&
112
+ valid == o.valid
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [count, limit, valid].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end
@@ -0,0 +1,165 @@
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 ValidatePostLengthRequest < ApiModelBase
18
+ # The post text to check
19
+ attr_accessor :text
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'text' => :'text'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'text' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePostLengthRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePostLengthRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'text')
68
+ self.text = attributes[:'text']
69
+ else
70
+ self.text = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @text.nil?
80
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @text.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] text Value to be assigned
96
+ def text=(text)
97
+ if text.nil?
98
+ fail ArgumentError, 'text cannot be nil'
99
+ end
100
+
101
+ @text = text
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ text == o.text
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [text].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,189 @@
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 ValidatePostRequest < ApiModelBase
18
+ # Post text content
19
+ attr_accessor :content
20
+
21
+ # Target platforms (same format as POST /v1/posts)
22
+ attr_accessor :platforms
23
+
24
+ # Root media items shared across platforms
25
+ attr_accessor :media_items
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'content' => :'content',
31
+ :'platforms' => :'platforms',
32
+ :'media_items' => :'mediaItems'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'content' => :'String',
50
+ :'platforms' => :'Array<ValidatePostRequestPlatformsInner>',
51
+ :'media_items' => :'Array<ValidatePostRequestMediaItemsInner>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePostRequest` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePostRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'content')
78
+ self.content = attributes[:'content']
79
+ end
80
+
81
+ if attributes.key?(:'platforms')
82
+ if (value = attributes[:'platforms']).is_a?(Array)
83
+ self.platforms = value
84
+ end
85
+ else
86
+ self.platforms = nil
87
+ end
88
+
89
+ if attributes.key?(:'media_items')
90
+ if (value = attributes[:'media_items']).is_a?(Array)
91
+ self.media_items = value
92
+ end
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @platforms.nil?
102
+ invalid_properties.push('invalid value for "platforms", platforms cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ warn '[DEPRECATED] the `valid?` method is obsolete'
112
+ return false if @platforms.nil?
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] platforms Value to be assigned
118
+ def platforms=(platforms)
119
+ if platforms.nil?
120
+ fail ArgumentError, 'platforms cannot be nil'
121
+ end
122
+
123
+ @platforms = platforms
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ content == o.content &&
132
+ platforms == o.platforms &&
133
+ media_items == o.media_items
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [content, platforms, media_items].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ transformed_hash = {}
155
+ openapi_types.each_pair do |key, type|
156
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = nil
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[attribute_map[key]].is_a?(Array)
162
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
163
+ end
164
+ elsif !attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
166
+ end
167
+ end
168
+ new(transformed_hash)
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ if value.nil?
178
+ is_nullable = self.class.openapi_nullable.include?(attr)
179
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
180
+ end
181
+
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ end
188
+
189
+ end
@@ -0,0 +1,190 @@
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