Class: ShellDataReportingApIs::InvoiceManagementV1Summary403ErrorException

Inherits:
APIException
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb

Overview

Invoice Management V1 Summary 403 Error class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ InvoiceManagementV1Summary403ErrorException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpResponse)

    HttpReponse of the API call.



30
31
32
33
34
# File 'lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb', line 30

def initialize(reason, response)
  super(reason, response)
  hash = APIHelper.json_deserialize(@response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#errorsArray[ErrorDetails]

Indicates overall status of the request. Allowed values: SUCCES, FAILED, PARTIAL_SUCCESS

Returns:



25
26
27
# File 'lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb', line 25

def errors
  @errors
end

#request_idString

Unique request identifier passed from end user. This identifier helps in tracing a transaction

Returns:

  • (String)


15
16
17
# File 'lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb', line 15

def request_id
  @request_id
end

#statusString

Indicates overall status of the request. Allowed values: SUCCES, FAILED, PARTIAL_SUCCESS

Returns:

  • (String)


20
21
22
# File 'lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb', line 20

def status
  @status
end

Instance Method Details

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • The (Hash)

    deserialized response sent by the server in the



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/shell_data_reporting_ap_is/exceptions/invoice_management_v1_summary403_error_exception.rb', line 39

def unbox(hash)
  @request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
  @status = hash.key?('Status') ? hash['Status'] : SKIP
  # Parameter is an array, so we need to iterate through it
  @errors = nil
  unless hash['Errors'].nil?
    @errors = []
    hash['Errors'].each do |structure|
      @errors << (ErrorDetails.from_hash(structure) if structure)
    end
  end

  @errors = SKIP unless hash.key?('Errors')
end