Class: Unit::Application::CreateIndividualApplicationRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/application/create_individual_application_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ssn, full_name, date_of_birth, address, email, phone, ip = nil, ein = nil, industry = nil, dba = nil, sole_proprietorship = nil, passport = nil, nationality = nil, device_fingerprints = nil, idempotency_key = nil, tags = nil, jwt_subject = nil, power_of_attorney_agent = nil, evaluation_params = nil) ⇒ CreateIndividualApplicationRequest

Returns a new instance of CreateIndividualApplicationRequest.

Parameters:

  • ssn (String)
  • full_name (FullName)
  • date_of_birth (Date)
  • address (Address)
  • email (String)
  • phone (Phone)
  • optional

    ip [String]

  • optional

    ein [String]

  • optional

    industry [String]

  • optional

    dba [String]

  • optional

    sole_proprietorship [Boolean]

  • optional

    passport [String]

  • optional

    nationality [String]

  • optional

    device_fingerprints [DeviceFingerprint]

  • optional

    idempotency_key [String]

  • optional

    tags [Hash]

  • optional

    jwt_subject [String]

  • optional

    power_of_attorney_agent [PowerOfAttorneyAgent]

  • optional

    evaluation_params [EvaluationParams]



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/unit/models/application/create_individual_application_request.rb', line 36

def initialize(ssn, full_name, date_of_birth, address, email, phone, ip = nil, ein = nil, industry = nil, dba = nil, sole_proprietorship = nil, passport = nil,
               nationality = nil, device_fingerprints = nil, idempotency_key = nil, tags = nil, jwt_subject = nil, power_of_attorney_agent = nil,
               evaluation_params = nil)
  @ssn = ssn
  @full_name = full_name
  @date_of_birth = date_of_birth
  @address = address
  @phone = phone
  @email = email
  @ip = ip
  @ein = ein
  @industry = industry
  @dba = dba
  @sole_proprietorship = sole_proprietorship
  @passport = passport
  @nationality = nationality
  @device_fingerprints = device_fingerprints
  @idempotency_key = idempotency_key
  @tags = tags
  @jwt_object = jwt_subject
  @power_of_attorney_agent = power_of_attorney_agent
  @evaluation_params = evaluation_params
  @type = "individualApplication"
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def address
  @address
end

#date_of_birthObject (readonly)

Returns the value of attribute date_of_birth.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def date_of_birth
  @date_of_birth
end

#dbaObject (readonly)

Returns the value of attribute dba.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def dba
  @dba
end

#device_fingerprintsObject (readonly)

Returns the value of attribute device_fingerprints.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def device_fingerprints
  @device_fingerprints
end

#einObject (readonly)

Returns the value of attribute ein.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def ein
  @ein
end

#emailObject (readonly)

Returns the value of attribute email.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def email
  @email
end

#evaluation_paramsObject (readonly)

Returns the value of attribute evaluation_params.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def evaluation_params
  @evaluation_params
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def full_name
  @full_name
end

#idempotency_keyObject (readonly)

Returns the value of attribute idempotency_key.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def idempotency_key
  @idempotency_key
end

#industryObject (readonly)

Returns the value of attribute industry.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def industry
  @industry
end

#ipObject (readonly)

Returns the value of attribute ip.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def ip
  @ip
end

#jwt_subjectObject (readonly)

Returns the value of attribute jwt_subject.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def jwt_subject
  @jwt_subject
end

#nationalityObject (readonly)

Returns the value of attribute nationality.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def nationality
  @nationality
end

#passportObject (readonly)

Returns the value of attribute passport.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def passport
  @passport
end

#phoneObject (readonly)

Returns the value of attribute phone.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def phone
  @phone
end

#power_of_attorney_agentObject (readonly)

Returns the value of attribute power_of_attorney_agent.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def power_of_attorney_agent
  @power_of_attorney_agent
end

#sole_proprietorshipObject (readonly)

Returns the value of attribute sole_proprietorship.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def sole_proprietorship
  @sole_proprietorship
end

#ssnObject (readonly)

Returns the value of attribute ssn.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def ssn
  @ssn
end

#tagsObject (readonly)

Returns the value of attribute tags.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def tags
  @tags
end

#typeObject (readonly)

Returns the value of attribute type.



13
14
15
# File 'lib/unit/models/application/create_individual_application_request.rb', line 13

def type
  @type
end

Instance Method Details

#to_json_apiObject



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
86
87
88
89
# File 'lib/unit/models/application/create_individual_application_request.rb', line 61

def to_json_api
  payload = {
    data: {
      type: type,
      attributes: {
        ssn: ssn,
        fullName: full_name.represent,
        dateOfBirth: date_of_birth,
        address: address.represent,
        email: email,
        phone: phone.represent,
        ip: ip,
        ein: ein,
        industry: industry,
        dba: dba,
        soleProprietorship: sole_proprietorship,
        passport: passport,
        nationality: nationality,
        idempotencyKey: idempotency_key,
        tags: tags,
        jwtSubject: jwt_subject,
        powerOfAttorneyAgent: power_of_attorney_agent&.represent,
        evaluationParams: evaluation_params&.represent
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end