late-sdk 0.0.899 → 0.0.900
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 +21 -2
- data/docs/AdAccountsApi.md +463 -3
- data/docs/AdCampaignsApi.md +4 -4
- data/docs/AdTracking.md +20 -0
- data/docs/CreateAdCampaign200Response.md +26 -0
- data/docs/CreateAdCampaignRequest.md +8 -0
- data/docs/CreateCallAdRequest.md +2 -0
- data/docs/CreateMessagingAdRequest.md +2 -0
- data/docs/CreateStandaloneAdRequest.md +11 -3
- data/docs/CtwaAdRequestBody.md +2 -0
- data/docs/GetAdComments200ResponseMeta.md +10 -4
- data/docs/GetIosFourteenCampaignLimits200Response.md +18 -0
- data/docs/GetIosFourteenCampaignLimits200ResponseLimits.md +22 -0
- data/docs/HideAdComment200Response.md +22 -0
- data/docs/HideAdCommentRequest.md +18 -0
- data/docs/ListAdsInstagramAccounts200Response.md +22 -0
- data/docs/ListAdsInstagramAccounts200ResponseAccountsInner.md +26 -0
- data/docs/ListAdsInstagramAccounts200ResponsePagesInner.md +24 -0
- data/docs/ListAdsInstagramAccounts200ResponseResolved.md +22 -0
- data/docs/ListAdvertisableApplications200Response.md +18 -0
- data/docs/ListAdvertisableApplications200ResponseApplicationsInner.md +24 -0
- data/docs/MetaInstagramIdentityRef.md +22 -0
- data/docs/ReplyToAdComment200Response.md +20 -0
- data/docs/ReplyToAdCommentRequest.md +18 -0
- data/docs/TargetingSpec.md +4 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +512 -4
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +3 -3
- data/lib/zernio-sdk/models/{create_standalone_ad_request_tracking.rb → ad_tracking.rb} +5 -5
- data/lib/zernio-sdk/models/create_ad_campaign200_response.rb +231 -0
- data/lib/zernio-sdk/models/create_ad_campaign_request.rb +52 -1
- data/lib/zernio-sdk/models/create_call_ad_request.rb +10 -1
- data/lib/zernio-sdk/models/create_messaging_ad_request.rb +10 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +98 -4
- data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +10 -1
- data/lib/zernio-sdk/models/get_ad_comments200_response_meta.rb +36 -46
- data/lib/zernio-sdk/models/get_ios_fourteen_campaign_limits200_response.rb +164 -0
- data/lib/zernio-sdk/models/get_ios_fourteen_campaign_limits200_response_limits.rb +172 -0
- data/lib/zernio-sdk/models/hide_ad_comment200_response.rb +225 -0
- data/lib/zernio-sdk/models/hide_ad_comment_request.rb +165 -0
- data/lib/zernio-sdk/models/list_ads_instagram_accounts200_response.rb +220 -0
- data/lib/zernio-sdk/models/list_ads_instagram_accounts200_response_accounts_inner.rb +287 -0
- data/lib/zernio-sdk/models/list_ads_instagram_accounts200_response_pages_inner.rb +210 -0
- data/lib/zernio-sdk/models/list_ads_instagram_accounts200_response_resolved.rb +211 -0
- data/lib/zernio-sdk/models/list_advertisable_applications200_response.rb +166 -0
- data/lib/zernio-sdk/models/list_advertisable_applications200_response_applications_inner.rb +250 -0
- data/lib/zernio-sdk/models/meta_instagram_identity_ref.rb +202 -0
- data/lib/zernio-sdk/models/reply_to_ad_comment200_response.rb +215 -0
- data/lib/zernio-sdk/models/reply_to_ad_comment_request.rb +174 -0
- data/lib/zernio-sdk/models/targeting_spec.rb +63 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +15 -2
- data/openapi.yaml +618 -143
- data/spec/api/ad_accounts_api_spec.rb +91 -2
- data/spec/api/ad_campaigns_api_spec.rb +1 -1
- data/spec/models/{create_standalone_ad_request_tracking_spec.rb → ad_tracking_spec.rb} +6 -6
- data/spec/models/create_ad_campaign200_response_spec.rb +68 -0
- data/spec/models/create_ad_campaign_request_spec.rb +28 -0
- data/spec/models/create_call_ad_request_spec.rb +6 -0
- data/spec/models/create_messaging_ad_request_spec.rb +6 -0
- data/spec/models/create_standalone_ad_request_spec.rb +28 -0
- data/spec/models/ctwa_ad_request_body_spec.rb +6 -0
- data/spec/models/get_ad_comments200_response_meta_spec.rb +19 -1
- data/spec/models/get_ios_fourteen_campaign_limits200_response_limits_spec.rb +48 -0
- data/spec/models/get_ios_fourteen_campaign_limits200_response_spec.rb +36 -0
- data/spec/models/hide_ad_comment200_response_spec.rb +52 -0
- data/spec/models/hide_ad_comment_request_spec.rb +36 -0
- data/spec/models/list_ads_instagram_accounts200_response_accounts_inner_spec.rb +64 -0
- data/spec/models/list_ads_instagram_accounts200_response_pages_inner_spec.rb +54 -0
- data/spec/models/list_ads_instagram_accounts200_response_resolved_spec.rb +52 -0
- data/spec/models/list_ads_instagram_accounts200_response_spec.rb +48 -0
- data/spec/models/list_advertisable_applications200_response_applications_inner_spec.rb +54 -0
- data/spec/models/list_advertisable_applications200_response_spec.rb +36 -0
- data/spec/models/meta_instagram_identity_ref_spec.rb +48 -0
- data/spec/models/reply_to_ad_comment200_response_spec.rb +46 -0
- data/spec/models/reply_to_ad_comment_request_spec.rb +36 -0
- data/spec/models/targeting_spec_spec.rb +12 -0
- data/zernio-sdk-0.0.900.gem +0 -0
- metadata +62 -10
- data/docs/CreateStandaloneAdRequestPromotedObject.md +0 -38
- data/docs/CreateStandaloneAdRequestTracking.md +0 -20
- data/lib/zernio-sdk/models/create_standalone_ad_request_promoted_object.rb +0 -249
- data/spec/models/create_standalone_ad_request_promoted_object_spec.rb +0 -96
- data/zernio-sdk-0.0.899.gem +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
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 ReplyToAdComment200Response < ApiModelBase
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
|
|
20
|
+
# ID of the created reply or moderated comment.
|
|
21
|
+
attr_accessor :comment_id
|
|
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
|
+
:'status' => :'status',
|
|
49
|
+
:'comment_id' => :'commentId'
|
|
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
|
+
:'status' => :'String',
|
|
67
|
+
:'comment_id' => :'String'
|
|
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::ReplyToAdComment200Response` 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::ReplyToAdComment200Response`. 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?(:'status')
|
|
94
|
+
self.status = attributes[:'status']
|
|
95
|
+
else
|
|
96
|
+
self.status = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'comment_id')
|
|
100
|
+
self.comment_id = attributes[:'comment_id']
|
|
101
|
+
else
|
|
102
|
+
self.comment_id = 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 @status.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @comment_id.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "comment_id", comment_id cannot be nil.')
|
|
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
|
+
return false if @status.nil?
|
|
127
|
+
status_validator = EnumAttributeValidator.new('String', ["success"])
|
|
128
|
+
return false unless status_validator.valid?(@status)
|
|
129
|
+
return false if @comment_id.nil?
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
134
|
+
# @param [Object] status Object to be assigned
|
|
135
|
+
def status=(status)
|
|
136
|
+
validator = EnumAttributeValidator.new('String', ["success"])
|
|
137
|
+
unless validator.valid?(status)
|
|
138
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
139
|
+
end
|
|
140
|
+
@status = status
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] comment_id Value to be assigned
|
|
145
|
+
def comment_id=(comment_id)
|
|
146
|
+
if comment_id.nil?
|
|
147
|
+
fail ArgumentError, 'comment_id cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@comment_id = comment_id
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Checks equality by comparing each attribute.
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def ==(o)
|
|
156
|
+
return true if self.equal?(o)
|
|
157
|
+
self.class == o.class &&
|
|
158
|
+
status == o.status &&
|
|
159
|
+
comment_id == o.comment_id
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# @see the `==` method
|
|
163
|
+
# @param [Object] Object to be compared
|
|
164
|
+
def eql?(o)
|
|
165
|
+
self == o
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Calculates hash code according to all attributes.
|
|
169
|
+
# @return [Integer] Hash code
|
|
170
|
+
def hash
|
|
171
|
+
[status, comment_id].hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Builds the object from hash
|
|
175
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
176
|
+
# @return [Object] Returns the model itself
|
|
177
|
+
def self.build_from_hash(attributes)
|
|
178
|
+
return nil unless attributes.is_a?(Hash)
|
|
179
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
180
|
+
transformed_hash = {}
|
|
181
|
+
openapi_types.each_pair do |key, type|
|
|
182
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
183
|
+
transformed_hash["#{key}"] = nil
|
|
184
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
185
|
+
# check to ensure the input is an array given that the attribute
|
|
186
|
+
# is documented as an array but the input is not
|
|
187
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
188
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
189
|
+
end
|
|
190
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
191
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
new(transformed_hash)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Returns the object in the form of hash
|
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
|
199
|
+
def to_hash
|
|
200
|
+
hash = {}
|
|
201
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
202
|
+
value = self.send(attr)
|
|
203
|
+
if value.nil?
|
|
204
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
205
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
hash[param] = _to_hash(value)
|
|
209
|
+
end
|
|
210
|
+
hash
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
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 ReplyToAdCommentRequest < ApiModelBase
|
|
18
|
+
# Non-empty reply text.
|
|
19
|
+
attr_accessor :text
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'text' => :'text'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'text' => :'String'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ReplyToAdCommentRequest` 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 `Zernio::ReplyToAdCommentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'text')
|
|
68
|
+
self.text = attributes[:'text']
|
|
69
|
+
else
|
|
70
|
+
self.text = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @text.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if @text.to_s.length < 1
|
|
84
|
+
invalid_properties.push('invalid value for "text", the character length must be greater than or equal to 1.')
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
return false if @text.nil?
|
|
95
|
+
return false if @text.to_s.length < 1
|
|
96
|
+
true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Custom attribute writer method with validation
|
|
100
|
+
# @param [Object] text Value to be assigned
|
|
101
|
+
def text=(text)
|
|
102
|
+
if text.nil?
|
|
103
|
+
fail ArgumentError, 'text cannot be nil'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if text.to_s.length < 1
|
|
107
|
+
fail ArgumentError, 'invalid value for "text", the character length must be greater than or equal to 1.'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@text = text
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
text == o.text
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# @see the `==` method
|
|
122
|
+
# @param [Object] Object to be compared
|
|
123
|
+
def eql?(o)
|
|
124
|
+
self == o
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Calculates hash code according to all attributes.
|
|
128
|
+
# @return [Integer] Hash code
|
|
129
|
+
def hash
|
|
130
|
+
[text].hash
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Builds the object from hash
|
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
135
|
+
# @return [Object] Returns the model itself
|
|
136
|
+
def self.build_from_hash(attributes)
|
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
|
138
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
139
|
+
transformed_hash = {}
|
|
140
|
+
openapi_types.each_pair do |key, type|
|
|
141
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = nil
|
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
144
|
+
# check to ensure the input is an array given that the attribute
|
|
145
|
+
# is documented as an array but the input is not
|
|
146
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
147
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
148
|
+
end
|
|
149
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
150
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
new(transformed_hash)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Returns the object in the form of hash
|
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
|
158
|
+
def to_hash
|
|
159
|
+
hash = {}
|
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
161
|
+
value = self.send(attr)
|
|
162
|
+
if value.nil?
|
|
163
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
164
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
hash[param] = _to_hash(value)
|
|
168
|
+
end
|
|
169
|
+
hash
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
end
|
|
@@ -16,6 +16,12 @@ require 'time'
|
|
|
16
16
|
module Zernio
|
|
17
17
|
# Normalized, platform-agnostic ad-targeting spec. Every field is optional, an empty object targets the platform's default broadest audience. Field names are camelCase and identical across `POST /v1/ads/create` (the `targeting` object), `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences, so a spec resolved once can be reused verbatim. Entity ids (`regions[].key`, `cities[].key`, `zips[].key`, `metros[].key`, `interests[].id`, `behaviors[].id`) are the platform's opaque identifiers resolved via `GET /v1/ads/targeting/search`. A spec is therefore meaningful only for the platform it was built against, except the portable fields (`countries`, `ageMin`/`ageMax`, `gender`, `incomeTier`, `languages`) which carry across platforms. Fields a platform cannot honour are rejected at create time with `INVALID_FIELD_VALUE` naming the offending field (not silently dropped).
|
|
18
18
|
class TargetingSpec < ApiModelBase
|
|
19
|
+
# Meta only. Operating systems and version ranges, such as iOS_ver_14.0_and_above or Android. Emitted as user_os. May also be supplied inside targeting.
|
|
20
|
+
attr_accessor :user_os
|
|
21
|
+
|
|
22
|
+
# Meta only. Device models such as iPhone. Emitted as user_device. May also be supplied inside targeting.
|
|
23
|
+
attr_accessor :user_device
|
|
24
|
+
|
|
19
25
|
# ISO 3166-1 alpha-2 country codes (e.g. ['US']).
|
|
20
26
|
attr_accessor :countries
|
|
21
27
|
|
|
@@ -109,6 +115,8 @@ module Zernio
|
|
|
109
115
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
110
116
|
def self.attribute_map
|
|
111
117
|
{
|
|
118
|
+
:'user_os' => :'userOs',
|
|
119
|
+
:'user_device' => :'userDevice',
|
|
112
120
|
:'countries' => :'countries',
|
|
113
121
|
:'regions' => :'regions',
|
|
114
122
|
:'cities' => :'cities',
|
|
@@ -148,6 +156,8 @@ module Zernio
|
|
|
148
156
|
# Attribute type mapping.
|
|
149
157
|
def self.openapi_types
|
|
150
158
|
{
|
|
159
|
+
:'user_os' => :'Array<String>',
|
|
160
|
+
:'user_device' => :'Array<String>',
|
|
151
161
|
:'countries' => :'Array<String>',
|
|
152
162
|
:'regions' => :'Array<UpdateCampaignTargetingRequestTargetingLocationsOneOfRegionsInner>',
|
|
153
163
|
:'cities' => :'Array<TargetingSpecCitiesInner>',
|
|
@@ -196,6 +206,18 @@ module Zernio
|
|
|
196
206
|
h[k.to_sym] = v
|
|
197
207
|
}
|
|
198
208
|
|
|
209
|
+
if attributes.key?(:'user_os')
|
|
210
|
+
if (value = attributes[:'user_os']).is_a?(Array)
|
|
211
|
+
self.user_os = value
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'user_device')
|
|
216
|
+
if (value = attributes[:'user_device']).is_a?(Array)
|
|
217
|
+
self.user_device = value
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
199
221
|
if attributes.key?(:'countries')
|
|
200
222
|
if (value = attributes[:'countries']).is_a?(Array)
|
|
201
223
|
self.countries = value
|
|
@@ -330,6 +352,14 @@ module Zernio
|
|
|
330
352
|
def list_invalid_properties
|
|
331
353
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
332
354
|
invalid_properties = Array.new
|
|
355
|
+
if !@user_os.nil? && @user_os.length < 1
|
|
356
|
+
invalid_properties.push('invalid value for "user_os", number of items must be greater than or equal to 1.')
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
if !@user_device.nil? && @user_device.length < 1
|
|
360
|
+
invalid_properties.push('invalid value for "user_device", number of items must be greater than or equal to 1.')
|
|
361
|
+
end
|
|
362
|
+
|
|
333
363
|
if !@age_min.nil? && @age_min > 100
|
|
334
364
|
invalid_properties.push('invalid value for "age_min", must be smaller than or equal to 100.')
|
|
335
365
|
end
|
|
@@ -353,6 +383,8 @@ module Zernio
|
|
|
353
383
|
# @return true if the model is valid
|
|
354
384
|
def valid?
|
|
355
385
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
386
|
+
return false if !@user_os.nil? && @user_os.length < 1
|
|
387
|
+
return false if !@user_device.nil? && @user_device.length < 1
|
|
356
388
|
return false if !@age_min.nil? && @age_min > 100
|
|
357
389
|
return false if !@age_min.nil? && @age_min < 13
|
|
358
390
|
return false if !@age_max.nil? && @age_max > 100
|
|
@@ -364,6 +396,34 @@ module Zernio
|
|
|
364
396
|
true
|
|
365
397
|
end
|
|
366
398
|
|
|
399
|
+
# Custom attribute writer method with validation
|
|
400
|
+
# @param [Object] user_os Value to be assigned
|
|
401
|
+
def user_os=(user_os)
|
|
402
|
+
if user_os.nil?
|
|
403
|
+
fail ArgumentError, 'user_os cannot be nil'
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
if user_os.length < 1
|
|
407
|
+
fail ArgumentError, 'invalid value for "user_os", number of items must be greater than or equal to 1.'
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
@user_os = user_os
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
# Custom attribute writer method with validation
|
|
414
|
+
# @param [Object] user_device Value to be assigned
|
|
415
|
+
def user_device=(user_device)
|
|
416
|
+
if user_device.nil?
|
|
417
|
+
fail ArgumentError, 'user_device cannot be nil'
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
if user_device.length < 1
|
|
421
|
+
fail ArgumentError, 'invalid value for "user_device", number of items must be greater than or equal to 1.'
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
@user_device = user_device
|
|
425
|
+
end
|
|
426
|
+
|
|
367
427
|
# Custom attribute writer method with validation
|
|
368
428
|
# @param [Object] age_min Value to be assigned
|
|
369
429
|
def age_min=(age_min)
|
|
@@ -425,6 +485,8 @@ module Zernio
|
|
|
425
485
|
def ==(o)
|
|
426
486
|
return true if self.equal?(o)
|
|
427
487
|
self.class == o.class &&
|
|
488
|
+
user_os == o.user_os &&
|
|
489
|
+
user_device == o.user_device &&
|
|
428
490
|
countries == o.countries &&
|
|
429
491
|
regions == o.regions &&
|
|
430
492
|
cities == o.cities &&
|
|
@@ -459,7 +521,7 @@ module Zernio
|
|
|
459
521
|
# Calculates hash code according to all attributes.
|
|
460
522
|
# @return [Integer] Hash code
|
|
461
523
|
def hash
|
|
462
|
-
[countries, regions, cities, zips, metros, custom_locations, excluded_locations, age_min, age_max, gender, income_tier, languages, interests, behaviors, work_positions, work_employers, work_industries, industries, company_sizes, seniorities, job_functions, audience_include, audience_exclude].hash
|
|
524
|
+
[user_os, user_device, countries, regions, cities, zips, metros, custom_locations, excluded_locations, age_min, age_max, gender, income_tier, languages, interests, behaviors, work_positions, work_employers, work_industries, industries, company_sizes, seniorities, job_functions, audience_include, audience_exclude].hash
|
|
463
525
|
end
|
|
464
526
|
|
|
465
527
|
# Builds the object from hash
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -44,6 +44,7 @@ require 'zernio-sdk/models/ad_promoted_object'
|
|
|
44
44
|
require 'zernio-sdk/models/ad_review_status'
|
|
45
45
|
require 'zernio-sdk/models/ad_schedule'
|
|
46
46
|
require 'zernio-sdk/models/ad_status'
|
|
47
|
+
require 'zernio-sdk/models/ad_tracking'
|
|
47
48
|
require 'zernio-sdk/models/ad_tree_ad_set'
|
|
48
49
|
require 'zernio-sdk/models/ad_tree_ad_set_ad_set_budget'
|
|
49
50
|
require 'zernio-sdk/models/ad_tree_ad_set_budget'
|
|
@@ -254,6 +255,7 @@ require 'zernio-sdk/models/create_account_group201_response_group'
|
|
|
254
255
|
require 'zernio-sdk/models/create_account_group_request'
|
|
255
256
|
require 'zernio-sdk/models/create_ad_audience201_response'
|
|
256
257
|
require 'zernio-sdk/models/create_ad_audience_request'
|
|
258
|
+
require 'zernio-sdk/models/create_ad_campaign200_response'
|
|
257
259
|
require 'zernio-sdk/models/create_ad_campaign201_response'
|
|
258
260
|
require 'zernio-sdk/models/create_ad_campaign_request'
|
|
259
261
|
require 'zernio-sdk/models/create_ad_creative201_response'
|
|
@@ -395,11 +397,9 @@ require 'zernio-sdk/models/create_standalone_ad_request_placement_assets_rules_i
|
|
|
395
397
|
require 'zernio-sdk/models/create_standalone_ad_request_placement_assets_rules_inner_placements'
|
|
396
398
|
require 'zernio-sdk/models/create_standalone_ad_request_placements'
|
|
397
399
|
require 'zernio-sdk/models/create_standalone_ad_request_platform_specific_data'
|
|
398
|
-
require 'zernio-sdk/models/create_standalone_ad_request_promoted_object'
|
|
399
400
|
require 'zernio-sdk/models/create_standalone_ad_request_regions_inner'
|
|
400
401
|
require 'zernio-sdk/models/create_standalone_ad_request_sitelinks_inner'
|
|
401
402
|
require 'zernio-sdk/models/create_standalone_ad_request_structured_snippets_inner'
|
|
402
|
-
require 'zernio-sdk/models/create_standalone_ad_request_tracking'
|
|
403
403
|
require 'zernio-sdk/models/create_standalone_ad_request_translations_inner'
|
|
404
404
|
require 'zernio-sdk/models/create_standalone_ad_request_video'
|
|
405
405
|
require 'zernio-sdk/models/create_test_lead200_response'
|
|
@@ -740,6 +740,8 @@ require 'zernio-sdk/models/get_instagram_publishing_limit200_response'
|
|
|
740
740
|
require 'zernio-sdk/models/get_instagram_story_insights200_response'
|
|
741
741
|
require 'zernio-sdk/models/get_instagram_story_insights200_response_data'
|
|
742
742
|
require 'zernio-sdk/models/get_instagram_story_insights200_response_data_metrics'
|
|
743
|
+
require 'zernio-sdk/models/get_ios_fourteen_campaign_limits200_response'
|
|
744
|
+
require 'zernio-sdk/models/get_ios_fourteen_campaign_limits200_response_limits'
|
|
743
745
|
require 'zernio-sdk/models/get_lead_form200_response'
|
|
744
746
|
require 'zernio-sdk/models/get_linked_in_aggregate_analytics200_response'
|
|
745
747
|
require 'zernio-sdk/models/get_linked_in_aggregate_analytics400_response'
|
|
@@ -916,6 +918,8 @@ require 'zernio-sdk/models/google_business_review'
|
|
|
916
918
|
require 'zernio-sdk/models/google_business_review_review_reply'
|
|
917
919
|
require 'zernio-sdk/models/google_business_review_reviewer'
|
|
918
920
|
require 'zernio-sdk/models/handle_o_auth_callback_request'
|
|
921
|
+
require 'zernio-sdk/models/hide_ad_comment200_response'
|
|
922
|
+
require 'zernio-sdk/models/hide_ad_comment_request'
|
|
919
923
|
require 'zernio-sdk/models/hide_inbox_comment200_response'
|
|
920
924
|
require 'zernio-sdk/models/hide_inbox_comment_request'
|
|
921
925
|
require 'zernio-sdk/models/inbox_message_edit_attachment'
|
|
@@ -1011,6 +1015,12 @@ require 'zernio-sdk/models/list_ad_studies200_response'
|
|
|
1011
1015
|
require 'zernio-sdk/models/list_ad_videos200_response'
|
|
1012
1016
|
require 'zernio-sdk/models/list_ads202_response'
|
|
1013
1017
|
require 'zernio-sdk/models/list_ads_business_centers200_response'
|
|
1018
|
+
require 'zernio-sdk/models/list_ads_instagram_accounts200_response'
|
|
1019
|
+
require 'zernio-sdk/models/list_ads_instagram_accounts200_response_accounts_inner'
|
|
1020
|
+
require 'zernio-sdk/models/list_ads_instagram_accounts200_response_pages_inner'
|
|
1021
|
+
require 'zernio-sdk/models/list_ads_instagram_accounts200_response_resolved'
|
|
1022
|
+
require 'zernio-sdk/models/list_advertisable_applications200_response'
|
|
1023
|
+
require 'zernio-sdk/models/list_advertisable_applications200_response_applications_inner'
|
|
1014
1024
|
require 'zernio-sdk/models/list_api_keys200_response'
|
|
1015
1025
|
require 'zernio-sdk/models/list_bid_strategies200_response'
|
|
1016
1026
|
require 'zernio-sdk/models/list_blog_articles200_response'
|
|
@@ -1198,6 +1208,7 @@ require 'zernio-sdk/models/media_content_type'
|
|
|
1198
1208
|
require 'zernio-sdk/models/media_item'
|
|
1199
1209
|
require 'zernio-sdk/models/media_upload_response'
|
|
1200
1210
|
require 'zernio-sdk/models/meta_ads_platform_data'
|
|
1211
|
+
require 'zernio-sdk/models/meta_instagram_identity_ref'
|
|
1201
1212
|
require 'zernio-sdk/models/meta_lead_form_platform_data'
|
|
1202
1213
|
require 'zernio-sdk/models/meta_lead_form_platform_data_context_card'
|
|
1203
1214
|
require 'zernio-sdk/models/meta_promotion'
|
|
@@ -1309,6 +1320,8 @@ require 'zernio-sdk/models/replace_ad_negative_keyword_list_keywords_request'
|
|
|
1309
1320
|
require 'zernio-sdk/models/replace_campaign_negative_keyword_lists_request'
|
|
1310
1321
|
require 'zernio-sdk/models/replace_campaign_negative_keywords200_response'
|
|
1311
1322
|
require 'zernio-sdk/models/replace_campaign_negative_keywords_request'
|
|
1323
|
+
require 'zernio-sdk/models/reply_to_ad_comment200_response'
|
|
1324
|
+
require 'zernio-sdk/models/reply_to_ad_comment_request'
|
|
1312
1325
|
require 'zernio-sdk/models/reply_to_google_business_review200_response'
|
|
1313
1326
|
require 'zernio-sdk/models/reply_to_google_business_review_request'
|
|
1314
1327
|
require 'zernio-sdk/models/reply_to_inbox_post200_response'
|