late-sdk 0.0.894 → 0.0.896
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.
- checksums.yaml +4 -4
- data/README.md +26 -3
- data/docs/AdAccountsApi.md +446 -0
- data/docs/AdAnalyticsResponse.md +1 -1
- data/docs/AdAnalyticsResponseAnalytics.md +22 -0
- data/docs/AdCampaign.md +1 -1
- data/docs/AdCampaignBudget.md +11 -3
- data/docs/AdCampaignsApi.md +149 -3
- data/docs/AdInsightsApi.md +1 -1
- data/docs/AdNegativeKeywordList.md +26 -0
- data/docs/AdNegativeKeywordListKeyword.md +22 -0
- data/docs/BoostPostRequest.md +6 -4
- data/docs/CampaignAnalyticsResponseAnalytics.md +3 -1
- data/docs/CampaignAnalyticsResponseAnalyticsImpressionShareCache.md +20 -0
- data/docs/CampaignAnalyticsResponseAnalyticsSummary.md +96 -0
- data/docs/CampaignAnalyticsResponseCampaign.md +2 -0
- data/docs/CreateAdNegativeKeywordList201Response.md +24 -0
- data/docs/CreateAdNegativeKeywordListRequest.md +26 -0
- data/docs/CreateCallAdRequest.md +8 -2
- data/docs/CreateMessagingAdRequest.md +8 -2
- data/docs/CtwaAdRequestBody.md +8 -2
- data/docs/CtwaAdRequestBodyCreativesInner.md +7 -3
- data/docs/DeleteAdNegativeKeywordList200Response.md +20 -0
- data/docs/GetAdAnalytics202Response.md +1 -1
- data/docs/GetAdNegativeKeywordList200Response.md +24 -0
- data/docs/GetAdNegativeKeywordList200ResponseList.md +28 -0
- data/docs/ListAdNegativeKeywordLists200Response.md +24 -0
- data/docs/MediaItem.md +1 -1
- data/docs/MessagingAdsApi.md +10 -10
- data/docs/ReplaceAdNegativeKeywordListKeywords200Response.md +22 -0
- data/docs/ReplaceAdNegativeKeywordListKeywordsRequest.md +24 -0
- data/docs/ReplaceCampaignNegativeKeywordListsRequest.md +20 -0
- data/docs/UpdateAdCampaign200Response.md +1 -1
- data/docs/UpdateAdCampaignRequest.md +2 -0
- data/docs/UpdateAdNegativeKeywordList200Response.md +20 -0
- data/docs/UpdateAdNegativeKeywordListRequest.md +24 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +500 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +160 -6
- data/lib/zernio-sdk/api/ad_insights_api.rb +2 -2
- data/lib/zernio-sdk/api/messaging_ads_api.rb +8 -8
- data/lib/zernio-sdk/models/ad_analytics_response.rb +1 -1
- data/lib/zernio-sdk/models/ad_analytics_response_analytics.rb +169 -0
- data/lib/zernio-sdk/models/ad_campaign.rb +3 -1
- data/lib/zernio-sdk/models/ad_campaign_budget.rb +99 -5
- data/lib/zernio-sdk/models/ad_negative_keyword_list.rb +209 -0
- data/lib/zernio-sdk/models/ad_negative_keyword_list_keyword.rb +222 -0
- data/lib/zernio-sdk/models/boost_post_request.rb +38 -7
- data/lib/zernio-sdk/models/campaign_analytics_response_analytics.rb +11 -2
- data/lib/zernio-sdk/models/campaign_analytics_response_analytics_impression_share_cache.rb +158 -0
- data/lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb +550 -0
- data/lib/zernio-sdk/models/campaign_analytics_response_campaign.rb +11 -1
- data/lib/zernio-sdk/models/create_ad_negative_keyword_list201_response.rb +220 -0
- data/lib/zernio-sdk/models/create_ad_negative_keyword_list_request.rb +327 -0
- data/lib/zernio-sdk/models/create_call_ad_request.rb +94 -3
- data/lib/zernio-sdk/models/create_messaging_ad_request.rb +94 -3
- data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +95 -4
- data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner.rb +67 -21
- data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner_video.rb +1 -1
- data/lib/zernio-sdk/models/ctwa_ad_request_body_video.rb +1 -1
- data/lib/zernio-sdk/models/{ad_campaign_campaign_budget.rb → delete_ad_negative_keyword_list200_response.rb} +35 -48
- data/lib/zernio-sdk/models/get_ad_analytics202_response.rb +1 -1
- data/lib/zernio-sdk/models/get_ad_negative_keyword_list200_response.rb +199 -0
- data/lib/zernio-sdk/models/get_ad_negative_keyword_list200_response_list.rb +227 -0
- data/lib/zernio-sdk/models/list_ad_negative_keyword_lists200_response.rb +201 -0
- data/lib/zernio-sdk/models/media_item.rb +1 -0
- data/lib/zernio-sdk/models/replace_ad_negative_keyword_list_keywords200_response.rb +189 -0
- data/lib/zernio-sdk/models/replace_ad_negative_keyword_list_keywords_request.rb +289 -0
- data/lib/zernio-sdk/models/replace_campaign_negative_keyword_lists_request.rb +219 -0
- data/lib/zernio-sdk/models/update_ad_campaign200_response.rb +1 -1
- data/lib/zernio-sdk/models/update_ad_campaign_request.rb +13 -1
- data/lib/zernio-sdk/models/update_ad_campaign_request_budget.rb +1 -1
- data/lib/zernio-sdk/models/update_ad_negative_keyword_list200_response.rb +178 -0
- data/lib/zernio-sdk/models/update_ad_negative_keyword_list_request.rb +296 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +16 -1
- data/openapi.yaml +981 -43
- data/spec/api/ad_accounts_api_spec.rb +82 -0
- data/spec/api/ad_campaigns_api_spec.rb +29 -3
- data/spec/api/ad_insights_api_spec.rb +1 -1
- data/spec/api/messaging_ads_api_spec.rb +4 -4
- data/spec/models/ad_analytics_response_analytics_spec.rb +48 -0
- data/spec/models/ad_campaign_budget_spec.rb +24 -0
- data/spec/models/ad_negative_keyword_list_keyword_spec.rb +52 -0
- data/spec/models/ad_negative_keyword_list_spec.rb +60 -0
- data/spec/models/boost_post_request_spec.rb +7 -1
- data/spec/models/campaign_analytics_response_analytics_impression_share_cache_spec.rb +42 -0
- data/spec/models/campaign_analytics_response_analytics_spec.rb +6 -0
- data/spec/models/campaign_analytics_response_analytics_summary_spec.rb +270 -0
- data/spec/models/campaign_analytics_response_campaign_spec.rb +6 -0
- data/spec/models/create_ad_negative_keyword_list201_response_spec.rb +54 -0
- data/spec/models/create_ad_negative_keyword_list_request_spec.rb +64 -0
- data/spec/models/create_call_ad_request_spec.rb +18 -0
- data/spec/models/create_messaging_ad_request_spec.rb +18 -0
- data/spec/models/ctwa_ad_request_body_creatives_inner_spec.rb +12 -0
- data/spec/models/ctwa_ad_request_body_spec.rb +18 -0
- data/spec/models/delete_ad_negative_keyword_list200_response_spec.rb +42 -0
- data/spec/models/get_ad_negative_keyword_list200_response_list_spec.rb +66 -0
- data/spec/models/get_ad_negative_keyword_list200_response_spec.rb +54 -0
- data/spec/models/list_ad_negative_keyword_lists200_response_spec.rb +54 -0
- data/spec/models/replace_ad_negative_keyword_list_keywords200_response_spec.rb +48 -0
- data/spec/models/replace_ad_negative_keyword_list_keywords_request_spec.rb +58 -0
- data/spec/models/{ad_campaign_campaign_budget_spec.rb → replace_campaign_negative_keyword_lists_request_spec.rb} +12 -12
- data/spec/models/update_ad_campaign_request_spec.rb +6 -0
- data/spec/models/update_ad_negative_keyword_list200_response_spec.rb +42 -0
- data/spec/models/update_ad_negative_keyword_list_request_spec.rb +58 -0
- data/zernio-sdk-0.0.896.gem +0 -0
- metadata +66 -6
- data/docs/AdCampaignCampaignBudget.md +0 -20
- data/zernio-sdk-0.0.894.gem +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
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 CreateAdNegativeKeywordList201Response < ApiModelBase
|
|
18
|
+
# New shared set id.
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# New shared set resource name.
|
|
22
|
+
attr_accessor :resource_name
|
|
23
|
+
|
|
24
|
+
# Number of initial keyword criteria created.
|
|
25
|
+
attr_accessor :created
|
|
26
|
+
|
|
27
|
+
# Resolved Google Ads customer id.
|
|
28
|
+
attr_accessor :customer_id
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'id' => :'id',
|
|
34
|
+
:'resource_name' => :'resourceName',
|
|
35
|
+
:'created' => :'created',
|
|
36
|
+
:'customer_id' => :'customerId'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'id' => :'String',
|
|
54
|
+
:'resource_name' => :'String',
|
|
55
|
+
:'created' => :'Integer',
|
|
56
|
+
:'customer_id' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdNegativeKeywordList201Response` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdNegativeKeywordList201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'id')
|
|
83
|
+
self.id = attributes[:'id']
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'resource_name')
|
|
87
|
+
self.resource_name = attributes[:'resource_name']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'created')
|
|
91
|
+
self.created = attributes[:'created']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'customer_id')
|
|
95
|
+
self.customer_id = attributes[:'customer_id']
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
100
|
+
# @return Array for valid properties with the reasons
|
|
101
|
+
def list_invalid_properties
|
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
pattern = Regexp.new(/^\d+$/)
|
|
105
|
+
if !@id.nil? && @id !~ pattern
|
|
106
|
+
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
pattern = Regexp.new(/^\d+$/)
|
|
110
|
+
if !@customer_id.nil? && @customer_id !~ pattern
|
|
111
|
+
invalid_properties.push("invalid value for \"customer_id\", must conform to the pattern #{pattern}.")
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
return false if !@id.nil? && @id !~ Regexp.new(/^\d+$/)
|
|
122
|
+
return false if !@customer_id.nil? && @customer_id !~ Regexp.new(/^\d+$/)
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method with validation
|
|
127
|
+
# @param [Object] id Value to be assigned
|
|
128
|
+
def id=(id)
|
|
129
|
+
if id.nil?
|
|
130
|
+
fail ArgumentError, 'id cannot be nil'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
pattern = Regexp.new(/^\d+$/)
|
|
134
|
+
if id !~ pattern
|
|
135
|
+
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@id = id
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] customer_id Value to be assigned
|
|
143
|
+
def customer_id=(customer_id)
|
|
144
|
+
if customer_id.nil?
|
|
145
|
+
fail ArgumentError, 'customer_id cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
pattern = Regexp.new(/^\d+$/)
|
|
149
|
+
if customer_id !~ pattern
|
|
150
|
+
fail ArgumentError, "invalid value for \"customer_id\", must conform to the pattern #{pattern}."
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
@customer_id = customer_id
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Checks equality by comparing each attribute.
|
|
157
|
+
# @param [Object] Object to be compared
|
|
158
|
+
def ==(o)
|
|
159
|
+
return true if self.equal?(o)
|
|
160
|
+
self.class == o.class &&
|
|
161
|
+
id == o.id &&
|
|
162
|
+
resource_name == o.resource_name &&
|
|
163
|
+
created == o.created &&
|
|
164
|
+
customer_id == o.customer_id
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# @see the `==` method
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def eql?(o)
|
|
170
|
+
self == o
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Calculates hash code according to all attributes.
|
|
174
|
+
# @return [Integer] Hash code
|
|
175
|
+
def hash
|
|
176
|
+
[id, resource_name, created, customer_id].hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Builds the object from hash
|
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
181
|
+
# @return [Object] Returns the model itself
|
|
182
|
+
def self.build_from_hash(attributes)
|
|
183
|
+
return nil unless attributes.is_a?(Hash)
|
|
184
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
185
|
+
transformed_hash = {}
|
|
186
|
+
openapi_types.each_pair do |key, type|
|
|
187
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = nil
|
|
189
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
190
|
+
# check to ensure the input is an array given that the attribute
|
|
191
|
+
# is documented as an array but the input is not
|
|
192
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
193
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
194
|
+
end
|
|
195
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
196
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
new(transformed_hash)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Returns the object in the form of hash
|
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
|
204
|
+
def to_hash
|
|
205
|
+
hash = {}
|
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
207
|
+
value = self.send(attr)
|
|
208
|
+
if value.nil?
|
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
hash[param] = _to_hash(value)
|
|
214
|
+
end
|
|
215
|
+
hash
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
@@ -0,0 +1,327 @@
|
|
|
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 CreateAdNegativeKeywordListRequest < ApiModelBase
|
|
18
|
+
# Zernio SocialAccount id.
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
# Connected Google Ads customer id, without dashes. Required when the connection has multiple customers.
|
|
22
|
+
attr_accessor :customer_id
|
|
23
|
+
|
|
24
|
+
# Optional courtesy field. The resolved account or campaign determines support; other platforms return 501.
|
|
25
|
+
attr_accessor :platform
|
|
26
|
+
|
|
27
|
+
# Nonempty list name, trimmed before use.
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# Full desired keyword set. Bare strings use broad match. Send [] to clear the list.
|
|
31
|
+
attr_accessor :keywords
|
|
32
|
+
|
|
33
|
+
class EnumAttributeValidator
|
|
34
|
+
attr_reader :datatype
|
|
35
|
+
attr_reader :allowable_values
|
|
36
|
+
|
|
37
|
+
def initialize(datatype, allowable_values)
|
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
|
39
|
+
case datatype.to_s
|
|
40
|
+
when /Integer/i
|
|
41
|
+
value.to_i
|
|
42
|
+
when /Float/i
|
|
43
|
+
value.to_f
|
|
44
|
+
else
|
|
45
|
+
value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def valid?(value)
|
|
51
|
+
!value || allowable_values.include?(value)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'account_id' => :'accountId',
|
|
59
|
+
:'customer_id' => :'customerId',
|
|
60
|
+
:'platform' => :'platform',
|
|
61
|
+
:'name' => :'name',
|
|
62
|
+
:'keywords' => :'keywords'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'account_id' => :'String',
|
|
80
|
+
:'customer_id' => :'String',
|
|
81
|
+
:'platform' => :'String',
|
|
82
|
+
:'name' => :'String',
|
|
83
|
+
:'keywords' => :'Array<KeywordEntry>'
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# List of attributes with nullable: true
|
|
88
|
+
def self.openapi_nullable
|
|
89
|
+
Set.new([
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdNegativeKeywordListRequest` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdNegativeKeywordListRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
|
+
end
|
|
106
|
+
h[k.to_sym] = v
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'account_id')
|
|
110
|
+
self.account_id = attributes[:'account_id']
|
|
111
|
+
else
|
|
112
|
+
self.account_id = nil
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'customer_id')
|
|
116
|
+
self.customer_id = attributes[:'customer_id']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'platform')
|
|
120
|
+
self.platform = attributes[:'platform']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'name')
|
|
124
|
+
self.name = attributes[:'name']
|
|
125
|
+
else
|
|
126
|
+
self.name = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'keywords')
|
|
130
|
+
if (value = attributes[:'keywords']).is_a?(Array)
|
|
131
|
+
self.keywords = value
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
137
|
+
# @return Array for valid properties with the reasons
|
|
138
|
+
def list_invalid_properties
|
|
139
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
140
|
+
invalid_properties = Array.new
|
|
141
|
+
if @account_id.nil?
|
|
142
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
146
|
+
if @account_id !~ pattern
|
|
147
|
+
invalid_properties.push("invalid value for \"account_id\", must conform to the pattern #{pattern}.")
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
pattern = Regexp.new(/^\d+$/)
|
|
151
|
+
if !@customer_id.nil? && @customer_id !~ pattern
|
|
152
|
+
invalid_properties.push("invalid value for \"customer_id\", must conform to the pattern #{pattern}.")
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @name.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @name.to_s.length > 255
|
|
160
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if @name.to_s.length < 1
|
|
164
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if !@keywords.nil? && @keywords.length > 5000
|
|
168
|
+
invalid_properties.push('invalid value for "keywords", number of items must be less than or equal to 5000.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
invalid_properties
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Check to see if the all the properties in the model are valid
|
|
175
|
+
# @return true if the model is valid
|
|
176
|
+
def valid?
|
|
177
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
178
|
+
return false if @account_id.nil?
|
|
179
|
+
return false if @account_id !~ Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
180
|
+
return false if !@customer_id.nil? && @customer_id !~ Regexp.new(/^\d+$/)
|
|
181
|
+
platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"])
|
|
182
|
+
return false unless platform_validator.valid?(@platform)
|
|
183
|
+
return false if @name.nil?
|
|
184
|
+
return false if @name.to_s.length > 255
|
|
185
|
+
return false if @name.to_s.length < 1
|
|
186
|
+
return false if !@keywords.nil? && @keywords.length > 5000
|
|
187
|
+
true
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Custom attribute writer method with validation
|
|
191
|
+
# @param [Object] account_id Value to be assigned
|
|
192
|
+
def account_id=(account_id)
|
|
193
|
+
if account_id.nil?
|
|
194
|
+
fail ArgumentError, 'account_id cannot be nil'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
198
|
+
if account_id !~ pattern
|
|
199
|
+
fail ArgumentError, "invalid value for \"account_id\", must conform to the pattern #{pattern}."
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
@account_id = account_id
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Custom attribute writer method with validation
|
|
206
|
+
# @param [Object] customer_id Value to be assigned
|
|
207
|
+
def customer_id=(customer_id)
|
|
208
|
+
if customer_id.nil?
|
|
209
|
+
fail ArgumentError, 'customer_id cannot be nil'
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
pattern = Regexp.new(/^\d+$/)
|
|
213
|
+
if customer_id !~ pattern
|
|
214
|
+
fail ArgumentError, "invalid value for \"customer_id\", must conform to the pattern #{pattern}."
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@customer_id = customer_id
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
221
|
+
# @param [Object] platform Object to be assigned
|
|
222
|
+
def platform=(platform)
|
|
223
|
+
validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"])
|
|
224
|
+
unless validator.valid?(platform)
|
|
225
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
226
|
+
end
|
|
227
|
+
@platform = platform
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Custom attribute writer method with validation
|
|
231
|
+
# @param [Object] name Value to be assigned
|
|
232
|
+
def name=(name)
|
|
233
|
+
if name.nil?
|
|
234
|
+
fail ArgumentError, 'name cannot be nil'
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if name.to_s.length > 255
|
|
238
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if name.to_s.length < 1
|
|
242
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@name = name
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] keywords Value to be assigned
|
|
250
|
+
def keywords=(keywords)
|
|
251
|
+
if keywords.nil?
|
|
252
|
+
fail ArgumentError, 'keywords cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
if keywords.length > 5000
|
|
256
|
+
fail ArgumentError, 'invalid value for "keywords", number of items must be less than or equal to 5000.'
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
@keywords = keywords
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Checks equality by comparing each attribute.
|
|
263
|
+
# @param [Object] Object to be compared
|
|
264
|
+
def ==(o)
|
|
265
|
+
return true if self.equal?(o)
|
|
266
|
+
self.class == o.class &&
|
|
267
|
+
account_id == o.account_id &&
|
|
268
|
+
customer_id == o.customer_id &&
|
|
269
|
+
platform == o.platform &&
|
|
270
|
+
name == o.name &&
|
|
271
|
+
keywords == o.keywords
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# @see the `==` method
|
|
275
|
+
# @param [Object] Object to be compared
|
|
276
|
+
def eql?(o)
|
|
277
|
+
self == o
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Calculates hash code according to all attributes.
|
|
281
|
+
# @return [Integer] Hash code
|
|
282
|
+
def hash
|
|
283
|
+
[account_id, customer_id, platform, name, keywords].hash
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Builds the object from hash
|
|
287
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
288
|
+
# @return [Object] Returns the model itself
|
|
289
|
+
def self.build_from_hash(attributes)
|
|
290
|
+
return nil unless attributes.is_a?(Hash)
|
|
291
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
292
|
+
transformed_hash = {}
|
|
293
|
+
openapi_types.each_pair do |key, type|
|
|
294
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
295
|
+
transformed_hash["#{key}"] = nil
|
|
296
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
297
|
+
# check to ensure the input is an array given that the attribute
|
|
298
|
+
# is documented as an array but the input is not
|
|
299
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
300
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
301
|
+
end
|
|
302
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
303
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
new(transformed_hash)
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Returns the object in the form of hash
|
|
310
|
+
# @return [Hash] Returns the object in the form of hash
|
|
311
|
+
def to_hash
|
|
312
|
+
hash = {}
|
|
313
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
314
|
+
value = self.send(attr)
|
|
315
|
+
if value.nil?
|
|
316
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
317
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
hash[param] = _to_hash(value)
|
|
321
|
+
end
|
|
322
|
+
hash
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
end
|