Class: Conekta::CompanyResponse
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Conekta::CompanyResponse
- Defined in:
- lib/conekta/models/company_response.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_status ⇒ Object
The current status of the company's account.
-
#active ⇒ Object
Indicates if the company is active.
-
#created_at ⇒ Object
Timestamp of when the company was created.
-
#documents ⇒ Object
A list of documents related to the company.
-
#id ⇒ Object
The unique identifier for the company.
-
#name ⇒ Object
The name of the company.
-
#object ⇒ Object
The type of object, typically "company".
-
#onboarding_status ⇒ Object
The current status of the company's onboarding process.
-
#parent_company_id ⇒ Object
The identifier of the parent company, if any.
-
#three_ds_enabled ⇒ Object
Indicates if 3DS authentication is enabled for the company.
-
#three_ds_mode ⇒ Object
The 3DS mode for the company, either 'smart' or 'strict'.
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 = {}) ⇒ CompanyResponse
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 = {}) ⇒ CompanyResponse
Initializes the object
125 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 |
# File 'lib/conekta/models/company_response.rb', line 125 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Conekta::CompanyResponse` 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 `Conekta::CompanyResponse`. 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?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'active') self.active = attributes[:'active'] else self.active = nil end if attributes.key?(:'account_status') self.account_status = attributes[:'account_status'] else self.account_status = nil end if attributes.key?(:'parent_company_id') self.parent_company_id = attributes[:'parent_company_id'] end if attributes.key?(:'onboarding_status') self.onboarding_status = attributes[:'onboarding_status'] else self.onboarding_status = nil end if attributes.key?(:'documents') if (value = attributes[:'documents']).is_a?(Array) self.documents = value end else self.documents = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] else self.created_at = nil end if attributes.key?(:'object') self.object = attributes[:'object'] else self.object = nil end if attributes.key?(:'three_ds_enabled') self.three_ds_enabled = attributes[:'three_ds_enabled'] end if attributes.key?(:'three_ds_mode') self.three_ds_mode = attributes[:'three_ds_mode'] end end |
Instance Attribute Details
#account_status ⇒ Object
The current status of the company's account.
28 29 30 |
# File 'lib/conekta/models/company_response.rb', line 28 def account_status @account_status end |
#active ⇒ Object
Indicates if the company is active.
25 26 27 |
# File 'lib/conekta/models/company_response.rb', line 25 def active @active end |
#created_at ⇒ Object
Timestamp of when the company was created.
40 41 42 |
# File 'lib/conekta/models/company_response.rb', line 40 def created_at @created_at end |
#documents ⇒ Object
A list of documents related to the company.
37 38 39 |
# File 'lib/conekta/models/company_response.rb', line 37 def documents @documents end |
#id ⇒ Object
The unique identifier for the company.
19 20 21 |
# File 'lib/conekta/models/company_response.rb', line 19 def id @id end |
#name ⇒ Object
The name of the company.
22 23 24 |
# File 'lib/conekta/models/company_response.rb', line 22 def name @name end |
#object ⇒ Object
The type of object, typically "company".
43 44 45 |
# File 'lib/conekta/models/company_response.rb', line 43 def object @object end |
#onboarding_status ⇒ Object
The current status of the company's onboarding process.
34 35 36 |
# File 'lib/conekta/models/company_response.rb', line 34 def onboarding_status @onboarding_status end |
#parent_company_id ⇒ Object
The identifier of the parent company, if any.
31 32 33 |
# File 'lib/conekta/models/company_response.rb', line 31 def parent_company_id @parent_company_id end |
#three_ds_enabled ⇒ Object
Indicates if 3DS authentication is enabled for the company.
46 47 48 |
# File 'lib/conekta/models/company_response.rb', line 46 def three_ds_enabled @three_ds_enabled end |
#three_ds_mode ⇒ Object
The 3DS mode for the company, either 'smart' or 'strict'. This property is only applicable when three_ds_enabled is true. When three_ds_enabled is false, this field will be null.
49 50 51 |
# File 'lib/conekta/models/company_response.rb', line 49 def three_ds_mode @three_ds_mode end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
91 92 93 |
# File 'lib/conekta/models/company_response.rb', line 91 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
96 97 98 |
# File 'lib/conekta/models/company_response.rb', line 96 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/conekta/models/company_response.rb', line 74 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'active' => :'active', :'account_status' => :'account_status', :'parent_company_id' => :'parent_company_id', :'onboarding_status' => :'onboarding_status', :'documents' => :'documents', :'created_at' => :'created_at', :'object' => :'object', :'three_ds_enabled' => :'three_ds_enabled', :'three_ds_mode' => :'three_ds_mode' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/conekta/models/company_response.rb', line 382 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
118 119 120 121 |
# File 'lib/conekta/models/company_response.rb', line 118 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/conekta/models/company_response.rb', line 101 def self.openapi_types { :'id' => :'String', :'name' => :'String', :'active' => :'Boolean', :'account_status' => :'String', :'parent_company_id' => :'String', :'onboarding_status' => :'String', :'documents' => :'Array<CompanyDocumentResponse>', :'created_at' => :'Integer', :'object' => :'String', :'three_ds_enabled' => :'Boolean', :'three_ds_mode' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/conekta/models/company_response.rb', line 351 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && active == o.active && account_status == o.account_status && parent_company_id == o.parent_company_id && onboarding_status == o.onboarding_status && documents == o.documents && created_at == o.created_at && object == o.object && three_ds_enabled == o.three_ds_enabled && three_ds_mode == o.three_ds_mode end |
#eql?(o) ⇒ Boolean
369 370 371 |
# File 'lib/conekta/models/company_response.rb', line 369 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
375 376 377 |
# File 'lib/conekta/models/company_response.rb', line 375 def hash [id, name, active, account_status, parent_company_id, onboarding_status, documents, created_at, object, three_ds_enabled, three_ds_mode].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/conekta/models/company_response.rb', line 204 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @active.nil? invalid_properties.push('invalid value for "active", active cannot be nil.') end if @account_status.nil? invalid_properties.push('invalid value for "account_status", account_status cannot be nil.') end if @onboarding_status.nil? invalid_properties.push('invalid value for "onboarding_status", onboarding_status cannot be nil.') end if @documents.nil? invalid_properties.push('invalid value for "documents", documents cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end if @object.nil? invalid_properties.push('invalid value for "object", object cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/conekta/models/company_response.rb', line 404 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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/conekta/models/company_response.rb', line 244 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @name.nil? return false if @active.nil? return false if @account_status.nil? return false if @onboarding_status.nil? return false if @documents.nil? return false if @created_at.nil? return false if @object.nil? three_ds_mode_validator = EnumAttributeValidator.new('String', ["smart", "strict"]) return false unless three_ds_mode_validator.valid?(@three_ds_mode) true end |