Class: Brevo::RequestContactExport
- Inherits:
-
Object
- Object
- Brevo::RequestContactExport
- Defined in:
- lib/brevo/models/request_contact_export.rb
Instance Attribute Summary collapse
-
#custom_contact_filter ⇒ Object
Returns the value of attribute custom_contact_filter.
-
#disable_notification ⇒ Object
To avoid generating the email notification upon contact export, pass true.
-
#export_attributes ⇒ Object
List of all the attributes that you want to export.
-
#export_mandatory_attributes ⇒ Object
To export mandatory attributes like EMAIL, ADDED_TIME, MODIFIED_TIME.
-
#export_metadata ⇒ Object
Export metadata of contacts such as _listIds, ADDED_TIME, MODIFIED_TIME.
-
#export_subscription_status ⇒ Object
Export subscription status of contacts for email & sms marketting.
-
#notify_url ⇒ Object
Webhook that will be called once the export process is finished.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ RequestContactExport
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 = {}) ⇒ RequestContactExport
Initializes the object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/brevo/models/request_contact_export.rb', line 65 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'exportAttributes') if (value = attributes[:'exportAttributes']).is_a?(Array) self.export_attributes = value end end if attributes.has_key?(:'customContactFilter') self.custom_contact_filter = attributes[:'customContactFilter'] end if attributes.has_key?(:'notifyUrl') self.notify_url = attributes[:'notifyUrl'] end if attributes.has_key?(:'disableNotification') self.disable_notification = attributes[:'disableNotification'] else self.disable_notification = false end if attributes.has_key?(:'exportMandatoryAttributes') self.export_mandatory_attributes = attributes[:'exportMandatoryAttributes'] else self.export_mandatory_attributes = true end if attributes.has_key?(:'exportSubscriptionStatus') if (value = attributes[:'exportSubscriptionStatus']).is_a?(Array) self.export_subscription_status = value end end if attributes.has_key?(:'exportMetadata') if (value = attributes[:'exportMetadata']).is_a?(Array) self. = value end end end |
Instance Attribute Details
#custom_contact_filter ⇒ Object
Returns the value of attribute custom_contact_filter.
20 21 22 |
# File 'lib/brevo/models/request_contact_export.rb', line 20 def custom_contact_filter @custom_contact_filter end |
#disable_notification ⇒ Object
To avoid generating the email notification upon contact export, pass true
26 27 28 |
# File 'lib/brevo/models/request_contact_export.rb', line 26 def disable_notification @disable_notification end |
#export_attributes ⇒ Object
List of all the attributes that you want to export. These attributes must be present in your contact database. It is required if exportMandatoryAttributes is set false. For example, [‘fname’, ‘lname’, ‘email’].
18 19 20 |
# File 'lib/brevo/models/request_contact_export.rb', line 18 def export_attributes @export_attributes end |
#export_mandatory_attributes ⇒ Object
To export mandatory attributes like EMAIL, ADDED_TIME, MODIFIED_TIME
29 30 31 |
# File 'lib/brevo/models/request_contact_export.rb', line 29 def export_mandatory_attributes @export_mandatory_attributes end |
#export_metadata ⇒ Object
Export metadata of contacts such as _listIds, ADDED_TIME, MODIFIED_TIME.
35 36 37 |
# File 'lib/brevo/models/request_contact_export.rb', line 35 def end |
#export_subscription_status ⇒ Object
Export subscription status of contacts for email & sms marketting. Pass email_marketing to obtain the marketing email subscription status & sms_marketing to retrieve the marketing SMS status of the contact.
32 33 34 |
# File 'lib/brevo/models/request_contact_export.rb', line 32 def export_subscription_status @export_subscription_status end |
#notify_url ⇒ Object
Webhook that will be called once the export process is finished. For reference, help.brevo.com/hc/en-us/articles/360007666479
23 24 25 |
# File 'lib/brevo/models/request_contact_export.rb', line 23 def notify_url @notify_url end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/brevo/models/request_contact_export.rb', line 38 def self.attribute_map { :'export_attributes' => :'exportAttributes', :'custom_contact_filter' => :'customContactFilter', :'notify_url' => :'notifyUrl', :'disable_notification' => :'disableNotification', :'export_mandatory_attributes' => :'exportMandatoryAttributes', :'export_subscription_status' => :'exportSubscriptionStatus', :'export_metadata' => :'exportMetadata' } end |
.swagger_types ⇒ Object
Attribute type mapping.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/brevo/models/request_contact_export.rb', line 51 def self.swagger_types { :'export_attributes' => :'Array<String>', :'custom_contact_filter' => :'RequestContactExportCustomContactFilter', :'notify_url' => :'String', :'disable_notification' => :'BOOLEAN', :'export_mandatory_attributes' => :'BOOLEAN', :'export_subscription_status' => :'Array<String>', :'export_metadata' => :'Array<String>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/brevo/models/request_contact_export.rb', line 130 def ==(o) return true if self.equal?(o) self.class == o.class && export_attributes == o.export_attributes && custom_contact_filter == o.custom_contact_filter && notify_url == o.notify_url && disable_notification == o.disable_notification && export_mandatory_attributes == o.export_mandatory_attributes && export_subscription_status == o.export_subscription_status && == o. end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/brevo/models/request_contact_export.rb', line 178 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 temp_model = Brevo.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/brevo/models/request_contact_export.rb', line 244 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/brevo/models/request_contact_export.rb', line 157 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if 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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
144 145 146 |
# File 'lib/brevo/models/request_contact_export.rb', line 144 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
150 151 152 |
# File 'lib/brevo/models/request_contact_export.rb', line 150 def hash [export_attributes, custom_contact_filter, notify_url, disable_notification, export_mandatory_attributes, export_subscription_status, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
112 113 114 115 116 117 118 119 |
# File 'lib/brevo/models/request_contact_export.rb', line 112 def list_invalid_properties invalid_properties = Array.new if @custom_contact_filter.nil? invalid_properties.push('invalid value for "custom_contact_filter", custom_contact_filter cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
224 225 226 |
# File 'lib/brevo/models/request_contact_export.rb', line 224 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
230 231 232 233 234 235 236 237 238 |
# File 'lib/brevo/models/request_contact_export.rb', line 230 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
218 219 220 |
# File 'lib/brevo/models/request_contact_export.rb', line 218 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
123 124 125 126 |
# File 'lib/brevo/models/request_contact_export.rb', line 123 def valid? return false if @custom_contact_filter.nil? true end |