C# Класс CarDeliveryNetwork.Api.ClientProxy.OpenApi

A wrapper class for the CDN OpenApi
Наследование: ICdnApi
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AllocateJobsToFleet ( int id, Jobs jobs, string queryStringParameters = null ) : void

Allocates the specified jobs to this fleet resource.

Call ( string resource, string method, bool isUsingLoadIds = false, IApiEntity data = null, string callParams = null ) : string

Calls the API with the specified resource and method.

CallWithRetry ( string resource, string method, bool isUsingLoadIds = false, IApiEntity data = null, string callParams = null ) : string

Calls the API with the specified resource and method. Retries 3 times on "Unable to connect to the remote server"

CancelJob ( int id, string reason ) : void

Cancels the job of the specified Id giving the specified reason

CancelJob ( string loadId, string reason ) : void

Cancels the job of the specified LoadId giving the specified reason

CreateFleetDevices ( string fleetId, Devices devices, bool isCmac, bool sendTestJob ) : Devices

Creates the specified devices against the specified Fleet.

CreateFleetTrucks ( string fleetId, Trucks trucks, bool isCmac ) : Trucks

Creates the specified trucks against the specified Fleet.

CreateFleets ( Fleets fleets ) : Users

Attempts to create the specified fleets on Car Delivery Network.

CreateJob ( Job job ) : Job

Create the specified job on Car Delivery Network.

CreateJobVehicles ( int jobId, Vehicles vehicles ) : Vehicles

Attempts to create the specified vehicles on the specified job on Car Delivery Network.

CreateJobVehicles ( string loadId, Vehicles vehicles ) : Vehicles

Attempts to create the specified vehicles on the specified job on Car Delivery Network.

CreateJobs ( Jobs jobs ) : Jobs

Attempts to create the specified jobs on Car Delivery Network.

CreateMasterDestinations ( ContactDetailss destinations ) : ContactDetailss

Attempts to create the specified master destinations on Car Delivery Network.

CreateUsers ( Users users ) : Users

Attempts to create the specified users on Car Delivery Network.

GetHomeFleet ( ) : Fleet

Gets the home fleet of the calling user

GetJob ( int id, string callParams = null ) : Job

Gets the job of the specified Id from Car Delivery Network.

GetJob ( string loadId, string callParams = null ) : Job

Gets the job of the specified LoadId from Car Delivery Network.

GetJobDocuments ( int id ) : Documents

Gets the the list of documents for the job of the specified id.

GetJobDocuments ( string loadId ) : Documents

Gets the the list of documents for the job of the specified LoadId.

GetJobVehicles ( int jobId ) : Vehicles

Gets a collection of vehicles form the job of the specified Id

GetJobVehicles ( string loadId ) : Vehicles

Gets a collection of vehicles form the job of the specified LoadId

GetProof ( int id, string pin ) : Proof

Gets the proof document for the endpoint of the specified JobId and Pin.

OpenApi ( string uri, string apiKey = null, string app = null ) : System

Initializes a new instance of the CarDeliveryNetwork.Api.ClientProxy.OpenApi class.

SendJobHooks ( int id, WebHookEvent hookEvent, string doForSchema ) : void

Sends the hooks for the specified hook event, of the specified schema

UpdateJob ( int id, Job job ) : Job

Updates the specified job on Car Delivery Network.

UpdateJob ( string loadId, Job job ) : Job

Updates the specified job on Car Delivery Network.

Приватные методы

Метод Описание
PerformAction ( string resourceName, int id, Data action ) : void
PerformAction ( string resourceName, string loadId, Data action ) : void
PerformJobAction ( int id, Data action ) : void
PerformJobAction ( string loadId, Data action ) : void
UpdateJob ( string resource, Job job, bool isUsingLoadIds ) : Job

Описание методов

AllocateJobsToFleet() публичный Метод

Allocates the specified jobs to this fleet resource.
public AllocateJobsToFleet ( int id, Jobs jobs, string queryStringParameters = null ) : void
id int Resource Id
jobs Jobs The list of jobs to allocate to this fleet resource
queryStringParameters string Additonal parameters: scheduled dates and buy price
Результат void

Call() публичный Метод

Calls the API with the specified resource and method.
public Call ( string resource, string method, bool isUsingLoadIds = false, IApiEntity data = null, string callParams = null ) : string
resource string The target resource.
method string The HTTP method to perform on the target resource.
isUsingLoadIds bool When true, the target resource is identified by a client specified LoadId.
data IApiEntity The data body for POST and PUT methods.
callParams string Paramater string to be added to the end of the API call.
Результат string

CallWithRetry() публичный Метод

Calls the API with the specified resource and method. Retries 3 times on "Unable to connect to the remote server"
public CallWithRetry ( string resource, string method, bool isUsingLoadIds = false, IApiEntity data = null, string callParams = null ) : string
resource string The target resource.
method string The HTTP method to perform on the target resource.
isUsingLoadIds bool When true, the target resource is identified by a client specified LoadId.
data IApiEntity The data body for POST and PUT methods.
callParams string Paramater string to be added to the end of the API call.
Результат string

CancelJob() публичный Метод

Cancels the job of the specified Id giving the specified reason
public CancelJob ( int id, string reason ) : void
id int Id of job to cancel
reason string Reason for job cancellation
Результат void

CancelJob() публичный Метод

Cancels the job of the specified LoadId giving the specified reason
public CancelJob ( string loadId, string reason ) : void
loadId string LoadId of job to cancel
reason string Reason for job cancellation
Результат void

CreateFleetDevices() публичный Метод

Creates the specified devices against the specified Fleet.
public CreateFleetDevices ( string fleetId, Devices devices, bool isCmac, bool sendTestJob ) : Devices
fleetId string The Fleet Id or 2 RH fields from CMAC
devices Devices The devices to create
isCmac bool Indicates that the fleetId is a CMAC
sendTestJob bool Indicates that a test job should be sent to the new device
Результат Devices

CreateFleetTrucks() публичный Метод

Creates the specified trucks against the specified Fleet.
public CreateFleetTrucks ( string fleetId, Trucks trucks, bool isCmac ) : Trucks
fleetId string The Fleet IdC
trucks Trucks The trucks to create
isCmac bool Indicates that the fleetId is a CMAC
Результат Trucks

CreateFleets() публичный Метод

Attempts to create the specified fleets on Car Delivery Network.
public CreateFleets ( Fleets fleets ) : Users
fleets Fleets The collection of fleets to create.
Результат Users

CreateJob() публичный Метод

Create the specified job on Car Delivery Network.
public CreateJob ( Job job ) : Job
job Job The job to create.
Результат Job

CreateJobVehicles() публичный Метод

Attempts to create the specified vehicles on the specified job on Car Delivery Network.
public CreateJobVehicles ( int jobId, Vehicles vehicles ) : Vehicles
jobId int Id of the job to create vehicles against.
vehicles Vehicles The collection of vehicles to create.
Результат Vehicles

CreateJobVehicles() публичный Метод

Attempts to create the specified vehicles on the specified job on Car Delivery Network.
public CreateJobVehicles ( string loadId, Vehicles vehicles ) : Vehicles
loadId string LoadId of the job to create vehicles against.
vehicles Vehicles The collection of vehicles to create.
Результат Vehicles

CreateJobs() публичный Метод

Attempts to create the specified jobs on Car Delivery Network.
public CreateJobs ( Jobs jobs ) : Jobs
jobs Jobs The collection of jobs to create.
Результат Jobs

CreateMasterDestinations() публичный Метод

Attempts to create the specified master destinations on Car Delivery Network.
public CreateMasterDestinations ( ContactDetailss destinations ) : ContactDetailss
destinations ContactDetailss The collection of master destinations to create.
Результат ContactDetailss

CreateUsers() публичный Метод

Attempts to create the specified users on Car Delivery Network.
public CreateUsers ( Users users ) : Users
users Users The collection of users to create.
Результат Users

GetHomeFleet() публичный Метод

Gets the home fleet of the calling user
public GetHomeFleet ( ) : Fleet
Результат Fleet

GetJob() публичный Метод

Gets the job of the specified Id from Car Delivery Network.
public GetJob ( int id, string callParams = null ) : Job
id int Id of the job to get.
callParams string Paramaters to be added to the API Call URL
Результат Job

GetJob() публичный Метод

Gets the job of the specified LoadId from Car Delivery Network.
public GetJob ( string loadId, string callParams = null ) : Job
loadId string LoadId of the job to get.
callParams string Paramaters to be added to the API Call URL
Результат Job

GetJobDocuments() публичный Метод

Gets the the list of documents for the job of the specified id.
public GetJobDocuments ( int id ) : Documents
id int Job Id
Результат Documents

GetJobDocuments() публичный Метод

Gets the the list of documents for the job of the specified LoadId.
public GetJobDocuments ( string loadId ) : Documents
loadId string Job LoadId
Результат Documents

GetJobVehicles() публичный Метод

Gets a collection of vehicles form the job of the specified Id
public GetJobVehicles ( int jobId ) : Vehicles
jobId int Id of the job resource
Результат Vehicles

GetJobVehicles() публичный Метод

Gets a collection of vehicles form the job of the specified LoadId
public GetJobVehicles ( string loadId ) : Vehicles
loadId string LoadId of the job resource
Результат Vehicles

GetProof() публичный Метод

Gets the proof document for the endpoint of the specified JobId and Pin.
public GetProof ( int id, string pin ) : Proof
id int The Job Id
pin string The EndPoint Pin
Результат CarDeliveryNetwork.Api.Data.Proof

OpenApi() публичный Метод

Initializes a new instance of the CarDeliveryNetwork.Api.ClientProxy.OpenApi class.
public OpenApi ( string uri, string apiKey = null, string app = null ) : System
uri string The uri of the target service.
apiKey string Your API key.
app string The application constructing this OpenApi instance.
Результат System

SendJobHooks() публичный Метод

Sends the hooks for the specified hook event, of the specified schema
public SendJobHooks ( int id, WebHookEvent hookEvent, string doForSchema ) : void
id int Id of job to send hooks for
hookEvent WebHookEvent The hook event to send for
doForSchema string The hook schame to send for
Результат void

UpdateJob() публичный Метод

Updates the specified job on Car Delivery Network.
public UpdateJob ( int id, Job job ) : Job
id int Id of job to update.
job Job The job update.
Результат Job

UpdateJob() публичный Метод

Updates the specified job on Car Delivery Network.
public UpdateJob ( string loadId, Job job ) : Job
loadId string LoadId of job to update.
job Job The job update.
Результат Job