Class: PinterestSdkClient::CampaignCreateRequestAllOf1
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::CampaignCreateRequestAllOf1
- Defined in:
- lib/pinterest_sdk/models/campaign_create_request_all_of1.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#bid_options ⇒ Object
Returns the value of attribute bid_options.
-
#intended_promotion_type ⇒ Object
Returns the value of attribute intended_promotion_type.
-
#is_automated_campaign ⇒ Object
Note: This field is immutable unless the campaign is in draft status.
-
#is_campaign_budget_optimization ⇒ Object
Note: This field is immutable unless the campaign is in draft status.
-
#is_flexible_daily_budgets ⇒ Object
Determine if a campaign has setup for flexible daily budgets, also known as "Pinterest Performance+ budgets".
-
#is_ltv_optimized ⇒ Object
Specifies whether the campaign is optimized for Lifetime Value (LTV).
-
#is_performance_plus ⇒ Object
Enable Pinterest Performance+ for your campaign.
-
#is_top_of_search ⇒ Object
<a href="/docs/getting-started/using-beta-and-restricted-features/" target="blank" target="blank">Restricted Have your ads and content appear at the top of search result lists in Pinterest.
-
#objective_type ⇒ Object
Returns the value of attribute objective_type.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CampaignCreateRequestAllOf1
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ CampaignCreateRequestAllOf1
Initializes the object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 120 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::CampaignCreateRequestAllOf1` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `PinterestSdkClient::CampaignCreateRequestAllOf1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'bid_options') self. = attributes[:'bid_options'] end if attributes.key?(:'intended_promotion_type') self.intended_promotion_type = attributes[:'intended_promotion_type'] end if attributes.key?(:'is_automated_campaign') self.is_automated_campaign = attributes[:'is_automated_campaign'] end if attributes.key?(:'is_campaign_budget_optimization') self.is_campaign_budget_optimization = attributes[:'is_campaign_budget_optimization'] end if attributes.key?(:'is_flexible_daily_budgets') self.is_flexible_daily_budgets = attributes[:'is_flexible_daily_budgets'] end if attributes.key?(:'is_ltv_optimized') self.is_ltv_optimized = attributes[:'is_ltv_optimized'] end if attributes.key?(:'is_performance_plus') self.is_performance_plus = attributes[:'is_performance_plus'] else self.is_performance_plus = false end if attributes.key?(:'is_top_of_search') self.is_top_of_search = attributes[:'is_top_of_search'] else self.is_top_of_search = false end if attributes.key?(:'objective_type') self.objective_type = attributes[:'objective_type'] else self.objective_type = nil end if attributes.key?(:'status') self.status = attributes[:'status'] end end |
Instance Attribute Details
#bid_options ⇒ Object
Returns the value of attribute bid_options.
18 19 20 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 18 def end |
#intended_promotion_type ⇒ Object
Returns the value of attribute intended_promotion_type.
20 21 22 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 20 def intended_promotion_type @intended_promotion_type end |
#is_automated_campaign ⇒ Object
Note: This field is immutable unless the campaign is in draft status. Specifies whether the campaign was created in the automated campaign flow. When using Automated Campaigns, a daily spend cap must be set, and Pinterest Performance+ may not be used. The following objective types are supported: - CONSIDERATION - WEB\_CONVERSION - SALES - CATALOG\_SALES
23 24 25 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 23 def is_automated_campaign @is_automated_campaign end |
#is_campaign_budget_optimization ⇒ Object
Note: This field is immutable unless the campaign is in draft status. Determines if a campaign automatically generates ad-group level budgets given a campaign budget to maximize campaign outcome. When using campaign budgets with a lifetime spend cap, the end time must be provided.
26 27 28 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 26 def is_campaign_budget_optimization @is_campaign_budget_optimization end |
#is_flexible_daily_budgets ⇒ Object
Determine if a campaign has setup for flexible daily budgets, also known as "Pinterest Performance+ budgets". Flexible daily budgets are only supported for campaign budget optimization with a daily spend cap, and not a lifetime spend cap.
29 30 31 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 29 def is_flexible_daily_budgets @is_flexible_daily_budgets end |
#is_ltv_optimized ⇒ Object
Specifies whether the campaign is optimized for Lifetime Value (LTV). Only available for eligible advertisers.
32 33 34 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 32 def is_ltv_optimized @is_ltv_optimized end |
#is_performance_plus ⇒ Object
Enable Pinterest Performance+ for your campaign. To learn more, see <a href="https://developers.pinterest.com/docs/api-features/pinterest-performance-plus-setup/">Pinterest Performance+ Setup.
35 36 37 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 35 def is_performance_plus @is_performance_plus end |
#is_top_of_search ⇒ Object
<a href="/docs/getting-started/using-beta-and-restricted-features/" target="blank" target="blank">Restricted Have your ads and content appear at the top of search result lists in Pinterest. You can only use this feature with the following objectives: CONSIDERATION WEB_CONVERSION CATALOG_SALES You cannot use this feature with Pinterest Performance+ or Premiere Spotlight enabled. You cannot change your true or false selection of this campaign if you <a href="https://developer.pinterest.com/docs/api/v5/campaigns-update" target="blank">update it.
38 39 40 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 38 def is_top_of_search @is_top_of_search end |
#objective_type ⇒ Object
Returns the value of attribute objective_type.
40 41 42 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 40 def objective_type @objective_type end |
#status ⇒ Object
Returns the value of attribute status.
42 43 44 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 42 def status @status end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
83 84 85 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 83 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
88 89 90 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 88 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 67 def self.attribute_map { :'bid_options' => :'bid_options', :'intended_promotion_type' => :'intended_promotion_type', :'is_automated_campaign' => :'is_automated_campaign', :'is_campaign_budget_optimization' => :'is_campaign_budget_optimization', :'is_flexible_daily_budgets' => :'is_flexible_daily_budgets', :'is_ltv_optimized' => :'is_ltv_optimized', :'is_performance_plus' => :'is_performance_plus', :'is_top_of_search' => :'is_top_of_search', :'objective_type' => :'objective_type', :'status' => :'status' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 243 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
109 110 111 112 113 114 115 116 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 109 def self.openapi_nullable Set.new([ :'bid_options', :'is_automated_campaign', :'is_campaign_budget_optimization', :'is_flexible_daily_budgets', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 93 def self.openapi_types { :'bid_options' => :'CampaignBidOptionsCreate', :'intended_promotion_type' => :'IntendedPromotionType', :'is_automated_campaign' => :'Boolean', :'is_campaign_budget_optimization' => :'Boolean', :'is_flexible_daily_budgets' => :'Boolean', :'is_ltv_optimized' => :'Boolean', :'is_performance_plus' => :'Boolean', :'is_top_of_search' => :'Boolean', :'objective_type' => :'ObjectiveType', :'status' => :'EntityStatus' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 213 def ==(o) return true if self.equal?(o) self.class == o.class && == o. && intended_promotion_type == o.intended_promotion_type && is_automated_campaign == o.is_automated_campaign && is_campaign_budget_optimization == o.is_campaign_budget_optimization && is_flexible_daily_budgets == o.is_flexible_daily_budgets && is_ltv_optimized == o.is_ltv_optimized && is_performance_plus == o.is_performance_plus && is_top_of_search == o.is_top_of_search && objective_type == o.objective_type && status == o.status end |
#eql?(o) ⇒ Boolean
230 231 232 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 230 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
236 237 238 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 236 def hash [, intended_promotion_type, is_automated_campaign, is_campaign_budget_optimization, is_flexible_daily_budgets, is_ltv_optimized, is_performance_plus, is_top_of_search, objective_type, status].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
183 184 185 186 187 188 189 190 191 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 183 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @objective_type.nil? invalid_properties.push('invalid value for "objective_type", objective_type cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 265 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
195 196 197 198 199 |
# File 'lib/pinterest_sdk/models/campaign_create_request_all_of1.rb', line 195 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @objective_type.nil? true end |