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,166 @@
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 ValidateMedia200ResponsePlatformLimitsValue < ApiModelBase
18
+ # Platform size limit in bytes
19
+ attr_accessor :limit
20
+
21
+ attr_accessor :limit_formatted
22
+
23
+ attr_accessor :within_limit
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'limit' => :'limit',
29
+ :'limit_formatted' => :'limitFormatted',
30
+ :'within_limit' => :'withinLimit'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'limit' => :'Integer',
48
+ :'limit_formatted' => :'String',
49
+ :'within_limit' => :'Boolean'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidateMedia200ResponsePlatformLimitsValue` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidateMedia200ResponsePlatformLimitsValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'limit')
76
+ self.limit = attributes[:'limit']
77
+ end
78
+
79
+ if attributes.key?(:'limit_formatted')
80
+ self.limit_formatted = attributes[:'limit_formatted']
81
+ end
82
+
83
+ if attributes.key?(:'within_limit')
84
+ self.within_limit = attributes[:'within_limit']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ limit == o.limit &&
109
+ limit_formatted == o.limit_formatted &&
110
+ within_limit == o.within_limit
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [limit, limit_formatted, within_limit].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ 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 ValidateMediaRequest < ApiModelBase
18
+ # Public media URL to validate
19
+ attr_accessor :url
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'url' => :'url'
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
+ :'url' => :'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::ValidateMediaRequest` 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::ValidateMediaRequest`. 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?(:'url')
68
+ self.url = attributes[:'url']
69
+ else
70
+ self.url = 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 @url.nil?
80
+ invalid_properties.push('invalid value for "url", url 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 @url.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] url Value to be assigned
96
+ def url=(url)
97
+ if url.nil?
98
+ fail ArgumentError, 'url cannot be nil'
99
+ end
100
+
101
+ @url = url
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
+ url == o.url
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
+ [url].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,104 @@
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 ValidatePost200Response
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'ValidatePost200ResponseOneOf',
23
+ :'ValidatePost200ResponseOneOf1'
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
@@ -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
+ # Valid post
18
+ class ValidatePost200ResponseOneOf < ApiModelBase
19
+ attr_accessor :valid
20
+
21
+ attr_accessor :message
22
+
23
+ attr_accessor :warnings
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'valid' => :'valid',
29
+ :'message' => :'message',
30
+ :'warnings' => :'warnings'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'valid' => :'Boolean',
48
+ :'message' => :'String',
49
+ :'warnings' => :'Array<ValidatePost200ResponseOneOfWarningsInner>'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidatePost200ResponseOneOf` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidatePost200ResponseOneOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'valid')
76
+ self.valid = attributes[:'valid']
77
+ end
78
+
79
+ if attributes.key?(:'message')
80
+ self.message = attributes[:'message']
81
+ end
82
+
83
+ if attributes.key?(:'warnings')
84
+ if (value = attributes[:'warnings']).is_a?(Array)
85
+ self.warnings = value
86
+ end
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
+ valid == o.valid &&
111
+ message == o.message &&
112
+ warnings == o.warnings
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
+ [valid, message, warnings].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