Class: ConnectWise::EmailConnector
- Inherits:
-
Object
- Object
- ConnectWise::EmailConnector
- Defined in:
- lib/connect_wise/models/email_connector.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_info ⇒ Object
Returns the value of attribute _info.
-
#add_cc_flag ⇒ Object
Returns the value of attribute add_cc_flag.
-
#bcc_email_to ⇒ Object
Max length: 250;.
-
#create_contact_flag ⇒ Object
Returns the value of attribute create_contact_flag.
-
#default_company ⇒ Object
Returns the value of attribute default_company.
-
#default_member ⇒ Object
Returns the value of attribute default_member.
-
#department ⇒ Object
Returns the value of attribute department.
-
#discard_duplicates_flag ⇒ Object
Returns the value of attribute discard_duplicates_flag.
-
#email_errors_to ⇒ Object
Max length: 50;.
-
#email_notify_from ⇒ Object
Max length: 50;.
-
#email_server_type ⇒ Object
Returns the value of attribute email_server_type.
-
#google_email_setup ⇒ Object
Returns the value of attribute google_email_setup.
-
#id ⇒ Object
Returns the value of attribute id.
-
#imap_setup ⇒ Object
Returns the value of attribute imap_setup.
-
#item_override ⇒ Object
Returns the value of attribute item_override.
-
#location ⇒ Object
Returns the value of attribute location.
-
#never_respond_flag ⇒ Object
Returns the value of attribute never_respond_flag.
-
#no_response_flag ⇒ Object
Returns the value of attribute no_response_flag.
-
#office365_email_setup ⇒ Object
Returns the value of attribute office365_email_setup.
-
#post_replies_to_ticket_flag ⇒ Object
Returns the value of attribute post_replies_to_ticket_flag.
-
#priority_override ⇒ Object
Returns the value of attribute priority_override.
-
#response_email_for_existing ⇒ Object
Returns the value of attribute response_email_for_existing.
-
#response_email_for_new ⇒ Object
Returns the value of attribute response_email_for_new.
-
#service_board ⇒ Object
Returns the value of attribute service_board.
-
#set_email_to_default_contact_flag ⇒ Object
Returns the value of attribute set_email_to_default_contact_flag.
-
#source_override ⇒ Object
Returns the value of attribute source_override.
-
#status_override ⇒ Object
Returns the value of attribute status_override.
-
#sub_type_override ⇒ Object
Returns the value of attribute sub_type_override.
-
#type_override ⇒ Object
Returns the value of attribute type_override.
Class Method Summary collapse
-
.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
-
#==(other) ⇒ 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?(other) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ EmailConnector
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 = {}) ⇒ EmailConnector
Initializes the object
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 |
# File 'lib/connect_wise/models/email_connector.rb', line 139 def initialize(attributes = {}) raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::EmailConnector` initialize method' unless attributes.is_a?(Hash) # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| raise ArgumentError, "`#{k}` is not a valid attribute in `ConnectWise::EmailConnector`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym) h[k.to_sym] = v end self.email_errors_to = attributes[:email_errors_to] if attributes.key?(:email_errors_to) self.id = attributes[:id] if attributes.key?(:id) self.email_server_type = attributes[:email_server_type] if attributes.key?(:email_server_type) self.imap_setup = attributes[:imap_setup] if attributes.key?(:imap_setup) self.office365_email_setup = attributes[:office365_email_setup] if attributes.key?(:office365_email_setup) self.google_email_setup = attributes[:google_email_setup] if attributes.key?(:google_email_setup) self.service_board = attributes[:service_board] if attributes.key?(:service_board) self.default_company = attributes[:default_company] if attributes.key?(:default_company) self.default_member = attributes[:default_member] if attributes.key?(:default_member) self.location = attributes[:location] if attributes.key?(:location) self.department = attributes[:department] if attributes.key?(:department) self.email_notify_from = attributes[:email_notify_from] if attributes.key?(:email_notify_from) self.bcc_email_to = attributes[:bcc_email_to] if attributes.key?(:bcc_email_to) self.set_email_to_default_contact_flag = attributes[:set_email_to_default_contact_flag] if attributes.key?(:set_email_to_default_contact_flag) self.no_response_flag = attributes[:no_response_flag] if attributes.key?(:no_response_flag) self.never_respond_flag = attributes[:never_respond_flag] if attributes.key?(:never_respond_flag) self.discard_duplicates_flag = attributes[:discard_duplicates_flag] if attributes.key?(:discard_duplicates_flag) self.post_replies_to_ticket_flag = attributes[:post_replies_to_ticket_flag] if attributes.key?(:post_replies_to_ticket_flag) self.create_contact_flag = attributes[:create_contact_flag] if attributes.key?(:create_contact_flag) self.response_email_for_new = attributes[:response_email_for_new] if attributes.key?(:response_email_for_new) self.response_email_for_existing = attributes[:response_email_for_existing] if attributes.key?(:response_email_for_existing) self.source_override = attributes[:source_override] if attributes.key?(:source_override) self.priority_override = attributes[:priority_override] if attributes.key?(:priority_override) self.type_override = attributes[:type_override] if attributes.key?(:type_override) self.sub_type_override = attributes[:sub_type_override] if attributes.key?(:sub_type_override) self.item_override = attributes[:item_override] if attributes.key?(:item_override) self.status_override = attributes[:status_override] if attributes.key?(:status_override) self.add_cc_flag = attributes[:add_cc_flag] if attributes.key?(:add_cc_flag) return unless attributes.key?(:_info) return unless (value = attributes[:_info]).is_a?(Hash) self._info = value end |
Instance Attribute Details
#_info ⇒ Object
Returns the value of attribute _info.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def _info @_info end |
#add_cc_flag ⇒ Object
Returns the value of attribute add_cc_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def add_cc_flag @add_cc_flag end |
#bcc_email_to ⇒ Object
Max length: 250;
25 26 27 |
# File 'lib/connect_wise/models/email_connector.rb', line 25 def bcc_email_to @bcc_email_to end |
#create_contact_flag ⇒ Object
Returns the value of attribute create_contact_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def create_contact_flag @create_contact_flag end |
#default_company ⇒ Object
Returns the value of attribute default_company.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def default_company @default_company end |
#default_member ⇒ Object
Returns the value of attribute default_member.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def default_member @default_member end |
#department ⇒ Object
Returns the value of attribute department.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def department @department end |
#discard_duplicates_flag ⇒ Object
Returns the value of attribute discard_duplicates_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def discard_duplicates_flag @discard_duplicates_flag end |
#email_errors_to ⇒ Object
Max length: 50;
17 18 19 |
# File 'lib/connect_wise/models/email_connector.rb', line 17 def email_errors_to @email_errors_to end |
#email_notify_from ⇒ Object
Max length: 50;
22 23 24 |
# File 'lib/connect_wise/models/email_connector.rb', line 22 def email_notify_from @email_notify_from end |
#email_server_type ⇒ Object
Returns the value of attribute email_server_type.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def email_server_type @email_server_type end |
#google_email_setup ⇒ Object
Returns the value of attribute google_email_setup.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def google_email_setup @google_email_setup end |
#id ⇒ Object
Returns the value of attribute id.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def id @id end |
#imap_setup ⇒ Object
Returns the value of attribute imap_setup.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def imap_setup @imap_setup end |
#item_override ⇒ Object
Returns the value of attribute item_override.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def item_override @item_override end |
#location ⇒ Object
Returns the value of attribute location.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def location @location end |
#never_respond_flag ⇒ Object
Returns the value of attribute never_respond_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def never_respond_flag @never_respond_flag end |
#no_response_flag ⇒ Object
Returns the value of attribute no_response_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def no_response_flag @no_response_flag end |
#office365_email_setup ⇒ Object
Returns the value of attribute office365_email_setup.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def office365_email_setup @office365_email_setup end |
#post_replies_to_ticket_flag ⇒ Object
Returns the value of attribute post_replies_to_ticket_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def post_replies_to_ticket_flag @post_replies_to_ticket_flag end |
#priority_override ⇒ Object
Returns the value of attribute priority_override.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def priority_override @priority_override end |
#response_email_for_existing ⇒ Object
Returns the value of attribute response_email_for_existing.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def response_email_for_existing @response_email_for_existing end |
#response_email_for_new ⇒ Object
Returns the value of attribute response_email_for_new.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def response_email_for_new @response_email_for_new end |
#service_board ⇒ Object
Returns the value of attribute service_board.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def service_board @service_board end |
#set_email_to_default_contact_flag ⇒ Object
Returns the value of attribute set_email_to_default_contact_flag.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def set_email_to_default_contact_flag @set_email_to_default_contact_flag end |
#source_override ⇒ Object
Returns the value of attribute source_override.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def source_override @source_override end |
#status_override ⇒ Object
Returns the value of attribute status_override.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def status_override @status_override end |
#sub_type_override ⇒ Object
Returns the value of attribute sub_type_override.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def sub_type_override @sub_type_override end |
#type_override ⇒ Object
Returns the value of attribute type_override.
19 20 21 |
# File 'lib/connect_wise/models/email_connector.rb', line 19 def type_override @type_override end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
84 85 86 |
# File 'lib/connect_wise/models/email_connector.rb', line 84 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/connect_wise/models/email_connector.rb', line 49 def self.attribute_map { email_errors_to: :emailErrorsTo, id: :id, email_server_type: :emailServerType, imap_setup: :imapSetup, office365_email_setup: :office365EmailSetup, google_email_setup: :googleEmailSetup, service_board: :serviceBoard, default_company: :defaultCompany, default_member: :defaultMember, location: :location, department: :department, email_notify_from: :emailNotifyFrom, bcc_email_to: :bccEmailTo, set_email_to_default_contact_flag: :setEmailToDefaultContactFlag, no_response_flag: :noResponseFlag, never_respond_flag: :neverRespondFlag, discard_duplicates_flag: :discardDuplicatesFlag, post_replies_to_ticket_flag: :postRepliesToTicketFlag, create_contact_flag: :createContactFlag, response_email_for_new: :responseEmailForNew, response_email_for_existing: :responseEmailForExisting, source_override: :sourceOverride, priority_override: :priorityOverride, type_override: :typeOverride, sub_type_override: :subTypeOverride, item_override: :itemOverride, status_override: :statusOverride, add_cc_flag: :addCcFlag, _info: :_info } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
292 293 294 |
# File 'lib/connect_wise/models/email_connector.rb', line 292 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/connect_wise/models/email_connector.rb', line 124 def self.openapi_nullable Set.new(i[ email_server_type set_email_to_default_contact_flag no_response_flag never_respond_flag discard_duplicates_flag post_replies_to_ticket_flag create_contact_flag add_cc_flag ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/connect_wise/models/email_connector.rb', line 89 def self.openapi_types { email_errors_to: :String, id: :Integer, email_server_type: :String, imap_setup: :ImapSetupReference, office365_email_setup: :Office365EmailSetupReference, google_email_setup: :GoogleEmailSetupReference, service_board: :BoardReference, default_company: :CompanyReference, default_member: :MemberReference, location: :SystemLocationReference, department: :SystemDepartmentReference, email_notify_from: :String, bcc_email_to: :String, set_email_to_default_contact_flag: :Boolean, no_response_flag: :Boolean, never_respond_flag: :Boolean, discard_duplicates_flag: :Boolean, post_replies_to_ticket_flag: :Boolean, create_contact_flag: :Boolean, response_email_for_new: :String, response_email_for_existing: :String, source_override: :ServiceSourceReference, priority_override: :PriorityReference, type_override: :ServiceTypeReference, sub_type_override: :ServiceSubTypeReference, item_override: :ServiceItemReference, status_override: :ServiceStatusReference, add_cc_flag: :Boolean, _info: :'Hash<String, String>' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/connect_wise/models/email_connector.rb', line 242 def ==(other) return true if equal?(other) self.class == other.class && email_errors_to == other.email_errors_to && id == other.id && email_server_type == other.email_server_type && imap_setup == other.imap_setup && office365_email_setup == other.office365_email_setup && google_email_setup == other.google_email_setup && service_board == other.service_board && default_company == other.default_company && default_member == other.default_member && location == other.location && department == other.department && email_notify_from == other.email_notify_from && bcc_email_to == other.bcc_email_to && set_email_to_default_contact_flag == other.set_email_to_default_contact_flag && no_response_flag == other.no_response_flag && never_respond_flag == other.never_respond_flag && discard_duplicates_flag == other.discard_duplicates_flag && post_replies_to_ticket_flag == other.post_replies_to_ticket_flag && create_contact_flag == other.create_contact_flag && response_email_for_new == other.response_email_for_new && response_email_for_existing == other.response_email_for_existing && source_override == other.source_override && priority_override == other.priority_override && type_override == other.type_override && sub_type_override == other.sub_type_override && item_override == other.item_override && status_override == other.status_override && add_cc_flag == other.add_cc_flag && _info == other._info end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 356 357 358 359 |
# File 'lib/connect_wise/models/email_connector.rb', line 322 def _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 = ConnectWise.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/connect_wise/models/email_connector.rb', line 393 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
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/connect_wise/models/email_connector.rb', line 299 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) send("#{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 send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array) elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(other) ⇒ Boolean
279 280 281 |
# File 'lib/connect_wise/models/email_connector.rb', line 279 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
285 286 287 |
# File 'lib/connect_wise/models/email_connector.rb', line 285 def hash [email_errors_to, id, email_server_type, imap_setup, office365_email_setup, google_email_setup, service_board, default_company, default_member, location, department, email_notify_from, bcc_email_to, set_email_to_default_contact_flag, no_response_flag, never_respond_flag, discard_duplicates_flag, post_replies_to_ticket_flag, create_contact_flag, response_email_for_new, response_email_for_existing, source_override, priority_override, type_override, sub_type_override, item_override, status_override, add_cc_flag, _info].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
213 214 215 216 217 218 |
# File 'lib/connect_wise/models/email_connector.rb', line 213 def list_invalid_properties invalid_properties = [] invalid_properties.push('invalid value for "email_errors_to", email_errors_to cannot be nil.') if @email_errors_to.nil? invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
369 370 371 |
# File 'lib/connect_wise/models/email_connector.rb', line 369 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/connect_wise/models/email_connector.rb', line 375 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = 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
363 364 365 |
# File 'lib/connect_wise/models/email_connector.rb', line 363 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
222 223 224 225 226 227 228 229 |
# File 'lib/connect_wise/models/email_connector.rb', line 222 def valid? return false if @email_errors_to.nil? email_server_type_validator = EnumAttributeValidator.new('String', %w[IMAP Office365 Google]) return false unless email_server_type_validator.valid?(@email_server_type) true end |