late-sdk 0.0.856 → 0.0.858

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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -2
  3. data/docs/AdCampaignsApi.md +364 -6
  4. data/docs/{ListAdKeywords200ResponseKeywordsInner.md → AdKeyword.md} +7 -3
  5. data/docs/AdKeywordMetrics.md +30 -0
  6. data/docs/AddAdKeywords201Response.md +18 -0
  7. data/docs/AddAdKeywordsRequest.md +24 -0
  8. data/docs/AddAdKeywordsRequestKeywordsInner.md +20 -0
  9. data/docs/AddAdKeywordsRequestKeywordsInnerAnyOf.md +20 -0
  10. data/docs/ChannelPicker.md +20 -0
  11. data/docs/ChannelPickerChannelsInner.md +24 -0
  12. data/docs/ChannelPickerTeam.md +22 -0
  13. data/docs/ConnectApi.md +78 -0
  14. data/docs/CreatePost200Response.md +22 -0
  15. data/docs/CreatePost200ResponseTiktokInner.md +24 -0
  16. data/docs/CreatePostRequest.md +2 -0
  17. data/docs/CreateStandaloneAdRequest.md +4 -2
  18. data/docs/KeywordEntry.md +49 -0
  19. data/docs/ListAdKeywords200Response.md +1 -1
  20. data/docs/ListCampaignNegativeKeywords200Response.md +18 -0
  21. data/docs/ListCampaignNegativeKeywords200ResponseKeywordsInner.md +22 -0
  22. data/docs/ListSlackChannels200Response.md +49 -0
  23. data/docs/PlatformTarget.md +1 -1
  24. data/docs/Post.md +1 -1
  25. data/docs/PostsApi.md +4 -4
  26. data/docs/RemoveAdKeyword200Response.md +20 -0
  27. data/docs/ReplaceCampaignNegativeKeywords200Response.md +22 -0
  28. data/docs/ReplaceCampaignNegativeKeywordsRequest.md +20 -0
  29. data/docs/StartOAuth.md +20 -0
  30. data/docs/UpdateAdKeyword200Response.md +18 -0
  31. data/docs/{UpdateAdStatusRequest.md → UpdateAdKeywordRequest.md} +2 -2
  32. data/docs/WebhookLog.md +1 -1
  33. data/lib/zernio-sdk/api/ad_campaigns_api.rb +358 -9
  34. data/lib/zernio-sdk/api/connect_api.rb +77 -0
  35. data/lib/zernio-sdk/api/posts_api.rb +4 -4
  36. data/lib/zernio-sdk/models/{list_ad_keywords200_response_keywords_inner.rb → ad_keyword.rb} +28 -8
  37. data/lib/zernio-sdk/models/ad_keyword_metrics.rb +207 -0
  38. data/lib/zernio-sdk/models/add_ad_keywords201_response.rb +149 -0
  39. data/lib/zernio-sdk/models/add_ad_keywords_request.rb +250 -0
  40. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner.rb +103 -0
  41. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner_any_of.rb +225 -0
  42. data/lib/zernio-sdk/models/channel_picker.rb +192 -0
  43. data/lib/zernio-sdk/models/channel_picker_channels_inner.rb +244 -0
  44. data/lib/zernio-sdk/models/channel_picker_team.rb +169 -0
  45. data/lib/zernio-sdk/models/create_post200_response.rb +221 -0
  46. data/lib/zernio-sdk/models/create_post200_response_tiktok_inner.rb +227 -0
  47. data/lib/zernio-sdk/models/create_post_request.rb +13 -1
  48. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +55 -5
  49. data/lib/zernio-sdk/models/keyword_entry.rb +105 -0
  50. data/lib/zernio-sdk/models/list_ad_keywords200_response.rb +1 -1
  51. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response.rb +149 -0
  52. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response_keywords_inner.rb +199 -0
  53. data/lib/zernio-sdk/models/list_slack_channels200_response.rb +104 -0
  54. data/lib/zernio-sdk/models/platform_target.rb +1 -1
  55. data/lib/zernio-sdk/models/post.rb +3 -2
  56. data/lib/zernio-sdk/models/remove_ad_keyword200_response.rb +157 -0
  57. data/lib/zernio-sdk/models/replace_campaign_negative_keywords200_response.rb +170 -0
  58. data/lib/zernio-sdk/models/replace_campaign_negative_keywords_request.rb +219 -0
  59. data/lib/zernio-sdk/models/start_o_auth.rb +190 -0
  60. data/lib/zernio-sdk/models/update_ad_keyword200_response.rb +147 -0
  61. data/lib/zernio-sdk/models/{update_ad_status_request.rb → update_ad_keyword_request.rb} +3 -3
  62. data/lib/zernio-sdk/models/webhook_log.rb +1 -1
  63. data/lib/zernio-sdk/version.rb +1 -1
  64. data/lib/zernio-sdk.rb +21 -2
  65. data/openapi.yaml +390 -27
  66. data/spec/api/ad_campaigns_api_spec.rb +64 -1
  67. data/spec/api/connect_api_spec.rb +15 -0
  68. data/spec/api/posts_api_spec.rb +1 -1
  69. data/spec/models/ad_keyword_metrics_spec.rb +72 -0
  70. data/spec/models/{list_ad_keywords200_response_keywords_inner_spec.rb → ad_keyword_spec.rb} +18 -6
  71. data/spec/models/add_ad_keywords201_response_spec.rb +36 -0
  72. data/spec/models/add_ad_keywords_request_keywords_inner_any_of_spec.rb +46 -0
  73. data/spec/models/add_ad_keywords_request_keywords_inner_spec.rb +21 -0
  74. data/spec/models/add_ad_keywords_request_spec.rb +54 -0
  75. data/spec/models/channel_picker_channels_inner_spec.rb +54 -0
  76. data/spec/models/channel_picker_spec.rb +42 -0
  77. data/spec/models/channel_picker_team_spec.rb +48 -0
  78. data/spec/models/create_post200_response_spec.rb +48 -0
  79. data/spec/models/create_post200_response_tiktok_inner_spec.rb +54 -0
  80. data/spec/models/create_post_request_spec.rb +6 -0
  81. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  82. data/spec/models/keyword_entry_spec.rb +32 -0
  83. data/spec/models/list_campaign_negative_keywords200_response_keywords_inner_spec.rb +52 -0
  84. data/spec/models/list_campaign_negative_keywords200_response_spec.rb +36 -0
  85. data/spec/models/list_slack_channels200_response_spec.rb +32 -0
  86. data/spec/models/post_spec.rb +1 -1
  87. data/spec/models/remove_ad_keyword200_response_spec.rb +42 -0
  88. data/spec/models/replace_campaign_negative_keywords200_response_spec.rb +48 -0
  89. data/spec/models/replace_campaign_negative_keywords_request_spec.rb +46 -0
  90. data/spec/models/start_o_auth_spec.rb +42 -0
  91. data/spec/models/update_ad_keyword200_response_spec.rb +36 -0
  92. data/spec/models/{update_ad_status_request_spec.rb → update_ad_keyword_request_spec.rb} +6 -6
  93. data/zernio-sdk-0.0.858.gem +0 -0
  94. metadata +86 -10
  95. data/zernio-sdk-0.0.856.gem +0 -0
@@ -0,0 +1,157 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class RemoveAdKeyword200Response < ApiModelBase
18
+ # Always true on success
19
+ attr_accessor :removed
20
+
21
+ attr_accessor :keyword_id
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'removed' => :'removed',
27
+ :'keyword_id' => :'keywordId'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'removed' => :'Boolean',
45
+ :'keyword_id' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::RemoveAdKeyword200Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::RemoveAdKeyword200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'removed')
72
+ self.removed = attributes[:'removed']
73
+ end
74
+
75
+ if attributes.key?(:'keyword_id')
76
+ self.keyword_id = attributes[:'keyword_id']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ removed == o.removed &&
101
+ keyword_id == o.keyword_id
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [removed, keyword_id].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end
@@ -0,0 +1,170 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class ReplaceCampaignNegativeKeywords200Response < ApiModelBase
18
+ # Negative criteria newly created on Google
19
+ attr_accessor :created
20
+
21
+ # Negative criteria removed from Google
22
+ attr_accessor :removed
23
+
24
+ # The full negative-keyword set after the replace
25
+ attr_accessor :keywords
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'created' => :'created',
31
+ :'removed' => :'removed',
32
+ :'keywords' => :'keywords'
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
+ :'created' => :'Integer',
50
+ :'removed' => :'Integer',
51
+ :'keywords' => :'Array<ListCampaignNegativeKeywords200ResponseKeywordsInner>'
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 `Zernio::ReplaceCampaignNegativeKeywords200Response` 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 `Zernio::ReplaceCampaignNegativeKeywords200Response`. 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?(:'created')
78
+ self.created = attributes[:'created']
79
+ end
80
+
81
+ if attributes.key?(:'removed')
82
+ self.removed = attributes[:'removed']
83
+ end
84
+
85
+ if attributes.key?(:'keywords')
86
+ if (value = attributes[:'keywords']).is_a?(Array)
87
+ self.keywords = value
88
+ end
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ created == o.created &&
113
+ removed == o.removed &&
114
+ keywords == o.keywords
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [created, removed, keywords].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
135
+ transformed_hash = {}
136
+ openapi_types.each_pair do |key, type|
137
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[attribute_map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
144
+ end
145
+ elsif !attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
147
+ end
148
+ end
149
+ new(transformed_hash)
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ end
169
+
170
+ end
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class ReplaceCampaignNegativeKeywordsRequest < ApiModelBase
18
+ # Optional and NOT authoritative: the resolved campaign's own platform decides 200 vs 501, never this hint.
19
+ attr_accessor :platform
20
+
21
+ attr_accessor :keywords
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'platform' => :'platform',
49
+ :'keywords' => :'keywords'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'platform' => :'String',
67
+ :'keywords' => :'Array<KeywordEntry>'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ReplaceCampaignNegativeKeywordsRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ReplaceCampaignNegativeKeywordsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'platform')
94
+ self.platform = attributes[:'platform']
95
+ end
96
+
97
+ if attributes.key?(:'keywords')
98
+ if (value = attributes[:'keywords']).is_a?(Array)
99
+ self.keywords = value
100
+ end
101
+ else
102
+ self.keywords = nil
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @keywords.nil?
112
+ invalid_properties.push('invalid value for "keywords", keywords cannot be nil.')
113
+ end
114
+
115
+ if @keywords.length > 1000
116
+ invalid_properties.push('invalid value for "keywords", number of items must be less than or equal to 1000.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"])
127
+ return false unless platform_validator.valid?(@platform)
128
+ return false if @keywords.nil?
129
+ return false if @keywords.length > 1000
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method checking allowed values (enum).
134
+ # @param [Object] platform Object to be assigned
135
+ def platform=(platform)
136
+ validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"])
137
+ unless validator.valid?(platform)
138
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
139
+ end
140
+ @platform = platform
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] keywords Value to be assigned
145
+ def keywords=(keywords)
146
+ if keywords.nil?
147
+ fail ArgumentError, 'keywords cannot be nil'
148
+ end
149
+
150
+ if keywords.length > 1000
151
+ fail ArgumentError, 'invalid value for "keywords", number of items must be less than or equal to 1000.'
152
+ end
153
+
154
+ @keywords = keywords
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ platform == o.platform &&
163
+ keywords == o.keywords
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [platform, keywords].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end