Class: TrinsicApi::MexicoCurpProviderOutput

Inherits:
ApiModelBase show all
Defined in:
lib/trinsic_api/models/mexico_curp_provider_output.rb

Overview

Exposed properties for the mexico-curp-lookup Provider which do not directly map to the normalized IdentityData model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ MexicoCurpProviderOutput

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



121
122
123
124
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
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 121

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::MexicoCurpProviderOutput` 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 `TrinsicApi::MexicoCurpProviderOutput`. 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?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.key?(:'father_last_name')
    self.father_last_name = attributes[:'father_last_name']
  end

  if attributes.key?(:'mother_last_name')
    self.mother_last_name = attributes[:'mother_last_name']
  end

  if attributes.key?(:'gender')
    self.gender = attributes[:'gender']
  end

  if attributes.key?(:'date_of_birth')
    self.date_of_birth = attributes[:'date_of_birth']
  end

  if attributes.key?(:'country_of_birth')
    self.country_of_birth = attributes[:'country_of_birth']
  end

  if attributes.key?(:'state_of_birth')
    self.state_of_birth = attributes[:'state_of_birth']
  end

  if attributes.key?(:'curp')
    self.curp = attributes[:'curp']
  end

  if attributes.key?(:'curp_status')
    self.curp_status = attributes[:'curp_status']
  end

  if attributes.key?(:'registration_year')
    self.registration_year = attributes[:'registration_year']
  end

  if attributes.key?(:'registration_state')
    self.registration_state = attributes[:'registration_state']
  end

  if attributes.key?(:'act_number')
    self.act_number = attributes[:'act_number']
  end
end

Instance Attribute Details

#act_numberObject

The ACT (Número de Acta) number of the individual. The Act number is a civil registry index number. Various state have various formats of specifying these.



53
54
55
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 53

def act_number
  @act_number
end

#country_of_birthObject

The country of birth of the individual.



35
36
37
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 35

def country_of_birth
  @country_of_birth
end

#curpObject

The CURP (Clave Única de Registro de Población) that was verified. A CURP code is a unique identifier assigned to individuals in Mexico. It is 18 alphanumeric characters, with a structured meaning: ABCD YYMMDD G SS XYZ M C The first 4 letters (ABCD): A: The first letter of the paternal last name. B: First internal vowel of paternal last name. C: First letter of maternal last name. D: First letter of first name. YYMMDD: 2-digit year, month, day. G: Gender, H for Hombre (male) and M for Mujer (female). SS: State code (2 letters), e.g. NL for Nuevo León. X: First internal consonant of paternal last name. Y: First internal consonant of maternal last name. Z: First internal consonant of given name. M: Millennium indicator (0-9 for pre-2000 birth date, A-Z for post-2000's birth dates. C: Checksum character



41
42
43
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 41

def curp
  @curp
end

#curp_statusObject

Curp status for the subject. Possible values: - AN: Alta Normal (Normal registration) - Active - AH: Alta con Homonimia (Registration with homonymy) - Active - RCC: Registro de cambio afectando a CURP (Change affecting CURP) - Active - RCN: Registro de cambio no afectando a CURP (Change not affecting CURP) - Active - BAP: Baja por documento apócrifo (Low due to apocryphal document) - Inactive - BSU: Baja sin uso (Low curp without use) - Inactive - BD: Baja por defunción (Low curp due to death) - Inactive - BDM: Baja administrativa (Low, due to administrative process) - Inactive - BDP: Baja por adopción (Low, due to adoption) - Inactive - BJD: Baja Judicial (Low for judicial reasons) - Inactive



44
45
46
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 44

def curp_status
  @curp_status
end

#date_of_birthObject

The date of birth of the individual.



32
33
34
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 32

def date_of_birth
  @date_of_birth
end

#father_last_nameObject

The last name of the father of the individual.



23
24
25
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 23

def father_last_name
  @father_last_name
end

#first_nameObject

First name of the individual.



20
21
22
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 20

def first_name
  @first_name
end

#genderObject

The gender of the individual. List of possible values: - Male - Female



29
30
31
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 29

def gender
  @gender
end

#mother_last_nameObject

The last name of the mother of the individual.



26
27
28
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 26

def mother_last_name
  @mother_last_name
end

#registration_stateObject

The state the CURP number was registered in.



50
51
52
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 50

def registration_state
  @registration_state
end

#registration_yearObject

The year the CURP number was registered in.



47
48
49
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 47

def registration_year
  @registration_year
end

#state_of_birthObject

The state of birth of the individual.



38
39
40
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 38

def state_of_birth
  @state_of_birth
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



74
75
76
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 74

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



79
80
81
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 79

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 56

def self.attribute_map
  {
    :'first_name' => :'firstName',
    :'father_last_name' => :'fatherLastName',
    :'mother_last_name' => :'motherLastName',
    :'gender' => :'gender',
    :'date_of_birth' => :'dateOfBirth',
    :'country_of_birth' => :'countryOfBirth',
    :'state_of_birth' => :'stateOfBirth',
    :'curp' => :'curp',
    :'curp_status' => :'curpStatus',
    :'registration_year' => :'registrationYear',
    :'registration_state' => :'registrationState',
    :'act_number' => :'actNumber'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 233

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_nullableObject

List of attributes with nullable: true



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 102

def self.openapi_nullable
  Set.new([
    :'first_name',
    :'father_last_name',
    :'mother_last_name',
    :'gender',
    :'date_of_birth',
    :'country_of_birth',
    :'state_of_birth',
    :'curp',
    :'curp_status',
    :'registration_year',
    :'registration_state',
    :'act_number'
  ])
end

.openapi_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 84

def self.openapi_types
  {
    :'first_name' => :'String',
    :'father_last_name' => :'String',
    :'mother_last_name' => :'String',
    :'gender' => :'String',
    :'date_of_birth' => :'Date',
    :'country_of_birth' => :'String',
    :'state_of_birth' => :'String',
    :'curp' => :'String',
    :'curp_status' => :'String',
    :'registration_year' => :'Integer',
    :'registration_state' => :'String',
    :'act_number' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 201

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      first_name == o.first_name &&
      father_last_name == o.father_last_name &&
      mother_last_name == o.mother_last_name &&
      gender == o.gender &&
      date_of_birth == o.date_of_birth &&
      country_of_birth == o.country_of_birth &&
      state_of_birth == o.state_of_birth &&
      curp == o.curp &&
      curp_status == o.curp_status &&
      registration_year == o.registration_year &&
      registration_state == o.registration_state &&
      act_number == o.act_number
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


220
221
222
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 220

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



226
227
228
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 226

def hash
  [first_name, father_last_name, mother_last_name, gender, date_of_birth, country_of_birth, state_of_birth, curp, curp_status, registration_year, registration_state, act_number].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



186
187
188
189
190
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 186

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 255

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

Returns:

  • (Boolean)

    true if the model is valid



194
195
196
197
# File 'lib/trinsic_api/models/mexico_curp_provider_output.rb', line 194

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end