Class: ConstantContactClient::GetEmailCampaignActivity200Response
- Inherits:
-
Object
- Object
- ConstantContactClient::GetEmailCampaignActivity200Response
- Defined in:
- lib/constant_contact_client/models/get_email_campaign_activity200_response.rb
Instance Attribute Summary collapse
-
#campaign_activity_id ⇒ Object
Identifies a campaign activity in the V3 API.
-
#campaign_id ⇒ Object
Identifies a campaign in the V3 API.
-
#contact_list_ids ⇒ Object
The contacts that Constant Contact sends the email campaign activity to as an array of contact
list_id
values. -
#current_status ⇒ Object
The current status of the email campaign activity.
-
#document_properties ⇒ Object
Returns the value of attribute document_properties.
-
#format_type ⇒ Object
Identifies the type of email format.
-
#from_email ⇒ Object
The email "From Email" field for the email campaign activity.
-
#from_name ⇒ Object
The email "From Name" field for the email campaign activity.
-
#html_content ⇒ Object
The HTML or XHTML content for the email campaign activity.
-
#permalink_url ⇒ Object
The permanent link to a web accessible version of the email campaign content without any personalized email information.
-
#physical_address_in_footer ⇒ Object
Returns the value of attribute physical_address_in_footer.
-
#preheader ⇒ Object
The email preheader for the email campaign activity.
-
#reply_to_email ⇒ Object
The email "Reply To Email" field for the email campaign activity.
-
#role ⇒ Object
The purpose of the individual campaign activity in the larger email campaign effort.
-
#segment_ids ⇒ Object
The contacts that Constant Contact sends the email campaign activity to as an array containing a single
segment_id
value. -
#subject ⇒ Object
The email "Subject" field for the email campaign activity.
-
#template_id ⇒ Object
Identifies the email layout and design template that the email campaign activity is using as a base.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GetEmailCampaignActivity200Response
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ GetEmailCampaignActivity200Response
Initializes the object
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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 126 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `ConstantContactClient::GetEmailCampaignActivity200Response` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `ConstantContactClient::GetEmailCampaignActivity200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'campaign_activity_id') self.campaign_activity_id = attributes[:'campaign_activity_id'] end if attributes.key?(:'campaign_id') self.campaign_id = attributes[:'campaign_id'] end if attributes.key?(:'role') self.role = attributes[:'role'] end if attributes.key?(:'contact_list_ids') if (value = attributes[:'contact_list_ids']).is_a?(Array) self.contact_list_ids = value end end if attributes.key?(:'segment_ids') if (value = attributes[:'segment_ids']).is_a?(Array) self.segment_ids = value end end if attributes.key?(:'current_status') self.current_status = attributes[:'current_status'] end if attributes.key?(:'format_type') self.format_type = attributes[:'format_type'] end if attributes.key?(:'from_email') self.from_email = attributes[:'from_email'] else self.from_email = nil end if attributes.key?(:'from_name') self.from_name = attributes[:'from_name'] else self.from_name = nil end if attributes.key?(:'reply_to_email') self.reply_to_email = attributes[:'reply_to_email'] else self.reply_to_email = nil end if attributes.key?(:'subject') self.subject = attributes[:'subject'] else self.subject = nil end if attributes.key?(:'html_content') self.html_content = attributes[:'html_content'] end if attributes.key?(:'template_id') self.template_id = attributes[:'template_id'] end if attributes.key?(:'permalink_url') self.permalink_url = attributes[:'permalink_url'] end if attributes.key?(:'preheader') self.preheader = attributes[:'preheader'] end if attributes.key?(:'physical_address_in_footer') self. = attributes[:'physical_address_in_footer'] end if attributes.key?(:'document_properties') self.document_properties = attributes[:'document_properties'] end end |
Instance Attribute Details
#campaign_activity_id ⇒ Object
Identifies a campaign activity in the V3 API.
19 20 21 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 19 def campaign_activity_id @campaign_activity_id end |
#campaign_id ⇒ Object
Identifies a campaign in the V3 API.
22 23 24 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 22 def campaign_id @campaign_id end |
#contact_list_ids ⇒ Object
The contacts that Constant Contact sends the email campaign activity to as an array of contact list_id
values. You cannot use contact lists and segments at the same time in an email campaign activity.
28 29 30 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 28 def contact_list_ids @contact_list_ids end |
#current_status ⇒ Object
The current status of the email campaign activity. Valid values are: <ul> <li>DRAFT — An email campaign activity that you have created but have not sent to contacts.</li> <li>SCHEDULED — An email campaign activity that you have scheduled for Constant Contact to send to contacts.</li> <li>EXECUTING — An email campaign activity Constant Contact is currently sending to contacts. Email campaign activities are only in this status briefly.</li> <li>DONE — An email campaign activity that you successfully sent to contacts.</li> <li>ERROR — An email campaign activity that encountered an error.</li> <li>REMOVED — An email campaign that a user deleted. Users can view and restore deleted emails through the UI.</li> </ul>
34 35 36 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 34 def current_status @current_status end |
#document_properties ⇒ Object
Returns the value of attribute document_properties.
65 66 67 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 65 def document_properties @document_properties end |
#format_type ⇒ Object
Identifies the type of email format. Valid values are: <ul> <li>1 - A legacy custom code email created using the V2 API, the V3 API, or the legacy UI HTML editor.</li> <li>2 - An email created using the second generation email editor UI.</li> <li>3 - An email created using the third generation email editor UI. This email editor features an improved drag and drop UI and mobile responsiveness.</li> <li>4 - An email created using the fourth generation email editor UI.</li> <li>5 - A custom code email created using the V3 API or the new UI HTML editor.</li> </ul>
37 38 39 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 37 def format_type @format_type end |
#from_email ⇒ Object
The email "From Email" field for the email campaign activity. You must use a confirmed Constant Contact account email address. Make a GET call to /account/emails
to return a collection of account emails and their confirmation status.
40 41 42 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 40 def from_email @from_email end |
#from_name ⇒ Object
The email "From Name" field for the email campaign activity.
43 44 45 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 43 def from_name @from_name end |
#html_content ⇒ Object
The HTML or XHTML content for the email campaign activity. Only format_type
1 and 5 (legacy custom code emails or modern custom code emails) can contain html_content
.
52 53 54 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 52 def html_content @html_content end |
#permalink_url ⇒ Object
The permanent link to a web accessible version of the email campaign content without any personalized email information. The permalink URL becomes accessible after you send an email campaign to contacts.
58 59 60 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 58 def permalink_url @permalink_url end |
#physical_address_in_footer ⇒ Object
Returns the value of attribute physical_address_in_footer.
63 64 65 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 63 def @physical_address_in_footer end |
#preheader ⇒ Object
The email preheader for the email campaign activity. Only format_type
3, 4, and 5 email campaign activities use the preheader property.
61 62 63 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 61 def preheader @preheader end |
#reply_to_email ⇒ Object
The email "Reply To Email" field for the email campaign activity. You must use a confirmed Constant Contact account email address. Make a GET call to /account/emails
to return a collection of account emails and their confirmation status.
46 47 48 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 46 def reply_to_email @reply_to_email end |
#role ⇒ Object
The purpose of the individual campaign activity in the larger email campaign effort. Valid values are: <ul> <li>primary_email — The main email marketing campaign that you send to contacts. The primary_email
contains the complete email content.</li> <li>permalink — A permanent link to a web accessible version of the primary_email
content without any personalized email information. For example, permalinks do not contain any of the contact details that you add to the primary_email
email content. </li> <li>resend — An email campaign that you resend to contacts that did not open the email campaign.</li> </ul> Constant Contact creates a primary_email
and a permalink
role campaign activity when you create an email campaign.
25 26 27 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 25 def role @role end |
#segment_ids ⇒ Object
The contacts that Constant Contact sends the email campaign activity to as an array containing a single segment_id
value. Only format_type
3, 4, and 5 email campaign activities support segments. You cannot use contact lists and segments at the same time in an email campaign activity.
31 32 33 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 31 def segment_ids @segment_ids end |
#subject ⇒ Object
The email "Subject" field for the email campaign activity.
49 50 51 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 49 def subject @subject end |
#template_id ⇒ Object
Identifies the email layout and design template that the email campaign activity is using as a base.
55 56 57 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 55 def template_id @template_id end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 318 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = ConstantContactClient.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
91 92 93 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 91 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 68 def self.attribute_map { :'campaign_activity_id' => :'campaign_activity_id', :'campaign_id' => :'campaign_id', :'role' => :'role', :'contact_list_ids' => :'contact_list_ids', :'segment_ids' => :'segment_ids', :'current_status' => :'current_status', :'format_type' => :'format_type', :'from_email' => :'from_email', :'from_name' => :'from_name', :'reply_to_email' => :'reply_to_email', :'subject' => :'subject', :'html_content' => :'html_content', :'template_id' => :'template_id', :'permalink_url' => :'permalink_url', :'preheader' => :'preheader', :'physical_address_in_footer' => :'physical_address_in_footer', :'document_properties' => :'document_properties' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 294 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
119 120 121 122 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 119 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 96 def self.openapi_types { :'campaign_activity_id' => :'String', :'campaign_id' => :'String', :'role' => :'String', :'contact_list_ids' => :'Array<String>', :'segment_ids' => :'Array<Integer>', :'current_status' => :'String', :'format_type' => :'Integer', :'from_email' => :'String', :'from_name' => :'String', :'reply_to_email' => :'String', :'subject' => :'String', :'html_content' => :'String', :'template_id' => :'String', :'permalink_url' => :'String', :'preheader' => :'String', :'physical_address_in_footer' => :'GetEmailCampaignActivity200ResponsePhysicalAddressInFooter', :'document_properties' => :'GetEmailCampaignActivity200ResponseDocumentProperties' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 257 def ==(o) return true if self.equal?(o) self.class == o.class && campaign_activity_id == o.campaign_activity_id && campaign_id == o.campaign_id && role == o.role && contact_list_ids == o.contact_list_ids && segment_ids == o.segment_ids && current_status == o.current_status && format_type == o.format_type && from_email == o.from_email && from_name == o.from_name && reply_to_email == o.reply_to_email && subject == o.subject && html_content == o.html_content && template_id == o.template_id && permalink_url == o.permalink_url && preheader == o.preheader && == o. && document_properties == o.document_properties end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 389 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
281 282 283 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 281 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
287 288 289 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 287 def hash [campaign_activity_id, campaign_id, role, contact_list_ids, segment_ids, current_status, format_type, from_email, from_name, reply_to_email, subject, html_content, template_id, permalink_url, preheader, , document_properties].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 222 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @from_email.nil? invalid_properties.push('invalid value for "from_email", from_email cannot be nil.') end if @from_name.nil? invalid_properties.push('invalid value for "from_name", from_name cannot be nil.') end if @reply_to_email.nil? invalid_properties.push('invalid value for "reply_to_email", reply_to_email cannot be nil.') end if @subject.nil? invalid_properties.push('invalid value for "subject", subject cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
365 366 367 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 365 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 371 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 |
#to_s ⇒ String
Returns the string representation of the object
359 360 361 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 359 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
246 247 248 249 250 251 252 253 |
# File 'lib/constant_contact_client/models/get_email_campaign_activity200_response.rb', line 246 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @from_email.nil? return false if @from_name.nil? return false if @reply_to_email.nil? return false if @subject.nil? true end |