Class: ConnectWise::CompanyMerge
- Inherits:
-
Object
- Object
- ConnectWise::CompanyMerge
- Defined in:
- lib/connect_wise/models/company_merge.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#activities ⇒ Object
Returns the value of attribute activities.
-
#billing_address ⇒ Object
Returns the value of attribute billing_address.
-
#billing_contact ⇒ Object
Returns the value of attribute billing_contact.
-
#billing_terms ⇒ Object
Returns the value of attribute billing_terms.
-
#contacts ⇒ Object
Returns the value of attribute contacts.
-
#date_acquired ⇒ Object
Returns the value of attribute date_acquired.
-
#documents ⇒ Object
Returns the value of attribute documents.
-
#fax ⇒ Object
Returns the value of attribute fax.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#market ⇒ Object
Returns the value of attribute market.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#number_of_employees ⇒ Object
Returns the value of attribute number_of_employees.
-
#opportunities ⇒ Object
Returns the value of attribute opportunities.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#primary_address ⇒ Object
Returns the value of attribute primary_address.
-
#primary_contact ⇒ Object
Returns the value of attribute primary_contact.
-
#projects ⇒ Object
Returns the value of attribute projects.
-
#revenue ⇒ Object
Returns the value of attribute revenue.
-
#revenue_year ⇒ Object
Returns the value of attribute revenue_year.
-
#services ⇒ Object
Returns the value of attribute services.
-
#sic_code ⇒ Object
Returns the value of attribute sic_code.
-
#sites ⇒ Object
Returns the value of attribute sites.
-
#source_list ⇒ Object
Returns the value of attribute source_list.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tax_code ⇒ Object
Returns the value of attribute tax_code.
-
#territory ⇒ Object
Returns the value of attribute territory.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#to_company_id ⇒ Object
Returns the value of attribute to_company_id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#user_defined_field1 ⇒ Object
Returns the value of attribute user_defined_field1.
-
#user_defined_field10 ⇒ Object
Returns the value of attribute user_defined_field10.
-
#user_defined_field2 ⇒ Object
Returns the value of attribute user_defined_field2.
-
#user_defined_field3 ⇒ Object
Returns the value of attribute user_defined_field3.
-
#user_defined_field4 ⇒ Object
Returns the value of attribute user_defined_field4.
-
#user_defined_field5 ⇒ Object
Returns the value of attribute user_defined_field5.
-
#user_defined_field6 ⇒ Object
Returns the value of attribute user_defined_field6.
-
#user_defined_field7 ⇒ Object
Returns the value of attribute user_defined_field7.
-
#user_defined_field8 ⇒ Object
Returns the value of attribute user_defined_field8.
-
#user_defined_field9 ⇒ Object
Returns the value of attribute user_defined_field9.
-
#website ⇒ Object
Returns the value of attribute website.
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 = {}) ⇒ CompanyMerge
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 = {}) ⇒ CompanyMerge
Initializes the object
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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 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 276 277 278 279 280 281 282 283 284 |
# File 'lib/connect_wise/models/company_merge.rb', line 189 def initialize(attributes = {}) raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::CompanyMerge` 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::CompanyMerge`. 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.to_company_id = attributes[:to_company_id] if attributes.key?(:to_company_id) self.name = attributes[:name] if attributes.key?(:name) self.identifier = attributes[:identifier] if attributes.key?(:identifier) self.status = attributes[:status] if attributes.key?(:status) self.type = attributes[:type] if attributes.key?(:type) self.primary_address = attributes[:primary_address] if attributes.key?(:primary_address) self.primary_contact = attributes[:primary_contact] if attributes.key?(:primary_contact) self.phone = attributes[:phone] if attributes.key?(:phone) self.fax = attributes[:fax] if attributes.key?(:fax) self.website = attributes[:website] if attributes.key?(:website) self.market = attributes[:market] if attributes.key?(:market) self.territory = attributes[:territory] if attributes.key?(:territory) self.revenue = attributes[:revenue] if attributes.key?(:revenue) self.revenue_year = attributes[:revenue_year] if attributes.key?(:revenue_year) self.number_of_employees = attributes[:number_of_employees] if attributes.key?(:number_of_employees) self.sic_code = attributes[:sic_code] if attributes.key?(:sic_code) self.date_acquired = attributes[:date_acquired] if attributes.key?(:date_acquired) self.time_zone = attributes[:time_zone] if attributes.key?(:time_zone) self.source_list = attributes[:source_list] if attributes.key?(:source_list) self.user_defined_field1 = attributes[:user_defined_field1] if attributes.key?(:user_defined_field1) self.user_defined_field2 = attributes[:user_defined_field2] if attributes.key?(:user_defined_field2) self.user_defined_field3 = attributes[:user_defined_field3] if attributes.key?(:user_defined_field3) self.user_defined_field4 = attributes[:user_defined_field4] if attributes.key?(:user_defined_field4) self.user_defined_field5 = attributes[:user_defined_field5] if attributes.key?(:user_defined_field5) self.user_defined_field6 = attributes[:user_defined_field6] if attributes.key?(:user_defined_field6) self.user_defined_field7 = attributes[:user_defined_field7] if attributes.key?(:user_defined_field7) self.user_defined_field8 = attributes[:user_defined_field8] if attributes.key?(:user_defined_field8) self.user_defined_field9 = attributes[:user_defined_field9] if attributes.key?(:user_defined_field9) self.user_defined_field10 = attributes[:user_defined_field10] if attributes.key?(:user_defined_field10) self.billing_address = attributes[:billing_address] if attributes.key?(:billing_address) self.billing_contact = attributes[:billing_contact] if attributes.key?(:billing_contact) self.tax_code = attributes[:tax_code] if attributes.key?(:tax_code) self.account_number = attributes[:account_number] if attributes.key?(:account_number) self.billing_terms = attributes[:billing_terms] if attributes.key?(:billing_terms) self.notes = attributes[:notes] if attributes.key?(:notes) self.sites = attributes[:sites] if attributes.key?(:sites) self.activities = attributes[:activities] if attributes.key?(:activities) self.opportunities = attributes[:opportunities] if attributes.key?(:opportunities) self.services = attributes[:services] if attributes.key?(:services) self.projects = attributes[:projects] if attributes.key?(:projects) self.contacts = attributes[:contacts] if attributes.key?(:contacts) return unless attributes.key?(:documents) self.documents = attributes[:documents] end |
Instance Attribute Details
#account_number ⇒ Object
Returns the value of attribute account_number.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def account_number @account_number end |
#activities ⇒ Object
Returns the value of attribute activities.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def activities @activities end |
#billing_address ⇒ Object
Returns the value of attribute billing_address.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def billing_address @billing_address end |
#billing_contact ⇒ Object
Returns the value of attribute billing_contact.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def billing_contact @billing_contact end |
#billing_terms ⇒ Object
Returns the value of attribute billing_terms.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def billing_terms @billing_terms end |
#contacts ⇒ Object
Returns the value of attribute contacts.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def contacts @contacts end |
#date_acquired ⇒ Object
Returns the value of attribute date_acquired.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def date_acquired @date_acquired end |
#documents ⇒ Object
Returns the value of attribute documents.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def documents @documents end |
#fax ⇒ Object
Returns the value of attribute fax.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def fax @fax end |
#identifier ⇒ Object
Returns the value of attribute identifier.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def identifier @identifier end |
#market ⇒ Object
Returns the value of attribute market.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def market @market end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def name @name end |
#notes ⇒ Object
Returns the value of attribute notes.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def notes @notes end |
#number_of_employees ⇒ Object
Returns the value of attribute number_of_employees.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def number_of_employees @number_of_employees end |
#opportunities ⇒ Object
Returns the value of attribute opportunities.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def opportunities @opportunities end |
#phone ⇒ Object
Returns the value of attribute phone.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def phone @phone end |
#primary_address ⇒ Object
Returns the value of attribute primary_address.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def primary_address @primary_address end |
#primary_contact ⇒ Object
Returns the value of attribute primary_contact.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def primary_contact @primary_contact end |
#projects ⇒ Object
Returns the value of attribute projects.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def projects @projects end |
#revenue ⇒ Object
Returns the value of attribute revenue.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def revenue @revenue end |
#revenue_year ⇒ Object
Returns the value of attribute revenue_year.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def revenue_year @revenue_year end |
#services ⇒ Object
Returns the value of attribute services.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def services @services end |
#sic_code ⇒ Object
Returns the value of attribute sic_code.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def sic_code @sic_code end |
#sites ⇒ Object
Returns the value of attribute sites.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def sites @sites end |
#source_list ⇒ Object
Returns the value of attribute source_list.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def source_list @source_list end |
#status ⇒ Object
Returns the value of attribute status.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def status @status end |
#tax_code ⇒ Object
Returns the value of attribute tax_code.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def tax_code @tax_code end |
#territory ⇒ Object
Returns the value of attribute territory.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def territory @territory end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def time_zone @time_zone end |
#to_company_id ⇒ Object
Returns the value of attribute to_company_id.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def to_company_id @to_company_id end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def type @type end |
#user_defined_field1 ⇒ Object
Returns the value of attribute user_defined_field1.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field1 @user_defined_field1 end |
#user_defined_field10 ⇒ Object
Returns the value of attribute user_defined_field10.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field10 @user_defined_field10 end |
#user_defined_field2 ⇒ Object
Returns the value of attribute user_defined_field2.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field2 @user_defined_field2 end |
#user_defined_field3 ⇒ Object
Returns the value of attribute user_defined_field3.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field3 @user_defined_field3 end |
#user_defined_field4 ⇒ Object
Returns the value of attribute user_defined_field4.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field4 @user_defined_field4 end |
#user_defined_field5 ⇒ Object
Returns the value of attribute user_defined_field5.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field5 @user_defined_field5 end |
#user_defined_field6 ⇒ Object
Returns the value of attribute user_defined_field6.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field6 @user_defined_field6 end |
#user_defined_field7 ⇒ Object
Returns the value of attribute user_defined_field7.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field7 @user_defined_field7 end |
#user_defined_field8 ⇒ Object
Returns the value of attribute user_defined_field8.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field8 @user_defined_field8 end |
#user_defined_field9 ⇒ Object
Returns the value of attribute user_defined_field9.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def user_defined_field9 @user_defined_field9 end |
#website ⇒ Object
Returns the value of attribute website.
16 17 18 |
# File 'lib/connect_wise/models/company_merge.rb', line 16 def website @website end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
88 89 90 |
# File 'lib/connect_wise/models/company_merge.rb', line 88 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
40 41 42 43 44 45 46 47 48 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 82 83 84 85 |
# File 'lib/connect_wise/models/company_merge.rb', line 40 def self.attribute_map { to_company_id: :toCompanyId, name: :name, identifier: :identifier, status: :status, type: :type, primary_address: :primaryAddress, primary_contact: :primaryContact, phone: :phone, fax: :fax, website: :website, market: :market, territory: :territory, revenue: :revenue, revenue_year: :revenueYear, number_of_employees: :numberOfEmployees, sic_code: :sicCode, date_acquired: :dateAcquired, time_zone: :timeZone, source_list: :sourceList, user_defined_field1: :userDefinedField1, user_defined_field2: :userDefinedField2, user_defined_field3: :userDefinedField3, user_defined_field4: :userDefinedField4, user_defined_field5: :userDefinedField5, user_defined_field6: :userDefinedField6, user_defined_field7: :userDefinedField7, user_defined_field8: :userDefinedField8, user_defined_field9: :userDefinedField9, user_defined_field10: :userDefinedField10, billing_address: :billingAddress, billing_contact: :billingContact, tax_code: :taxCode, account_number: :accountNumber, billing_terms: :billingTerms, notes: :notes, sites: :sites, activities: :activities, opportunities: :opportunities, services: :services, projects: :projects, contacts: :contacts, documents: :documents } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
860 861 862 |
# File 'lib/connect_wise/models/company_merge.rb', line 860 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
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 |
# File 'lib/connect_wise/models/company_merge.rb', line 141 def self.openapi_nullable Set.new(i[ name identifier status type primary_address primary_contact phone fax website market territory revenue revenue_year number_of_employees sic_code date_acquired time_zone source_list user_defined_field1 user_defined_field2 user_defined_field3 user_defined_field4 user_defined_field5 user_defined_field6 user_defined_field7 user_defined_field8 user_defined_field9 user_defined_field10 billing_address billing_contact tax_code account_number billing_terms notes sites activities opportunities services projects contacts documents ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/connect_wise/models/company_merge.rb', line 93 def self.openapi_types { to_company_id: :Integer, name: :String, identifier: :String, status: :String, type: :String, primary_address: :String, primary_contact: :String, phone: :String, fax: :String, website: :String, market: :String, territory: :String, revenue: :String, revenue_year: :String, number_of_employees: :String, sic_code: :String, date_acquired: :String, time_zone: :String, source_list: :String, user_defined_field1: :String, user_defined_field2: :String, user_defined_field3: :String, user_defined_field4: :String, user_defined_field5: :String, user_defined_field6: :String, user_defined_field7: :String, user_defined_field8: :String, user_defined_field9: :String, user_defined_field10: :String, billing_address: :String, billing_contact: :String, tax_code: :String, account_number: :String, billing_terms: :String, notes: :String, sites: :String, activities: :String, opportunities: :String, services: :String, projects: :String, contacts: :String, documents: :String } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 |
# File 'lib/connect_wise/models/company_merge.rb', line 797 def ==(other) return true if equal?(other) self.class == other.class && to_company_id == other.to_company_id && name == other.name && identifier == other.identifier && status == other.status && type == other.type && primary_address == other.primary_address && primary_contact == other.primary_contact && phone == other.phone && fax == other.fax && website == other.website && market == other.market && territory == other.territory && revenue == other.revenue && revenue_year == other.revenue_year && number_of_employees == other.number_of_employees && sic_code == other.sic_code && date_acquired == other.date_acquired && time_zone == other.time_zone && source_list == other.source_list && user_defined_field1 == other.user_defined_field1 && user_defined_field2 == other.user_defined_field2 && user_defined_field3 == other.user_defined_field3 && user_defined_field4 == other.user_defined_field4 && user_defined_field5 == other.user_defined_field5 && user_defined_field6 == other.user_defined_field6 && user_defined_field7 == other.user_defined_field7 && user_defined_field8 == other.user_defined_field8 && user_defined_field9 == other.user_defined_field9 && user_defined_field10 == other.user_defined_field10 && billing_address == other.billing_address && billing_contact == other.billing_contact && tax_code == other.tax_code && account_number == other.account_number && billing_terms == other.billing_terms && notes == other.notes && sites == other.sites && activities == other.activities && opportunities == other.opportunities && services == other.services && projects == other.projects && contacts == other.contacts && documents == other.documents end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 |
# File 'lib/connect_wise/models/company_merge.rb', line 890 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
961 962 963 964 965 966 967 968 969 970 971 972 973 |
# File 'lib/connect_wise/models/company_merge.rb', line 961 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
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 |
# File 'lib/connect_wise/models/company_merge.rb', line 867 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
847 848 849 |
# File 'lib/connect_wise/models/company_merge.rb', line 847 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
853 854 855 |
# File 'lib/connect_wise/models/company_merge.rb', line 853 def hash [to_company_id, name, identifier, status, type, primary_address, primary_contact, phone, fax, website, market, territory, revenue, revenue_year, number_of_employees, sic_code, date_acquired, time_zone, source_list, user_defined_field1, user_defined_field2, user_defined_field3, user_defined_field4, user_defined_field5, user_defined_field6, user_defined_field7, user_defined_field8, user_defined_field9, user_defined_field10, billing_address, billing_contact, tax_code, account_number, billing_terms, notes, sites, activities, opportunities, services, projects, contacts, documents].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
288 289 290 291 292 293 |
# File 'lib/connect_wise/models/company_merge.rb', line 288 def list_invalid_properties invalid_properties = [] invalid_properties.push('invalid value for "to_company_id", to_company_id cannot be nil.') if @to_company_id.nil? invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
937 938 939 |
# File 'lib/connect_wise/models/company_merge.rb', line 937 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
943 944 945 946 947 948 949 950 951 952 953 954 955 |
# File 'lib/connect_wise/models/company_merge.rb', line 943 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
931 932 933 |
# File 'lib/connect_wise/models/company_merge.rb', line 931 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 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 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/connect_wise/models/company_merge.rb', line 297 def valid? return false if @to_company_id.nil? name_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless name_validator.valid?(@name) identifier_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless identifier_validator.valid?(@identifier) status_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless status_validator.valid?(@status) type_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless type_validator.valid?(@type) primary_address_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless primary_address_validator.valid?(@primary_address) primary_contact_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless primary_contact_validator.valid?(@primary_contact) phone_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless phone_validator.valid?(@phone) fax_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless fax_validator.valid?(@fax) website_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless website_validator.valid?(@website) market_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless market_validator.valid?(@market) territory_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless territory_validator.valid?(@territory) revenue_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless revenue_validator.valid?(@revenue) revenue_year_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless revenue_year_validator.valid?(@revenue_year) number_of_employees_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless number_of_employees_validator.valid?(@number_of_employees) sic_code_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless sic_code_validator.valid?(@sic_code) date_acquired_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless date_acquired_validator.valid?(@date_acquired) time_zone_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless time_zone_validator.valid?(@time_zone) source_list_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless source_list_validator.valid?(@source_list) user_defined_field1_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field1_validator.valid?(@user_defined_field1) user_defined_field2_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field2_validator.valid?(@user_defined_field2) user_defined_field3_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field3_validator.valid?(@user_defined_field3) user_defined_field4_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field4_validator.valid?(@user_defined_field4) user_defined_field5_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field5_validator.valid?(@user_defined_field5) user_defined_field6_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field6_validator.valid?(@user_defined_field6) user_defined_field7_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field7_validator.valid?(@user_defined_field7) user_defined_field8_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field8_validator.valid?(@user_defined_field8) user_defined_field9_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field9_validator.valid?(@user_defined_field9) user_defined_field10_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless user_defined_field10_validator.valid?(@user_defined_field10) billing_address_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless billing_address_validator.valid?(@billing_address) billing_contact_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless billing_contact_validator.valid?(@billing_contact) tax_code_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless tax_code_validator.valid?(@tax_code) account_number_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless account_number_validator.valid?(@account_number) billing_terms_validator = EnumAttributeValidator.new('String', %w[From To]) return false unless billing_terms_validator.valid?(@billing_terms) notes_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless notes_validator.valid?(@notes) sites_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless sites_validator.valid?(@sites) activities_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless activities_validator.valid?(@activities) opportunities_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless opportunities_validator.valid?(@opportunities) services_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless services_validator.valid?(@services) projects_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless projects_validator.valid?(@projects) contacts_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless contacts_validator.valid?(@contacts) documents_validator = EnumAttributeValidator.new('String', %w[Discard Merge]) return false unless documents_validator.valid?(@documents) true end |