Class: EcfDgii::Generated::UpsertCompanyRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- EcfDgii::Generated::UpsertCompanyRequest
- Defined in:
- lib/ecf_dgii/generated/models/upsert_company_request.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#certification_declared ⇒ Object
Returns the value of attribute certification_declared.
-
#certification_status ⇒ Object
Returns the value of attribute certification_status.
-
#employee_count ⇒ Object
Returns the value of attribute employee_count.
-
#estimated_invoices ⇒ Object
Returns the value of attribute estimated_invoices.
-
#legal_rep_first_name ⇒ Object
Returns the value of attribute legal_rep_first_name.
-
#legal_rep_last_name ⇒ Object
Returns the value of attribute legal_rep_last_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rnc ⇒ Object
Returns the value of attribute rnc.
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 = {}) ⇒ UpsertCompanyRequest
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 = {}) ⇒ UpsertCompanyRequest
Initializes the object
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 91 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `EcfDgii::Generated::UpsertCompanyRequest` 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 `EcfDgii::Generated::UpsertCompanyRequest`. 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?(:'rnc') self.rnc = attributes[:'rnc'] else self.rnc = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'employee_count') self.employee_count = attributes[:'employee_count'] end if attributes.key?(:'estimated_invoices') self.estimated_invoices = attributes[:'estimated_invoices'] end if attributes.key?(:'legal_rep_first_name') self.legal_rep_first_name = attributes[:'legal_rep_first_name'] end if attributes.key?(:'legal_rep_last_name') self.legal_rep_last_name = attributes[:'legal_rep_last_name'] end if attributes.key?(:'address') self.address = attributes[:'address'] end if attributes.key?(:'certification_declared') self.certification_declared = attributes[:'certification_declared'] end if attributes.key?(:'certification_status') self.certification_status = attributes[:'certification_status'] end end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
30 31 32 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 30 def address @address end |
#certification_declared ⇒ Object
Returns the value of attribute certification_declared.
32 33 34 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 32 def certification_declared @certification_declared end |
#certification_status ⇒ Object
Returns the value of attribute certification_status.
34 35 36 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 34 def certification_status @certification_status end |
#employee_count ⇒ Object
Returns the value of attribute employee_count.
22 23 24 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 22 def employee_count @employee_count end |
#estimated_invoices ⇒ Object
Returns the value of attribute estimated_invoices.
24 25 26 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 24 def estimated_invoices @estimated_invoices end |
#legal_rep_first_name ⇒ Object
Returns the value of attribute legal_rep_first_name.
26 27 28 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 26 def legal_rep_first_name @legal_rep_first_name end |
#legal_rep_last_name ⇒ Object
Returns the value of attribute legal_rep_last_name.
28 29 30 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 28 def legal_rep_last_name @legal_rep_last_name end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 20 def name @name end |
#rnc ⇒ Object
Returns the value of attribute rnc.
18 19 20 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 18 def rnc @rnc end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
52 53 54 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 52 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
57 58 59 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 57 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 37 def self.attribute_map { :'rnc' => :'rnc', :'name' => :'name', :'employee_count' => :'employeeCount', :'estimated_invoices' => :'estimatedInvoices', :'legal_rep_first_name' => :'legalRepFirstName', :'legal_rep_last_name' => :'legalRepLastName', :'address' => :'address', :'certification_declared' => :'certificationDeclared', :'certification_status' => :'certificationStatus' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 330 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
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 77 def self.openapi_nullable Set.new([ :'employee_count', :'estimated_invoices', :'legal_rep_first_name', :'legal_rep_last_name', :'address', :'certification_declared', :'certification_status' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 62 def self.openapi_types { :'rnc' => :'String', :'name' => :'String', :'employee_count' => :'String', :'estimated_invoices' => :'String', :'legal_rep_first_name' => :'String', :'legal_rep_last_name' => :'String', :'address' => :'String', :'certification_declared' => :'Boolean', :'certification_status' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 301 def ==(o) return true if self.equal?(o) self.class == o.class && rnc == o.rnc && name == o.name && employee_count == o.employee_count && estimated_invoices == o.estimated_invoices && legal_rep_first_name == o.legal_rep_first_name && legal_rep_last_name == o.legal_rep_last_name && address == o.address && certification_declared == o.certification_declared && certification_status == o.certification_status end |
#eql?(o) ⇒ Boolean
317 318 319 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 317 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
323 324 325 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 323 def hash [rnc, name, employee_count, estimated_invoices, legal_rep_first_name, legal_rep_last_name, address, certification_declared, certification_status].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 148 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @rnc.nil? invalid_properties.push('invalid value for "rnc", rnc cannot be nil.') end if @rnc.to_s.length > 11 invalid_properties.push('invalid value for "rnc", the character length must be smaller than or equal to 11.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @name.to_s.length > 2000 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 2000.') end if !@employee_count.nil? && @employee_count.to_s.length > 20 invalid_properties.push('invalid value for "employee_count", the character length must be smaller than or equal to 20.') end if !@estimated_invoices.nil? && @estimated_invoices.to_s.length > 20 invalid_properties.push('invalid value for "estimated_invoices", the character length must be smaller than or equal to 20.') end if !@legal_rep_first_name.nil? && @legal_rep_first_name.to_s.length > 200 invalid_properties.push('invalid value for "legal_rep_first_name", the character length must be smaller than or equal to 200.') end if !@legal_rep_last_name.nil? && @legal_rep_last_name.to_s.length > 200 invalid_properties.push('invalid value for "legal_rep_last_name", the character length must be smaller than or equal to 200.') end if !@address.nil? && @address.to_s.length > 500 invalid_properties.push('invalid value for "address", the character length must be smaller than or equal to 500.') end if !@certification_status.nil? && @certification_status.to_s.length > 50 invalid_properties.push('invalid value for "certification_status", the character length must be smaller than or equal to 50.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 352 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
196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/ecf_dgii/generated/models/upsert_company_request.rb', line 196 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @rnc.nil? return false if @rnc.to_s.length > 11 return false if @name.nil? return false if @name.to_s.length > 2000 return false if !@employee_count.nil? && @employee_count.to_s.length > 20 return false if !@estimated_invoices.nil? && @estimated_invoices.to_s.length > 20 return false if !@legal_rep_first_name.nil? && @legal_rep_first_name.to_s.length > 200 return false if !@legal_rep_last_name.nil? && @legal_rep_last_name.to_s.length > 200 return false if !@address.nil? && @address.to_s.length > 500 return false if !@certification_status.nil? && @certification_status.to_s.length > 50 true end |