Mercedes.VehicleManagement.API

<back to all web services

GetDataProcessRequest

Requires Authentication
The following routes are available for this service:
GET/v1/GetDataProcess/{ProcessId}
# frozen_string_literal: true
# encoding: utf-8


require 'json'
require 'servicestack'


class DataProcessJob
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :id
    # @return [String]
    attr_accessor :gas_id
    # @return [String]
    attr_accessor :date_created
    # @return [Integer]
    attr_accessor :processed_records
    # @return [Integer]
    attr_accessor :status
    # @return [String]
    attr_accessor :status_name
    # @return [String]
    attr_accessor :file_name

    def self.properties
        {
            id: { name: 'id' },
            gas_id: { name: 'gasId' },
            date_created: { name: 'dateCreated' },
            processed_records: { name: 'processedRecords' },
            status: { name: 'status' },
            status_name: { name: 'statusName' },
            file_name: { name: 'fileName' },
        }
    end

end

class DataProcessLog
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :id
    # @return [Integer]
    attr_accessor :data_process__id
    # @return [Integer]
    attr_accessor :row_number
    # @return [Integer]
    attr_accessor :failure_reason_id
    # @return [String]
    attr_accessor :failure_reason
    # @return [String]
    attr_accessor :meta_data
    # @return [String]
    attr_accessor :meta_data2
    # @return [TrueClass]
    attr_accessor :has_failed

    def self.properties
        {
            id: { name: 'id' },
            data_process__id: { name: 'dataProcess_Id' },
            row_number: { name: 'rowNumber' },
            failure_reason_id: { name: 'failureReasonId' },
            failure_reason: { name: 'failureReason' },
            meta_data: { name: 'metaData' },
            meta_data2: { name: 'metaData2' },
            has_failed: { name: 'hasFailed' },
        }
    end

end

class CurrentDataProcessResponse < DataProcessJob
    # @return [Integer]
    attr_accessor :type
    # @return [Integer]
    attr_accessor :total_records
    # @return [String]
    attr_accessor :original_file_name
    # @return [String]
    attr_accessor :date_started
    # @return [String]
    attr_accessor :date_finished
    # @return [List]
    attr_accessor :data_process_result_logs
    # @return [Integer]
    attr_accessor :failed_count
    # @return [Integer]
    attr_accessor :success_count

    def self.properties
        {
            type: { name: 'type' },
            total_records: { name: 'totalRecords' },
            original_file_name: { name: 'originalFileName' },
            date_started: { name: 'dateStarted' },
            date_finished: { name: 'dateFinished' },
            data_process_result_logs: { name: 'dataProcessResultLogs', type: [DataProcessLog] },
            failed_count: { name: 'failedCount' },
            success_count: { name: 'successCount' },
        }
    end

end

class GetDataProcessRequest
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :process_id

    def self.properties
        {
            process_id: { name: 'processId' },
        }
    end

    def response_type() = CurrentDataProcessResponse
    def get_type_name() = 'GetDataProcessRequest'
end

Ruby GetDataProcessRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/GetDataProcess/{ProcessId} HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"type":0,"totalRecords":0,"originalFileName":"String","dateStarted":"String","dateFinished":"String","dataProcessResultLogs":[{"id":0,"dataProcess_Id":0,"rowNumber":0,"failureReasonId":0,"failureReason":"String","metaData":"String","metaData2":"String","hasFailed":false}],"failedCount":0,"successCount":0,"id":0,"gasId":"String","dateCreated":"String","processedRecords":0,"status":0,"statusName":"String","fileName":"String"}