zernio-sdk 0.0.521 → 0.0.523

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -1
  3. data/docs/AnalyticsApi.md +2 -2
  4. data/docs/ConnectApi.md +4 -4
  5. data/docs/CreateStandaloneAdRequestPromotedObject.md +1 -1
  6. data/docs/FoodMenuItemOptionsInner.md +2 -2
  7. data/docs/GMBAttributesApi.md +1 -1
  8. data/docs/GMBMediaApi.md +1 -1
  9. data/docs/SelectLinkedInOrganizationRequest.md +1 -1
  10. data/docs/SelectLinkedInOrganizationRequestSelectedOrganization.md +26 -0
  11. data/docs/UpdateGmbLocationRequest.md +3 -1
  12. data/docs/UpdateGoogleBusinessAttributesRequestAttributesInner.md +6 -2
  13. data/docs/UpdateGoogleBusinessAttributesRequestAttributesInnerUriValuesInner.md +18 -0
  14. data/docs/UpdateGoogleBusinessServicesRequestServiceItemsInner.md +3 -3
  15. data/docs/UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItem.md +20 -0
  16. data/docs/UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItemLabel.md +22 -0
  17. data/docs/UpdateGoogleBusinessServicesRequestServiceItemsInnerPrice.md +22 -0
  18. data/docs/UpdateGoogleBusinessServicesRequestServiceItemsInnerStructuredServiceItem.md +20 -0
  19. data/docs/UpdateLinkedInOrganization200Response.md +22 -0
  20. data/lib/zernio-sdk/api/analytics_api.rb +11 -2
  21. data/lib/zernio-sdk/api/connect_api.rb +7 -3
  22. data/lib/zernio-sdk/api/gmb_media_api.rb +6 -2
  23. data/lib/zernio-sdk/api/gmb_place_actions_api.rb +4 -4
  24. data/lib/zernio-sdk/api/gmb_verifications_api.rb +8 -0
  25. data/lib/zernio-sdk/models/batch_get_google_business_reviews_request.rb +37 -0
  26. data/lib/zernio-sdk/models/create_google_business_media_request.rb +21 -2
  27. data/lib/zernio-sdk/models/create_standalone_ad_request_promoted_object.rb +1 -1
  28. data/lib/zernio-sdk/models/food_menu.rb +9 -0
  29. data/lib/zernio-sdk/models/food_menu_item.rb +9 -0
  30. data/lib/zernio-sdk/models/food_menu_item_attributes.rb +53 -0
  31. data/lib/zernio-sdk/models/food_menu_item_options_inner.rb +43 -0
  32. data/lib/zernio-sdk/models/food_menu_section.rb +9 -0
  33. data/lib/zernio-sdk/models/get_telegram_commands200_response_data_inner.rb +67 -0
  34. data/lib/zernio-sdk/models/reply_to_google_business_review_request.rb +9 -0
  35. data/lib/zernio-sdk/models/select_linked_in_organization_request.rb +1 -1
  36. data/lib/zernio-sdk/models/select_linked_in_organization_request_selected_organization.rb +263 -0
  37. data/lib/zernio-sdk/models/set_instagram_ice_breakers_request.rb +9 -0
  38. data/lib/zernio-sdk/models/set_instagram_ice_breakers_request_ice_breakers_inner.rb +18 -0
  39. data/lib/zernio-sdk/models/set_reddit_post_flair_request.rb +27 -0
  40. data/lib/zernio-sdk/models/set_telegram_commands_request.rb +9 -0
  41. data/lib/zernio-sdk/models/set_telegram_commands_request_commands_inner.rb +47 -0
  42. data/lib/zernio-sdk/models/update_gmb_location_request.rb +61 -4
  43. data/lib/zernio-sdk/models/update_google_business_attributes_request.rb +9 -0
  44. data/lib/zernio-sdk/models/update_google_business_attributes_request_attributes_inner.rb +84 -4
  45. data/lib/zernio-sdk/models/update_google_business_attributes_request_attributes_inner_uri_values_inner.rb +164 -0
  46. data/lib/zernio-sdk/models/update_google_business_place_action_request.rb +0 -22
  47. data/lib/zernio-sdk/models/update_google_business_services_request_service_items_inner.rb +3 -3
  48. data/lib/zernio-sdk/models/update_google_business_services_request_service_items_inner_free_form_service_item.rb +199 -0
  49. data/lib/zernio-sdk/models/update_google_business_services_request_service_items_inner_free_form_service_item_label.rb +191 -0
  50. data/lib/zernio-sdk/models/update_google_business_services_request_service_items_inner_price.rb +203 -0
  51. data/lib/zernio-sdk/models/update_google_business_services_request_service_items_inner_structured_service_item.rb +182 -0
  52. data/lib/zernio-sdk/models/{get_linked_in_post_reactions400_response.rb → update_linked_in_organization200_response.rb} +33 -24
  53. data/lib/zernio-sdk/models/update_reddit_subreddits_request.rb +9 -0
  54. data/lib/zernio-sdk/models/update_youtube_default_playlist_request.rb +9 -0
  55. data/lib/zernio-sdk/version.rb +1 -1
  56. data/lib/zernio-sdk.rb +7 -1
  57. data/openapi.yaml +112 -60
  58. data/spec/api/analytics_api_spec.rb +1 -1
  59. data/spec/api/connect_api_spec.rb +1 -1
  60. data/spec/api/gmb_media_api_spec.rb +1 -1
  61. data/spec/models/create_google_business_media_request_spec.rb +1 -1
  62. data/spec/models/food_menu_item_attributes_spec.rb +4 -0
  63. data/spec/models/select_linked_in_organization_request_selected_organization_spec.rb +60 -0
  64. data/spec/models/update_gmb_location_request_spec.rb +6 -0
  65. data/spec/models/update_google_business_attributes_request_attributes_inner_spec.rb +16 -0
  66. data/spec/models/update_google_business_attributes_request_attributes_inner_uri_values_inner_spec.rb +36 -0
  67. data/spec/models/update_google_business_services_request_service_items_inner_free_form_service_item_label_spec.rb +48 -0
  68. data/spec/models/update_google_business_services_request_service_items_inner_free_form_service_item_spec.rb +42 -0
  69. data/spec/models/update_google_business_services_request_service_items_inner_price_spec.rb +48 -0
  70. data/spec/models/update_google_business_services_request_service_items_inner_structured_service_item_spec.rb +42 -0
  71. data/spec/models/{get_linked_in_post_reactions400_response_spec.rb → update_linked_in_organization200_response_spec.rb} +16 -10
  72. metadata +30 -6
  73. data/docs/GetLinkedInPostReactions400Response.md +0 -20
@@ -0,0 +1,164 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class UpdateGoogleBusinessAttributesRequestAttributesInnerUriValuesInner < ApiModelBase
18
+ attr_accessor :uri
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'uri' => :'uri'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'uri' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateGoogleBusinessAttributesRequestAttributesInnerUriValuesInner` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateGoogleBusinessAttributesRequestAttributesInnerUriValuesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'uri')
67
+ self.uri = attributes[:'uri']
68
+ else
69
+ self.uri = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @uri.nil?
79
+ invalid_properties.push('invalid value for "uri", uri cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @uri.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] uri Value to be assigned
95
+ def uri=(uri)
96
+ if uri.nil?
97
+ fail ArgumentError, 'uri cannot be nil'
98
+ end
99
+
100
+ @uri = uri
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
+ uri == o.uri
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [uri].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -24,28 +24,6 @@ module Zernio
24
24
  # New action type
25
25
  attr_accessor :place_action_type
26
26
 
27
- class EnumAttributeValidator
28
- attr_reader :datatype
29
- attr_reader :allowable_values
30
-
31
- def initialize(datatype, allowable_values)
32
- @allowable_values = allowable_values.map do |value|
33
- case datatype.to_s
34
- when /Integer/i
35
- value.to_i
36
- when /Float/i
37
- value.to_f
38
- else
39
- value
40
- end
41
- end
42
- end
43
-
44
- def valid?(value)
45
- !value || allowable_values.include?(value)
46
- end
47
- end
48
-
49
27
  # Attribute mapping from ruby-style variable name to JSON key.
50
28
  def self.attribute_map
51
29
  {
@@ -43,9 +43,9 @@ module Zernio
43
43
  # Attribute type mapping.
44
44
  def self.openapi_types
45
45
  {
46
- :'structured_service_item' => :'GetGoogleBusinessLocationDetails200ResponseServiceItemsInnerStructuredServiceItem',
47
- :'free_form_service_item' => :'GetGoogleBusinessServices200ResponseServicesInnerFreeFormServiceItem',
48
- :'price' => :'GetGoogleBusinessLocationDetails200ResponseServiceItemsInnerPrice'
46
+ :'structured_service_item' => :'UpdateGoogleBusinessServicesRequestServiceItemsInnerStructuredServiceItem',
47
+ :'free_form_service_item' => :'UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItem',
48
+ :'price' => :'UpdateGoogleBusinessServicesRequestServiceItemsInnerPrice'
49
49
  }
50
50
  end
51
51
 
@@ -0,0 +1,199 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItem < ApiModelBase
18
+ attr_accessor :category
19
+
20
+ attr_accessor :label
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'category' => :'category',
26
+ :'label' => :'label'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'category' => :'String',
44
+ :'label' => :'UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItemLabel'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItem` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'category')
71
+ self.category = attributes[:'category']
72
+ else
73
+ self.category = nil
74
+ end
75
+
76
+ if attributes.key?(:'label')
77
+ self.label = attributes[:'label']
78
+ else
79
+ self.label = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @category.nil?
89
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
90
+ end
91
+
92
+ if @category.to_s.length < 1
93
+ invalid_properties.push('invalid value for "category", the character length must be greater than or equal to 1.')
94
+ end
95
+
96
+ if @label.nil?
97
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ return false if @category.nil?
108
+ return false if @category.to_s.length < 1
109
+ return false if @label.nil?
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] category Value to be assigned
115
+ def category=(category)
116
+ if category.nil?
117
+ fail ArgumentError, 'category cannot be nil'
118
+ end
119
+
120
+ if category.to_s.length < 1
121
+ fail ArgumentError, 'invalid value for "category", the character length must be greater than or equal to 1.'
122
+ end
123
+
124
+ @category = category
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] label Value to be assigned
129
+ def label=(label)
130
+ if label.nil?
131
+ fail ArgumentError, 'label cannot be nil'
132
+ end
133
+
134
+ @label = label
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ category == o.category &&
143
+ label == o.label
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [category, label].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ end
198
+
199
+ end
@@ -0,0 +1,191 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItemLabel < ApiModelBase
18
+ attr_accessor :display_name
19
+
20
+ attr_accessor :description
21
+
22
+ attr_accessor :language_code
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'display_name' => :'displayName',
28
+ :'description' => :'description',
29
+ :'language_code' => :'languageCode'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'display_name' => :'String',
47
+ :'description' => :'String',
48
+ :'language_code' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItemLabel` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateGoogleBusinessServicesRequestServiceItemsInnerFreeFormServiceItemLabel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'display_name')
75
+ self.display_name = attributes[:'display_name']
76
+ else
77
+ self.display_name = nil
78
+ end
79
+
80
+ if attributes.key?(:'description')
81
+ self.description = attributes[:'description']
82
+ end
83
+
84
+ if attributes.key?(:'language_code')
85
+ self.language_code = attributes[:'language_code']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ if @display_name.nil?
95
+ invalid_properties.push('invalid value for "display_name", display_name cannot be nil.')
96
+ end
97
+
98
+ if @display_name.to_s.length < 1
99
+ invalid_properties.push('invalid value for "display_name", the character length must be greater than or equal to 1.')
100
+ end
101
+
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ return false if @display_name.nil?
110
+ return false if @display_name.to_s.length < 1
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] display_name Value to be assigned
116
+ def display_name=(display_name)
117
+ if display_name.nil?
118
+ fail ArgumentError, 'display_name cannot be nil'
119
+ end
120
+
121
+ if display_name.to_s.length < 1
122
+ fail ArgumentError, 'invalid value for "display_name", the character length must be greater than or equal to 1.'
123
+ end
124
+
125
+ @display_name = display_name
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
+ display_name == o.display_name &&
134
+ description == o.description &&
135
+ language_code == o.language_code
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [display_name, description, language_code].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
169
+ end
170
+ new(transformed_hash)
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ end
190
+
191
+ end