Bridge

<back to all web services

ETSOrders

ETS
The following routes are available for this service:
GET/ETS/Orders
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ETSOrders:
    date_from: Optional[datetime.datetime] = None
    date_to: Optional[datetime.datetime] = None
    vessel_id: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetETSPriceDayChangeViewModel:
    id: int = 0
    today: datetime.datetime = datetime.datetime(1, 1, 1)
    previous_close: float = 0.0
    close_price: float = 0.0
    percentage_change: float = 0.0
    eur_change: float = 0.0
    label_description: Optional[str] = None
    show_get_quote_button: bool = False
    show_price_section: bool = False
    minutes_remaining: int = 0
    market_countdown_label: Optional[str] = None
    is_registered: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetETSRegistrationStatusViewModel:
    status: Optional[str] = None
    applied_by: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetETSOrderListNewIncludingForwardsViewModel:
    id: int = 0
    order_guid: Optional[str] = None
    company: Optional[str] = None
    status: Optional[str] = None
    order_by_name: Optional[str] = None
    order_by_image_guid: Optional[str] = None
    quantity: int = 0
    order_placed_date_time: Optional[str] = None
    order_vessel_count: int = 0
    unit_price: float = 0.0
    total_price: float = 0.0
    is_forward: bool = False
    forward_month: Optional[str] = None
    is_third_party: bool = False
    third_party_name: Optional[str] = None
    current_value: float = 0.0
    eua_mark_to_market: float = 0.0
    month_starting_date: Optional[datetime.datetime] = None
    show_mark_to_market: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ETSViewModel:
    can_purchase_e_u_a: bool = False
    get_e_t_s_price_day_change: Optional[GetETSPriceDayChangeViewModel] = None
    get_e_t_s_registration_status: Optional[GetETSRegistrationStatusViewModel] = None
    get_e_t_s_order_list_new_including_forwards: Optional[List[GetETSOrderListNewIncludingForwardsViewModel]] = None

Python ETSOrders 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 /ETS/Orders HTTP/1.1 
Host: internal.thebunkerbridge.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"CanPurchaseEUA":false,"GetETSPriceDayChange":{"Id":0,"Today":"0001-01-01T00:00:00.0000000","PreviousClose":0,"ClosePrice":0,"PercentageChange":0,"EURChange":0,"LabelDescription":"String","ShowGetQuoteButton":false,"ShowPriceSection":false,"MinutesRemaining":0,"MarketCountdownLabel":"String","IsRegistered":"String"},"GetETSRegistrationStatus":{"Status":"String","AppliedBy":"String"},"GetETSOrderListNewIncludingForwards":[{"Id":0,"OrderGuid":"00000000000000000000000000000000","Company":"String","Status":"String","OrderByName":"String","OrderByImageGuid":"00000000000000000000000000000000","Quantity":0,"OrderPlacedDateTime":"String","OrderVesselCount":0,"UnitPrice":0,"TotalPrice":0,"IsForward":false,"ForwardMonth":"String","IsThirdParty":false,"ThirdPartyName":"String","CurrentValue":0,"EUAMarkToMarket":0,"MonthStartingDate":"0001-01-01T00:00:00.0000000","ShowMarkToMarket":false}]}