Class: Unit::Application::CreateBusinessApplicationRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, address, phone, state_of_incorporation, ein, contact, officer, beneficial_owners, entity_type, industry = nil, dba = nil, ip = nil, website = nil, tags = nil, idempotency_key = nil, device_fingerprints = nil, annual_revenue = nil, number_of_employees = nil, cash_flow = nil, year_of_incorporation = nil, countries_of_operation = nil, stock_symbol = nil, business_vertical = nil) ⇒ CreateBusinessApplicationRequest

Returns a new instance of CreateBusinessApplicationRequest.

Parameters:

  • name (String)
  • address (Address)
  • phone (Phone)
  • state_of_incorporation (String)
  • ein (String)
  • contact (BusinessContact)
  • officer (Officer)
  • beneficial_owners (Array)
  • entity_type (String)
  • industry (String) (defaults to: nil)
    • optional

  • dba (String) (defaults to: nil)
    • optional

  • ip (String) (defaults to: nil)
    • optional

  • website (String) (defaults to: nil)
    • optional

  • tags (Hash) (defaults to: nil)
    • optional

  • idempotency_key (String) (defaults to: nil)
    • optional

  • device_fingerprints (DeviceFingerprint) (defaults to: nil)
    • optional

  • annual_revenue (String) (defaults to: nil)
    • optional

  • number_of_employees (String) (defaults to: nil)
    • optional

  • cash_flow (String) (defaults to: nil)
    • optional

  • year_of_incorporation (String) (defaults to: nil)
    • optional

  • countries_of_operation (Array<String>) (defaults to: nil)
    • optional

  • stock_symbol (String) (defaults to: nil)
    • optional

  • business_vertical (String) (defaults to: nil)
    • optional



36
37
38
39
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
# File 'lib/unit/models/application/create_business_application_request.rb', line 36

def initialize(name, address, phone, state_of_incorporation, ein, contact, officer,
               beneficial_owners, entity_type, industry = nil, dba = nil, ip = nil, website = nil, tags = nil, idempotency_key = nil,
               device_fingerprints = nil, annual_revenue = nil, number_of_employees = nil,
               cash_flow = nil, year_of_incorporation = nil, countries_of_operation = nil,
               stock_symbol = nil, business_vertical = nil)
  @name = name
  @address = address
  @phone = phone
  @state_of_incorporation = state_of_incorporation
  @ein = ein
  @industry = industry
  @contact = contact
  @officer = officer
  @beneficial_owners = beneficial_owners.map(&:represent)
  @entity_type = entity_type
  @dba = dba
  @ip = ip
  @website = website
  @tags = tags
  @idempotency_key = idempotency_key
  @device_fingerprints = device_fingerprints
  @annual_revenue = annual_revenue
  @number_of_employees = number_of_employees
  @cash_flow = cash_flow
  @year_of_incorporation = year_of_incorporation
  @countries_of_operation = countries_of_operation
  @stock_symbol = stock_symbol
  @business_vertical = business_vertical
  @type = "businessApplication"
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def address
  @address
end

#annual_revenueObject (readonly)

Returns the value of attribute annual_revenue.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def annual_revenue
  @annual_revenue
end

#beneficial_ownersObject (readonly)

Returns the value of attribute beneficial_owners.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def beneficial_owners
  @beneficial_owners
end

#business_verticalObject (readonly)

Returns the value of attribute business_vertical.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def business_vertical
  @business_vertical
end

#cash_flowObject (readonly)

Returns the value of attribute cash_flow.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def cash_flow
  @cash_flow
end

#contactObject (readonly)

Returns the value of attribute contact.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def contact
  @contact
end

#countries_of_operationObject (readonly)

Returns the value of attribute countries_of_operation.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def countries_of_operation
  @countries_of_operation
end

#dbaObject (readonly)

Returns the value of attribute dba.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def dba
  @dba
end

#device_fingerprintsObject (readonly)

Returns the value of attribute device_fingerprints.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def device_fingerprints
  @device_fingerprints
end

#einObject (readonly)

Returns the value of attribute ein.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def ein
  @ein
end

#entity_typeObject (readonly)

Returns the value of attribute entity_type.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def entity_type
  @entity_type
end

#idempotency_keyObject (readonly)

Returns the value of attribute idempotency_key.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def idempotency_key
  @idempotency_key
end

#industryObject (readonly)

Returns the value of attribute industry.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def industry
  @industry
end

#ipObject (readonly)

Returns the value of attribute ip.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def ip
  @ip
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def name
  @name
end

#number_of_employeesObject (readonly)

Returns the value of attribute number_of_employees.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def number_of_employees
  @number_of_employees
end

#officerObject (readonly)

Returns the value of attribute officer.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def officer
  @officer
end

#phoneObject (readonly)

Returns the value of attribute phone.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def phone
  @phone
end

#state_of_incorporationObject (readonly)

Returns the value of attribute state_of_incorporation.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def state_of_incorporation
  @state_of_incorporation
end

#stock_symbolObject (readonly)

Returns the value of attribute stock_symbol.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def stock_symbol
  @stock_symbol
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def tags
  @tags
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def type
  @type
end

#websiteObject (readonly)

Returns the value of attribute website.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def website
  @website
end

#year_of_incorporationObject (readonly)

Returns the value of attribute year_of_incorporation.



8
9
10
# File 'lib/unit/models/application/create_business_application_request.rb', line 8

def year_of_incorporation
  @year_of_incorporation
end

Instance Method Details

#to_json_apiObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/unit/models/application/create_business_application_request.rb', line 67

def to_json_api
  payload = {
    data: {
      type: type,
      attributes: {
        name: name,
        address: address.represent,
        phone: phone.represent,
        stateOfIncorporation: state_of_incorporation,
        ein: ein,
        industry: industry,
        contact: contact.represent,
        officer: officer.represent,
        beneficialOwners: beneficial_owners,
        entityType: entity_type,
        dba: dba,
        ip: ip,
        website: website,
        tags: tags,
        idempotencyKey: idempotency_key,
        deviceFingerprints: device_fingerprints,
        annualRevenue: annual_revenue,
        numberOfEmployees: number_of_employees,
        cashFlow: cash_flow,
        yearOfIncorporation: year_of_incorporation,
        countriesOfOperation: countries_of_operation&.join(","),
        stockSymbol: stock_symbol,
        businessVertical: business_vertical
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end