Class: Xolphin::Api::CertificateRequests::CreateCertificateRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/xolphin/api/certificate_requests/create_certificate_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product, years, csr, dcv_type) ⇒ CreateCertificateRequest

Returns a new instance of CreateCertificateRequest.



11
12
13
14
15
16
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 11

def initialize(product, years, csr, dcv_type)
  @product = product
  @years = years
  @csr = csr
  @dcv_type = dcv_type
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def address
  @address
end

#approver_emailObject

Returns the value of attribute approver_email.



9
10
11
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 9

def approver_email
  @approver_email
end

#approver_first_nameObject

Returns the value of attribute approver_first_name.



9
10
11
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 9

def approver_first_name
  @approver_first_name
end

#approver_last_nameObject

Returns the value of attribute approver_last_name.



9
10
11
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 9

def approver_last_name
  @approver_last_name
end

#approver_phoneObject

Returns the value of attribute approver_phone.



9
10
11
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 9

def approver_phone
  @approver_phone
end

#cityObject

Returns the value of attribute city.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def city
  @city
end

#companyObject

Returns the value of attribute company.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def company
  @company
end

#csrObject

Returns the value of attribute csr.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def csr
  @csr
end

#dcvObject

Returns the value of attribute dcv.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def dcv
  @dcv
end

#dcv_typeObject

Returns the value of attribute dcv_type.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def dcv_type
  @dcv_type
end

#departmentObject

Returns the value of attribute department.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def department
  @department
end

#kvkObject

Returns the value of attribute kvk.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def kvk
  @kvk
end

#languageObject

Returns the value of attribute language.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def language
  @language
end

#productObject

Returns the value of attribute product.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def product
  @product
end

#referenceObject

Returns the value of attribute reference.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def reference
  @reference
end

#subject_alternative_namesObject

Returns the value of attribute subject_alternative_names.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def subject_alternative_names
  @subject_alternative_names
end

#yearsObject

Returns the value of attribute years.



7
8
9
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 7

def years
  @years
end

#zipcodeObject

Returns the value of attribute zipcode.



8
9
10
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 8

def zipcode
  @zipcode
end

Instance Method Details

#to_paramObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/xolphin/api/certificate_requests/create_certificate_request.rb', line 18

def to_param
  result = {
    "product" => @product,
    "years" => @years,
    "csr" => @csr,
    "dcvType" => @dcv_type
  }

  result.merge!({
    "company" => @company,
    "department" => @department,
    "address" => @address,
    "zipcode" => @zipcode,
    "city" => @city,
    "kvk" => @kvk,
    "reference" => @reference,
    "approverFirstName" => @approver_first_name,
    "approverLastName" => @approver_last_name,
    "approverEmail" => @approver_email,
    "approverPhone" => @approver_phone,
    "language" => @language
  }.reject { |_key, value| value.nil? })

  if @subject_alternative_names
    result["subjectAlternativeNames"] = @subject_alternative_names.join(",")
  end

  result["dcv"] = JSON.dump(@dcv) if @dcv

  result
end