Skip to content

Latest commit

 

History

History
193 lines (126 loc) · 11.5 KB

README.md

File metadata and controls

193 lines (126 loc) · 11.5 KB

Contracts

(Contracts)

Overview

Contracts

Available Operations

GetContracts

Return a paginated list of all your contracts.

Example Usage

using Openapi;
using Openapi.Models.Requests;

var sdk = new SeUnitySDK();

using(var res = await sdk.Contracts.GetContractsAsync(
    "<YOUR_BEARER_TOKEN_HERE>",
    page: 907785,
    limit: 306163))
{
    // handle response
}

Parameters

Parameter Type Required Description
security Openapi.Models.Requests.GetContractsSecurity ✔️ The security requirements to use for the request.
Page long What entry offset to request
Limit long How many entries to return per page

Response

GetContractsResponse

GetContract

Get the details of a contract by ID.

Example Usage

using Openapi;
using Openapi.Models.Requests;

var sdk = new SeUnitySDK();

using(var res = await sdk.Contracts.GetContractAsync(
    "<YOUR_BEARER_TOKEN_HERE>",
    contractId: "<value>"))
{
    // handle response
}

Parameters

Parameter Type Required Description
security Openapi.Models.Requests.GetContractSecurity ✔️ The security requirements to use for the request.
ContractId string ✔️ The contract ID

Response

GetContractResponse

AcceptContract

Accept a contract by ID.

You can only accept contracts that were offered to you, were not accepted yet, and whose deadlines has not passed yet.

Example Usage

using Openapi;
using Openapi.Models.Requests;

var sdk = new SeUnitySDK();

using(var res = await sdk.Contracts.AcceptContractAsync(
    "<YOUR_BEARER_TOKEN_HERE>",
    contractId: "<value>"))
{
    // handle response
}

Parameters

Parameter Type Required Description
security Openapi.Models.Requests.AcceptContractSecurity ✔️ The security requirements to use for the request.
ContractId string ✔️ The contract ID to accept.

Response

AcceptContractResponse

DeliverContract

Deliver cargo to a contract.

In order to use this API, a ship must be at the delivery location (denoted in the delivery terms as destinationSymbol of a contract) and must have a number of units of a good required by this contract in its cargo.

Cargo that was delivered will be removed from the ship's cargo.

Example Usage

using Openapi;
using Openapi.Models.Requests;

var sdk = new SeUnitySDK();

using(var res = await sdk.Contracts.DeliverContractAsync(
    "<YOUR_BEARER_TOKEN_HERE>",
    contractId: "<value>",
    requestBody: new DeliverContractRequestBody() {
    ShipSymbol = "<value>",
    TradeSymbol = "<value>",
    Units = 800350,
}))
{
    // handle response
}

Parameters

Parameter Type Required Description
security Openapi.Models.Requests.DeliverContractSecurity ✔️ The security requirements to use for the request.
ContractId string ✔️ The ID of the contract.
RequestBody DeliverContractRequestBody N/A

Response

DeliverContractResponse

FulfillContract

Fulfill a contract. Can only be used on contracts that have all of their delivery terms fulfilled.

Example Usage

using Openapi;
using Openapi.Models.Requests;

var sdk = new SeUnitySDK();

using(var res = await sdk.Contracts.FulfillContractAsync(
    "<YOUR_BEARER_TOKEN_HERE>",
    contractId: "<value>"))
{
    // handle response
}

Parameters

Parameter Type Required Description
security Openapi.Models.Requests.FulfillContractSecurity ✔️ The security requirements to use for the request.
ContractId string ✔️ The ID of the contract to fulfill.

Response

FulfillContractResponse