C# Class CarDeliveryNetwork.Api.ClientProxy.OpenApi

A wrapper class for the CDN OpenApi
Inheritance: ICdnApi
Afficher le fichier Open project: cardeliverynetwork/openapi.net Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

AllocateJobsToFleet() public méthode

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
Résultat void

Call() public méthode

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.
Résultat string

CallWithRetry() public méthode

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.
Résultat string

CancelJob() public méthode

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
Résultat void

CancelJob() public méthode

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
Résultat void

CreateFleetDevices() public méthode

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
Résultat Devices

CreateFleetTrucks() public méthode

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
Résultat Trucks

CreateFleets() public méthode

Attempts to create the specified fleets on Car Delivery Network.
public CreateFleets ( Fleets fleets ) : Users
fleets Fleets The collection of fleets to create.
Résultat Users

CreateJob() public méthode

Create the specified job on Car Delivery Network.
public CreateJob ( Job job ) : Job
job Job The job to create.
Résultat Job

CreateJobVehicles() public méthode

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.
Résultat Vehicles

CreateJobVehicles() public méthode

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.
Résultat Vehicles

CreateJobs() public méthode

Attempts to create the specified jobs on Car Delivery Network.
public CreateJobs ( Jobs jobs ) : Jobs
jobs Jobs The collection of jobs to create.
Résultat Jobs

CreateMasterDestinations() public méthode

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.
Résultat ContactDetailss

CreateUsers() public méthode

Attempts to create the specified users on Car Delivery Network.
public CreateUsers ( Users users ) : Users
users Users The collection of users to create.
Résultat Users

GetHomeFleet() public méthode

Gets the home fleet of the calling user
public GetHomeFleet ( ) : Fleet
Résultat Fleet

GetJob() public méthode

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
Résultat Job

GetJob() public méthode

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
Résultat Job

GetJobDocuments() public méthode

Gets the the list of documents for the job of the specified id.
public GetJobDocuments ( int id ) : Documents
id int Job Id
Résultat Documents

GetJobDocuments() public méthode

Gets the the list of documents for the job of the specified LoadId.
public GetJobDocuments ( string loadId ) : Documents
loadId string Job LoadId
Résultat Documents

GetJobVehicles() public méthode

Gets a collection of vehicles form the job of the specified Id
public GetJobVehicles ( int jobId ) : Vehicles
jobId int Id of the job resource
Résultat Vehicles

GetJobVehicles() public méthode

Gets a collection of vehicles form the job of the specified LoadId
public GetJobVehicles ( string loadId ) : Vehicles
loadId string LoadId of the job resource
Résultat Vehicles

GetProof() public méthode

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
Résultat CarDeliveryNetwork.Api.Data.Proof

OpenApi() public méthode

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.
Résultat System

SendJobHooks() public méthode

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
Résultat void

UpdateJob() public méthode

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.
Résultat Job

UpdateJob() public méthode

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.
Résultat Job