Documentation
¶
Overview ¶
Package trading212 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Package trading212 is a Go client for the Trading 212 Public API, generated with oapi-codegen from the OpenAPI document Trading 212 publishes.
Example ¶
This is the README usage example. It talks to the live API, so it has no Output comment and only has to compile.
package main
import (
"context"
"net/http"
"os"
"github.com/psyb0t/go-trading212"
)
func main() {
auth := trading212.WithRequestEditorFn(
func(_ context.Context, req *http.Request) error {
req.SetBasicAuth(
os.Getenv("TRADING212_API_KEY"),
os.Getenv("TRADING212_API_SECRET"),
)
return nil
},
)
client, err := trading212.NewClientWithResponses(
"https://demo.trading212.com",
auth,
)
if err != nil {
panic(err)
}
res, err := client.GetAccountSummaryWithResponse(context.Background())
if err != nil {
panic(err)
}
_ = res.JSON200
}
Output:
Index ¶
- func NewCancelOrderRequest(server string, id int64) (*http.Request, error)
- func NewCreateRequest(server string, body CreateJSONRequestBody) (*http.Request, error)
- func NewCreateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeleteRequest(server string, id int64) (*http.Request, error)
- func NewDividendsRequest(server string, params *DividendsParams) (*http.Request, error)
- func NewDuplicatePieRequest(server string, id int64, body DuplicatePieJSONRequestBody) (*http.Request, error)
- func NewDuplicatePieRequestWithBody(server string, id int64, contentType string, body io.Reader) (*http.Request, error)
- func NewExchangesRequest(server string) (*http.Request, error)
- func NewGetAccountSummaryRequest(server string) (*http.Request, error)
- func NewGetAllRequest(server string) (*http.Request, error)
- func NewGetDetailedRequest(server string, id int64) (*http.Request, error)
- func NewGetPositionsRequest(server string, params *GetPositionsParams) (*http.Request, error)
- func NewGetReportsRequest(server string) (*http.Request, error)
- func NewInstrumentsRequest(server string) (*http.Request, error)
- func NewOrderByIdRequest(server string, id int64) (*http.Request, error)
- func NewOrders1Request(server string, params *Orders1Params) (*http.Request, error)
- func NewOrdersRequest(server string) (*http.Request, error)
- func NewPlaceLimitOrderRequest(server string, body PlaceLimitOrderJSONRequestBody) (*http.Request, error)
- func NewPlaceLimitOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPlaceMarketOrderRequest(server string, body PlaceMarketOrderJSONRequestBody) (*http.Request, error)
- func NewPlaceMarketOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPlaceStopOrder1Request(server string, body PlaceStopOrder1JSONRequestBody) (*http.Request, error)
- func NewPlaceStopOrder1RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPlaceStopOrderRequest(server string, body PlaceStopOrderJSONRequestBody) (*http.Request, error)
- func NewPlaceStopOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewRequestReportRequest(server string, body RequestReportJSONRequestBody) (*http.Request, error)
- func NewRequestReportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewTransactionsRequest(server string, params *TransactionsParams) (*http.Request, error)
- func NewUpdateRequest(server string, id int64, body UpdateJSONRequestBody) (*http.Request, error)
- func NewUpdateRequestWithBody(server string, id int64, contentType string, body io.Reader) (*http.Request, error)
- type AccountBucketDetailedResponse
- type AccountBucketDetailedResponseDividendCashAction
- type AccountBucketInstrumentResult
- type AccountBucketInstrumentsDetailedResponse
- type AccountBucketResultResponse
- type AccountBucketResultResponseStatus
- type AccountSummary
- type CancelOrderResponse
- type Cash
- type Client
- func (c *Client) CancelOrder(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Create(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) CreateWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Delete(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Dividends(ctx context.Context, params *DividendsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) DuplicatePie(ctx context.Context, id int64, body DuplicatePieJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) DuplicatePieWithBody(ctx context.Context, id int64, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Exchanges(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetAccountSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetAll(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetDetailed(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetPositions(ctx context.Context, params *GetPositionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetReports(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Instruments(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) OrderById(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Orders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Orders1(ctx context.Context, params *Orders1Params, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PlaceLimitOrder(ctx context.Context, body PlaceLimitOrderJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PlaceLimitOrderWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PlaceMarketOrder(ctx context.Context, body PlaceMarketOrderJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PlaceMarketOrderWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PlaceStopOrder(ctx context.Context, body PlaceStopOrderJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PlaceStopOrder1(ctx context.Context, body PlaceStopOrder1JSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PlaceStopOrder1WithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PlaceStopOrderWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) RequestReport(ctx context.Context, body RequestReportJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) RequestReportWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Transactions(ctx context.Context, params *TransactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Update(ctx context.Context, id int64, body UpdateJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) UpdateWithBody(ctx context.Context, id int64, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CancelOrderWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*CancelOrderResponse, error)
- func (c *ClientWithResponses) CreateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CreateResponse, error)deprecated
- func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)
- func (c *ClientWithResponses) DeleteWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*DeleteResponse, error)deprecated
- func (c *ClientWithResponses) DividendsWithResponse(ctx context.Context, params *DividendsParams, reqEditors ...RequestEditorFn) (*DividendsResponse, error)
- func (c *ClientWithResponses) DuplicatePieWithBodyWithResponse(ctx context.Context, id int64, contentType string, body io.Reader, ...) (*DuplicatePieResponse, error)deprecated
- func (c *ClientWithResponses) DuplicatePieWithResponse(ctx context.Context, id int64, body DuplicatePieJSONRequestBody, ...) (*DuplicatePieResponse, error)
- func (c *ClientWithResponses) ExchangesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ExchangesResponse, error)
- func (c *ClientWithResponses) GetAccountSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAccountSummaryResponse, error)
- func (c *ClientWithResponses) GetAllWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllResponse, error)deprecated
- func (c *ClientWithResponses) GetDetailedWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*GetDetailedResponse, error)deprecated
- func (c *ClientWithResponses) GetPositionsWithResponse(ctx context.Context, params *GetPositionsParams, reqEditors ...RequestEditorFn) (*GetPositionsResponse, error)
- func (c *ClientWithResponses) GetReportsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetReportsResponse, error)
- func (c *ClientWithResponses) InstrumentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstrumentsResponse, error)
- func (c *ClientWithResponses) OrderByIdWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*OrderByIdResponse, error)
- func (c *ClientWithResponses) Orders1WithResponse(ctx context.Context, params *Orders1Params, reqEditors ...RequestEditorFn) (*Orders1Response, error)
- func (c *ClientWithResponses) OrdersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrdersResponse, error)
- func (c *ClientWithResponses) PlaceLimitOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PlaceLimitOrderResponse, error)
- func (c *ClientWithResponses) PlaceLimitOrderWithResponse(ctx context.Context, body PlaceLimitOrderJSONRequestBody, ...) (*PlaceLimitOrderResponse, error)
- func (c *ClientWithResponses) PlaceMarketOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PlaceMarketOrderResponse, error)
- func (c *ClientWithResponses) PlaceMarketOrderWithResponse(ctx context.Context, body PlaceMarketOrderJSONRequestBody, ...) (*PlaceMarketOrderResponse, error)
- func (c *ClientWithResponses) PlaceStopOrder1WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PlaceStopOrder1Response, error)
- func (c *ClientWithResponses) PlaceStopOrder1WithResponse(ctx context.Context, body PlaceStopOrder1JSONRequestBody, ...) (*PlaceStopOrder1Response, error)
- func (c *ClientWithResponses) PlaceStopOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PlaceStopOrderResponse, error)
- func (c *ClientWithResponses) PlaceStopOrderWithResponse(ctx context.Context, body PlaceStopOrderJSONRequestBody, ...) (*PlaceStopOrderResponse, error)
- func (c *ClientWithResponses) RequestReportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*RequestReportResponse, error)
- func (c *ClientWithResponses) RequestReportWithResponse(ctx context.Context, body RequestReportJSONRequestBody, ...) (*RequestReportResponse, error)
- func (c *ClientWithResponses) TransactionsWithResponse(ctx context.Context, params *TransactionsParams, reqEditors ...RequestEditorFn) (*TransactionsResponse, error)
- func (c *ClientWithResponses) UpdateWithBodyWithResponse(ctx context.Context, id int64, contentType string, body io.Reader, ...) (*UpdateResponse, error)deprecated
- func (c *ClientWithResponses) UpdateWithResponse(ctx context.Context, id int64, body UpdateJSONRequestBody, ...) (*UpdateResponse, error)
- type ClientWithResponsesInterface
- type CreateJSONRequestBodydeprecated
- type CreateResponse
- type DeleteResponse
- type DividendDetails
- type DividendsParams
- type DividendsResponse
- type DuplicateBucketRequest
- type DuplicatePieJSONRequestBodydeprecated
- type DuplicatePieResponse
- type EnqueuedReportResponse
- type Exchange
- type ExchangesResponse
- type Fill
- type FillTradingMethod
- type FillType
- type FillWalletImpact
- type GetAccountSummaryResponse
- type GetAllResponse
- type GetDetailedResponse
- type GetPositionsParams
- type GetPositionsResponse
- type GetReportsResponse
- type HistoricalOrder
- type HistoryDividendItem
- type HistoryDividendItemType
- type HistoryTransactionItem
- type HistoryTransactionItemType
- type HttpRequestDoer
- type Instrument
- type InstrumentIssue
- type InstrumentIssueName
- type InstrumentIssueSeverity
- type InstrumentsResponse
- type InvestmentResult
- type Investments
- type LimitRequest
- type MarketRequest
- type Order
- type OrderByIdResponse
- type OrderInitiatedFrom
- type OrderSide
- type OrderStatus
- type OrderStrategy
- type OrderType
- type Orders1Params
- type Orders1Response
- type OrdersResponse
- type PaginatedResponseHistoricalOrder
- type PaginatedResponseHistoryDividendItem
- type PaginatedResponseHistoryTransactionItem
- type PieRequest
- type PieRequestDividendCashAction
- type PlaceLimitOrderJSONRequestBody
- type PlaceLimitOrderResponse
- type PlaceMarketOrderJSONRequestBody
- type PlaceMarketOrderResponse
- type PlaceStopOrder1JSONRequestBody
- type PlaceStopOrder1Response
- type PlaceStopOrderJSONRequestBody
- type PlaceStopOrderResponse
- type Position
- type PositionWalletImpact
- type PublicReportRequest
- type ReportDataIncluded
- type ReportResponse
- type ReportResponseStatus
- type RequestEditorFn
- type RequestReportJSONRequestBody
- type RequestReportResponse
- type StopLimitRequest
- type StopRequest
- type Tax
- type TaxName
- type TimeEvent
- type TimeEventType
- type TimeValidity
- type TradableInstrument
- type TradableInstrumentType
- type TransactionsParams
- type TransactionsResponse
- type UpdateJSONRequestBodydeprecated
- type UpdateResponse
- type WorkingSchedule
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCancelOrderRequest ¶
NewCancelOrderRequest constructs an http.Request for the CancelOrder method
func NewCreateRequest ¶
func NewCreateRequest(server string, body CreateJSONRequestBody) (*http.Request, error)
NewCreateRequest calls the generic Create builder with application/json body
func NewCreateRequestWithBody ¶
func NewCreateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateRequestWithBody constructs an http.Request for the Create method, with any body, and a specified content type
func NewDeleteRequest ¶
NewDeleteRequest constructs an http.Request for the Delete method
func NewDividendsRequest ¶
func NewDividendsRequest(server string, params *DividendsParams) (*http.Request, error)
NewDividendsRequest constructs an http.Request for the Dividends method
func NewDuplicatePieRequest ¶
func NewDuplicatePieRequest(server string, id int64, body DuplicatePieJSONRequestBody) (*http.Request, error)
NewDuplicatePieRequest calls the generic DuplicatePie builder with application/json body
func NewDuplicatePieRequestWithBody ¶
func NewDuplicatePieRequestWithBody(server string, id int64, contentType string, body io.Reader) (*http.Request, error)
NewDuplicatePieRequestWithBody constructs an http.Request for the DuplicatePie method, with any body, and a specified content type
func NewExchangesRequest ¶
NewExchangesRequest constructs an http.Request for the Exchanges method
func NewGetAccountSummaryRequest ¶
NewGetAccountSummaryRequest constructs an http.Request for the GetAccountSummary method
func NewGetAllRequest ¶
NewGetAllRequest constructs an http.Request for the GetAll method
func NewGetDetailedRequest ¶
NewGetDetailedRequest constructs an http.Request for the GetDetailed method
func NewGetPositionsRequest ¶
func NewGetPositionsRequest(server string, params *GetPositionsParams) (*http.Request, error)
NewGetPositionsRequest constructs an http.Request for the GetPositions method
func NewGetReportsRequest ¶
NewGetReportsRequest constructs an http.Request for the GetReports method
func NewInstrumentsRequest ¶
NewInstrumentsRequest constructs an http.Request for the Instruments method
func NewOrderByIdRequest ¶
NewOrderByIdRequest constructs an http.Request for the OrderById method
func NewOrders1Request ¶
func NewOrders1Request(server string, params *Orders1Params) (*http.Request, error)
NewOrders1Request constructs an http.Request for the Orders1 method
func NewOrdersRequest ¶
NewOrdersRequest constructs an http.Request for the Orders method
func NewPlaceLimitOrderRequest ¶
func NewPlaceLimitOrderRequest(server string, body PlaceLimitOrderJSONRequestBody) (*http.Request, error)
NewPlaceLimitOrderRequest calls the generic PlaceLimitOrder builder with application/json body
func NewPlaceLimitOrderRequestWithBody ¶
func NewPlaceLimitOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPlaceLimitOrderRequestWithBody constructs an http.Request for the PlaceLimitOrder method, with any body, and a specified content type
func NewPlaceMarketOrderRequest ¶
func NewPlaceMarketOrderRequest(server string, body PlaceMarketOrderJSONRequestBody) (*http.Request, error)
NewPlaceMarketOrderRequest calls the generic PlaceMarketOrder builder with application/json body
func NewPlaceMarketOrderRequestWithBody ¶
func NewPlaceMarketOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPlaceMarketOrderRequestWithBody constructs an http.Request for the PlaceMarketOrder method, with any body, and a specified content type
func NewPlaceStopOrder1Request ¶
func NewPlaceStopOrder1Request(server string, body PlaceStopOrder1JSONRequestBody) (*http.Request, error)
NewPlaceStopOrder1Request calls the generic PlaceStopOrder1 builder with application/json body
func NewPlaceStopOrder1RequestWithBody ¶
func NewPlaceStopOrder1RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPlaceStopOrder1RequestWithBody constructs an http.Request for the PlaceStopOrder1 method, with any body, and a specified content type
func NewPlaceStopOrderRequest ¶
func NewPlaceStopOrderRequest(server string, body PlaceStopOrderJSONRequestBody) (*http.Request, error)
NewPlaceStopOrderRequest calls the generic PlaceStopOrder builder with application/json body
func NewPlaceStopOrderRequestWithBody ¶
func NewPlaceStopOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPlaceStopOrderRequestWithBody constructs an http.Request for the PlaceStopOrder method, with any body, and a specified content type
func NewRequestReportRequest ¶
func NewRequestReportRequest(server string, body RequestReportJSONRequestBody) (*http.Request, error)
NewRequestReportRequest calls the generic RequestReport builder with application/json body
func NewRequestReportRequestWithBody ¶
func NewRequestReportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewRequestReportRequestWithBody constructs an http.Request for the RequestReport method, with any body, and a specified content type
func NewTransactionsRequest ¶
func NewTransactionsRequest(server string, params *TransactionsParams) (*http.Request, error)
NewTransactionsRequest constructs an http.Request for the Transactions method
func NewUpdateRequest ¶
NewUpdateRequest calls the generic Update builder with application/json body
Types ¶
type AccountBucketDetailedResponse ¶
type AccountBucketDetailedResponse struct {
CreationDate *time.Time `json:"creationDate,omitempty"`
DividendCashAction *AccountBucketDetailedResponseDividendCashAction `json:"dividendCashAction,omitempty"`
EndDate *time.Time `json:"endDate,omitempty"`
Goal *float64 `json:"goal,omitempty"`
Icon *string `json:"icon,omitempty"`
Id *int64 `json:"id,omitempty"`
InitialInvestment *float64 `json:"initialInvestment,omitempty"`
Name *string `json:"name,omitempty"`
PublicUrl *string `json:"publicUrl,omitempty"`
}
AccountBucketDetailedResponse defines model for AccountBucketDetailedResponse.
type AccountBucketDetailedResponseDividendCashAction ¶
type AccountBucketDetailedResponseDividendCashAction string
AccountBucketDetailedResponseDividendCashAction defines model for AccountBucketDetailedResponse.DividendCashAction.
const ( AccountBucketDetailedResponseDividendCashActionREINVEST AccountBucketDetailedResponseDividendCashAction = "REINVEST" AccountBucketDetailedResponseDividendCashActionTOACCOUNTCASH AccountBucketDetailedResponseDividendCashAction = "TO_ACCOUNT_CASH" )
Defines values for AccountBucketDetailedResponseDividendCashAction.
func (AccountBucketDetailedResponseDividendCashAction) Valid ¶
func (e AccountBucketDetailedResponseDividendCashAction) Valid() bool
Valid indicates whether the value is a known member of the AccountBucketDetailedResponseDividendCashAction enum.
type AccountBucketInstrumentResult ¶
type AccountBucketInstrumentResult struct {
Issues *[]InstrumentIssue `json:"issues,omitempty"`
OwnedQuantity *float64 `json:"ownedQuantity,omitempty"`
Result *InvestmentResult `json:"result,omitempty"`
Ticker *string `json:"ticker,omitempty"`
}
AccountBucketInstrumentResult defines model for AccountBucketInstrumentResult.
type AccountBucketInstrumentsDetailedResponse ¶
type AccountBucketInstrumentsDetailedResponse struct {
Instruments *[]AccountBucketInstrumentResult `json:"instruments,omitempty"`
Settings *AccountBucketDetailedResponse `json:"settings,omitempty"`
}
AccountBucketInstrumentsDetailedResponse defines model for AccountBucketInstrumentsDetailedResponse.
type AccountBucketResultResponse ¶
type AccountBucketResultResponse struct {
// Cash Amount of money put into the pie in account currency
Cash *float64 `json:"cash,omitempty"`
DividendDetails *DividendDetails `json:"dividendDetails,omitempty"`
Id *int64 `json:"id,omitempty"`
// Progress Progress of the pie based on the set goal
//
// Example: 0.5
Progress *float64 `json:"progress,omitempty"`
Result *InvestmentResult `json:"result,omitempty"`
// Status Status of the pie based on the set goal
Status *AccountBucketResultResponseStatus `json:"status,omitempty"`
}
AccountBucketResultResponse defines model for AccountBucketResultResponse.
type AccountBucketResultResponseStatus ¶
type AccountBucketResultResponseStatus string
AccountBucketResultResponseStatus Status of the pie based on the set goal
const ( AccountBucketResultResponseStatusAHEAD AccountBucketResultResponseStatus = "AHEAD" AccountBucketResultResponseStatusBEHIND AccountBucketResultResponseStatus = "BEHIND" AccountBucketResultResponseStatusONTRACK AccountBucketResultResponseStatus = "ON_TRACK" )
Defines values for AccountBucketResultResponseStatus.
func (AccountBucketResultResponseStatus) Valid ¶
func (e AccountBucketResultResponseStatus) Valid() bool
Valid indicates whether the value is a known member of the AccountBucketResultResponseStatus enum.
type AccountSummary ¶
type AccountSummary struct {
Cash *Cash `json:"cash,omitempty"`
// Currency Primary account currency in ISO 4217 format.
Currency *string `json:"currency,omitempty"`
// Id Primary trading account number. This is the same account ID you would see in the Trading 212 web or mobile application.
Id *int64 `json:"id,omitempty"`
Investments *Investments `json:"investments,omitempty"`
// TotalValue Investments value in your account's primary currency.
TotalValue *float64 `json:"totalValue,omitempty"`
}
AccountSummary defines model for AccountSummary.
type CancelOrderResponse ¶
func ParseCancelOrderResponse ¶
func ParseCancelOrderResponse(rsp *http.Response) (*CancelOrderResponse, error)
ParseCancelOrderResponse parses an HTTP response from a CancelOrderWithResponse call
func (CancelOrderResponse) ContentType ¶
func (r CancelOrderResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CancelOrderResponse) GetBody ¶
func (r CancelOrderResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CancelOrderResponse) Status ¶
func (r CancelOrderResponse) Status() string
Status returns HTTPResponse.Status
func (CancelOrderResponse) StatusCode ¶
func (r CancelOrderResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Cash ¶
type Cash struct {
// AvailableToTrade Funds available for investing.
AvailableToTrade *float64 `json:"availableToTrade,omitempty"`
// InPies It’s the sum of the cash inside of all pies that is not yet invested.
InPies *float64 `json:"inPies,omitempty"`
// ReservedForOrders The amount of cash reserved for pending orders. This cash is not available for placing new trades.
ReservedForOrders *float64 `json:"reservedForOrders,omitempty"`
}
Cash defines model for Cash.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) CancelOrder ¶
func (c *Client) CancelOrder(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
CancelOrder Cancel a pending order
Attempts to cancel an active, unfilled order by its unique ID. Cancellation is not guaranteed if the order is already in the process of being filled. A successful response indicates the cancellation request was accepted.
**Rate limit:** 50 req / 1m0s
Corresponds with DELETE /api/v0/equity/orders/{id} (the `CancelOrder` operationId).
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
Create Create pie
Creates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/pies (the `Create` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) CreateWithBody ¶
func (c *Client) CreateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateWithBody Create pie
Creates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/pies (the `Create` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
Delete Delete pie
Deletes a pie by given id ¶
**Rate limit:** 1 req / 5s
Corresponds with DELETE /api/v0/equity/pies/{id} (the `Delete` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) Dividends ¶
func (c *Client) Dividends(ctx context.Context, params *DividendsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
Dividends Get paid out dividends
**Rate limit:** 20 req / 1m0s
Corresponds with GET /api/v0/equity/history/dividends (the `Dividends` operationId).
func (*Client) DuplicatePie ¶
func (c *Client) DuplicatePie(ctx context.Context, id int64, body DuplicatePieJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
DuplicatePie Duplicate pie
Duplicates a pie for the account ¶
**Rate limit:** 1 req / 5s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) DuplicatePieWithBody ¶
func (c *Client) DuplicatePieWithBody(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
DuplicatePieWithBody Duplicate pie
Duplicates a pie for the account ¶
**Rate limit:** 1 req / 5s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) Exchanges ¶
func (c *Client) Exchanges(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
Exchanges Get exchanges metadata
Retrieves all accessible exchanges and their corresponding working schedules. Data is refreshed every 10 minutes.
**Rate limit:** 1 req / 30s
Corresponds with GET /api/v0/equity/metadata/exchanges (the `Exchanges` operationId).
func (*Client) GetAccountSummary ¶
func (c *Client) GetAccountSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
GetAccountSummary Get account summary
Provides a breakdown of your account's cash and investment metrics, including available funds, invested capital, and total account value.
**Rate limit:** 1 req / 5s
Corresponds with GET /api/v0/equity/account/summary (the `GetAccountSummary` operationId).
func (*Client) GetAll ¶
GetAll Fetch all pies
Fetches all pies for the account ¶
**Rate limit:** 1 req / 30s
Corresponds with GET /api/v0/equity/pies (the `GetAll` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) GetDetailed ¶
func (c *Client) GetDetailed(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
GetDetailed Fetch a pie
Fetches a pies for the account with detailed information ¶
**Rate limit:** 1 req / 5s
Corresponds with GET /api/v0/equity/pies/{id} (the `GetDetailed` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) GetPositions ¶
func (c *Client) GetPositions(ctx context.Context, params *GetPositionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
GetPositions Fetch all open positions
Fetch all open positions for your account ¶
**Rate limit:** 1 req / 1s
Corresponds with GET /api/v0/equity/positions (the `GetPositions` operationId).
func (*Client) GetReports ¶
func (c *Client) GetReports(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
GetReports List generated reports
Retrieves a list of all requested CSV reports and their current status.
**Asynchronous Workflow:**
1. Call `POST /history/exports` to request a report. You will receive a `reportId`.
2. Periodically call this endpoint (`GET /history/exports`) to check the `status` of the report corresponding to your `reportId`.
3. Once the status is `Finished`, the `downloadLink` field will contain a URL to download the CSV file.
**Rate limit:** 1 req / 1m0s
Corresponds with GET /api/v0/equity/history/exports (the `GetReports` operationId).
func (*Client) Instruments ¶
func (c *Client) Instruments(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
Instruments Get all available instruments
Retrieves all accessible instruments. Data is refreshed every 10 minutes.
**Rate limit:** 1 req / 50s
Corresponds with GET /api/v0/equity/metadata/instruments (the `Instruments` operationId).
func (*Client) OrderById ¶
func (c *Client) OrderById(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
OrderById Get a pending order by ID
Retrieves a single pending order using its unique numerical ID. This is useful for checking the status of a specific order you have previously placed.
**Rate limit:** 1 req / 1s
Corresponds with GET /api/v0/equity/orders/{id} (the `OrderById` operationId).
func (*Client) Orders ¶
Orders Get all pending orders
Retrieves a list of all orders that are currently active (i.e., not yet filled, cancelled, or expired). This is useful for monitoring the status of your open positions and managing your trading strategy.
**Rate limit:** 1 req / 5s
Corresponds with GET /api/v0/equity/orders (the `Orders` operationId).
func (*Client) Orders1 ¶
func (c *Client) Orders1(ctx context.Context, params *Orders1Params, reqEditors ...RequestEditorFn) (*http.Response, error)
Orders1 Get historical orders data
**Rate limit:** 20 req / 1m0s
Corresponds with GET /api/v0/equity/history/orders (the `Orders1` operationId).
func (*Client) PlaceLimitOrder ¶
func (c *Client) PlaceLimitOrder(ctx context.Context, body PlaceLimitOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceLimitOrder Place a Limit order
Creates a new Limit order, which executes at a specified price or better.
- To place a **buy** order, use a positive `quantity`. The order will fill at the `limitPrice` or lower.
- To place a **sell** order, use a negative `quantity`. The order will fill at the `limitPrice` or higher.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
func (*Client) PlaceLimitOrderWithBody ¶
func (c *Client) PlaceLimitOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceLimitOrderWithBody Place a Limit order
Creates a new Limit order, which executes at a specified price or better.
- To place a **buy** order, use a positive `quantity`. The order will fill at the `limitPrice` or lower.
- To place a **sell** order, use a negative `quantity`. The order will fill at the `limitPrice` or higher.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
func (*Client) PlaceMarketOrder ¶
func (c *Client) PlaceMarketOrder(ctx context.Context, body PlaceMarketOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceMarketOrder Place a Market order
Creates a new Market order, which is an instruction to trade a security immediately at the next available price.
- To place a **buy** order, use a positive `quantity`.
- To place a **sell** order, use a negative `quantity`.
- **`extendedHours`**: Set to `true` to allow the order to be filled outside of the standard trading session.
- If placed when the market is closed, the order will be queued to execute when the market next opens.
x **Order Limitations**
* Orders can be executed only in the **main account currency**
**Warning:** Market orders can be subject to price slippage, where the final execution price may differ from the price at the time of order placement.
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 50 req / 1m0s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
func (*Client) PlaceMarketOrderWithBody ¶
func (c *Client) PlaceMarketOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceMarketOrderWithBody Place a Market order
Creates a new Market order, which is an instruction to trade a security immediately at the next available price.
- To place a **buy** order, use a positive `quantity`.
- To place a **sell** order, use a negative `quantity`.
- **`extendedHours`**: Set to `true` to allow the order to be filled outside of the standard trading session.
- If placed when the market is closed, the order will be queued to execute when the market next opens.
x **Order Limitations**
* Orders can be executed only in the **main account currency**
**Warning:** Market orders can be subject to price slippage, where the final execution price may differ from the price at the time of order placement.
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 50 req / 1m0s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
func (*Client) PlaceStopOrder ¶
func (c *Client) PlaceStopOrder(ctx context.Context, body PlaceStopOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceStopOrder Place a StopLimit order
Creates a new Stop-Limit order, combining features of a Stop and a Limit order. The direction of the trade (buy/sell) is determined by the sign of the `quantity` field.
**Execution Logic:**
1. When the instrument's **Last Traded Price (LTP)** reaches the specified `stopPrice`, the order is triggered.
2. A Limit order is then automatically placed at the specified `limitPrice`.
This two-step process helps protect against price slippage that can occur with a standard Stop order.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
func (*Client) PlaceStopOrder1 ¶
func (c *Client) PlaceStopOrder1(ctx context.Context, body PlaceStopOrder1JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceStopOrder1 Place a Stop order
Creates a new Stop order, which places a Market order once the `stopPrice` is reached.
- To place a **buy** stop order, use a positive `quantity`.
- To place a **sell** stop order (commonly a 'stop-loss'), use a negative `quantity`.
- The `stopPrice` is triggered by the instrument's **Last Traded Price (LTP)**.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
func (*Client) PlaceStopOrder1WithBody ¶
func (c *Client) PlaceStopOrder1WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceStopOrder1WithBody Place a Stop order
Creates a new Stop order, which places a Market order once the `stopPrice` is reached.
- To place a **buy** stop order, use a positive `quantity`.
- To place a **sell** stop order (commonly a 'stop-loss'), use a negative `quantity`.
- The `stopPrice` is triggered by the instrument's **Last Traded Price (LTP)**.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
func (*Client) PlaceStopOrderWithBody ¶
func (c *Client) PlaceStopOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PlaceStopOrderWithBody Place a StopLimit order
Creates a new Stop-Limit order, combining features of a Stop and a Limit order. The direction of the trade (buy/sell) is determined by the sign of the `quantity` field.
**Execution Logic:**
1. When the instrument's **Last Traded Price (LTP)** reaches the specified `stopPrice`, the order is triggered.
2. A Limit order is then automatically placed at the specified `limitPrice`.
This two-step process helps protect against price slippage that can occur with a standard Stop order.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
func (*Client) RequestReport ¶
func (c *Client) RequestReport(ctx context.Context, body RequestReportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
RequestReport Request a CSV report
Initiates the generation of a CSV report containing historical account data. This is an asynchronous operation. The response will include a `reportId` which you can use to track the status of the generation process using the `GET /history/exports` endpoint.
**Rate limit:** 1 req / 30s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
func (*Client) RequestReportWithBody ¶
func (c *Client) RequestReportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RequestReportWithBody Request a CSV report
Initiates the generation of a CSV report containing historical account data. This is an asynchronous operation. The response will include a `reportId` which you can use to track the status of the generation process using the `GET /history/exports` endpoint.
**Rate limit:** 1 req / 30s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
func (*Client) Transactions ¶
func (c *Client) Transactions(ctx context.Context, params *TransactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
Transactions Get transactions
Fetch superficial information about movements to and from your account ¶
**Rate limit:** 20 req / 1m0s
Corresponds with GET /api/v0/equity/history/transactions (the `Transactions` operationId).
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, id int64, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
Update Update pie
Updates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes a body of the `application/json` content type.
Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*Client) UpdateWithBody ¶
func (c *Client) UpdateWithBody(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateWithBody Update pie
Updates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes any type of body and a specified content type.
Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
type ClientInterface ¶
type ClientInterface interface {
// GetAccountSummary Get account summary
//
// Provides a breakdown of your account's cash and investment metrics,
// including available funds, invested capital, and total account value.
//
// **Rate limit:** 1 req / 5s
//
// Corresponds with GET /api/v0/equity/account/summary (the `GetAccountSummary` operationId).
GetAccountSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// Dividends Get paid out dividends
//
//
//
// **Rate limit:** 20 req / 1m0s
//
// Corresponds with GET /api/v0/equity/history/dividends (the `Dividends` operationId).
Dividends(ctx context.Context, params *DividendsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetReports List generated reports
//
// Retrieves a list of all requested CSV reports and their current status.
//
//
// **Asynchronous Workflow:**
//
// 1. Call `POST /history/exports` to request a report. You will receive a
// `reportId`.
//
// 2. Periodically call this endpoint (`GET /history/exports`) to check the
// `status` of the report corresponding to your `reportId`.
//
// 3. Once the status is `Finished`, the `downloadLink` field will contain
// a URL to download the CSV file.
//
// **Rate limit:** 1 req / 1m0s
//
// Corresponds with GET /api/v0/equity/history/exports (the `GetReports` operationId).
GetReports(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// RequestReportWithBody Request a CSV report
//
// Initiates the generation of a CSV report containing historical account
// data. This is an asynchronous operation. The response will include a
// `reportId` which you can use to track the status of the generation
// process using the `GET /history/exports` endpoint.
//
// **Rate limit:** 1 req / 30s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
RequestReportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// RequestReport Request a CSV report
//
// Initiates the generation of a CSV report containing historical account
// data. This is an asynchronous operation. The response will include a
// `reportId` which you can use to track the status of the generation
// process using the `GET /history/exports` endpoint.
//
// **Rate limit:** 1 req / 30s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
RequestReport(ctx context.Context, body RequestReportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// Orders1 Get historical orders data
//
//
//
// **Rate limit:** 20 req / 1m0s
//
// Corresponds with GET /api/v0/equity/history/orders (the `Orders1` operationId).
Orders1(ctx context.Context, params *Orders1Params, reqEditors ...RequestEditorFn) (*http.Response, error)
// Transactions Get transactions
//
// Fetch superficial information about movements to and from your account
//
// **Rate limit:** 20 req / 1m0s
//
// Corresponds with GET /api/v0/equity/history/transactions (the `Transactions` operationId).
Transactions(ctx context.Context, params *TransactionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// Exchanges Get exchanges metadata
//
// Retrieves all accessible exchanges and their corresponding working schedules.
// Data is refreshed every 10 minutes.
//
// **Rate limit:** 1 req / 30s
//
// Corresponds with GET /api/v0/equity/metadata/exchanges (the `Exchanges` operationId).
Exchanges(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// Instruments Get all available instruments
//
// Retrieves all accessible instruments.
// Data is refreshed every 10 minutes.
//
// **Rate limit:** 1 req / 50s
//
// Corresponds with GET /api/v0/equity/metadata/instruments (the `Instruments` operationId).
Instruments(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// Orders Get all pending orders
//
// Retrieves a list of all orders that are currently active (i.e., not yet
// filled, cancelled, or expired). This is useful for monitoring the status
// of your open positions and managing your trading strategy.
//
// **Rate limit:** 1 req / 5s
//
// Corresponds with GET /api/v0/equity/orders (the `Orders` operationId).
Orders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceLimitOrderWithBody Place a Limit order
//
// Creates a new Limit order, which executes at a specified price or
// better.
//
// - To place a **buy** order, use a positive `quantity`. The order will
// fill at the `limitPrice` or lower.
//
// - To place a **sell** order, use a negative `quantity`. The order will
// fill at the `limitPrice` or higher.
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
PlaceLimitOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceLimitOrder Place a Limit order
//
// Creates a new Limit order, which executes at a specified price or
// better.
//
// - To place a **buy** order, use a positive `quantity`. The order will
// fill at the `limitPrice` or lower.
//
// - To place a **sell** order, use a negative `quantity`. The order will
// fill at the `limitPrice` or higher.
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
PlaceLimitOrder(ctx context.Context, body PlaceLimitOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceMarketOrderWithBody Place a Market order
//
// Creates a new Market order, which is an instruction to trade a security
// immediately at the next available price.
//
// - To place a **buy** order, use a positive `quantity`.
//
// - To place a **sell** order, use a negative `quantity`.
//
//
// - **`extendedHours`**: Set to `true` to allow the order to be filled
// outside of the standard trading session.
//
// - If placed when the market is closed, the order will be queued to
// execute when the market next opens.
//
// x
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Warning:** Market orders can be subject to price slippage, where the
// final execution price may differ from the price at the time of order
// placement.
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 50 req / 1m0s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
PlaceMarketOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceMarketOrder Place a Market order
//
// Creates a new Market order, which is an instruction to trade a security
// immediately at the next available price.
//
// - To place a **buy** order, use a positive `quantity`.
//
// - To place a **sell** order, use a negative `quantity`.
//
//
// - **`extendedHours`**: Set to `true` to allow the order to be filled
// outside of the standard trading session.
//
// - If placed when the market is closed, the order will be queued to
// execute when the market next opens.
//
// x
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Warning:** Market orders can be subject to price slippage, where the
// final execution price may differ from the price at the time of order
// placement.
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 50 req / 1m0s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
PlaceMarketOrder(ctx context.Context, body PlaceMarketOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceStopOrder1WithBody Place a Stop order
//
// Creates a new Stop order, which places a Market order once the
// `stopPrice` is reached.
//
// - To place a **buy** stop order, use a positive `quantity`.
//
// - To place a **sell** stop order (commonly a 'stop-loss'), use a
// negative `quantity`.
//
//
// - The `stopPrice` is triggered by the instrument's **Last Traded Price
// (LTP)**.
//
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
PlaceStopOrder1WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceStopOrder1 Place a Stop order
//
// Creates a new Stop order, which places a Market order once the
// `stopPrice` is reached.
//
// - To place a **buy** stop order, use a positive `quantity`.
//
// - To place a **sell** stop order (commonly a 'stop-loss'), use a
// negative `quantity`.
//
//
// - The `stopPrice` is triggered by the instrument's **Last Traded Price
// (LTP)**.
//
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
PlaceStopOrder1(ctx context.Context, body PlaceStopOrder1JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceStopOrderWithBody Place a StopLimit order
//
// Creates a new Stop-Limit order, combining features of a Stop and a Limit
// order. The direction of the trade (buy/sell) is determined by the sign
// of the `quantity` field.
//
//
// **Execution Logic:**
//
// 1. When the instrument's **Last Traded Price (LTP)** reaches the
// specified `stopPrice`, the order is triggered.
//
// 2. A Limit order is then automatically placed at the specified
// `limitPrice`.
//
//
// This two-step process helps protect against price slippage that can
// occur with a standard Stop order.
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
PlaceStopOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PlaceStopOrder Place a StopLimit order
//
// Creates a new Stop-Limit order, combining features of a Stop and a Limit
// order. The direction of the trade (buy/sell) is determined by the sign
// of the `quantity` field.
//
//
// **Execution Logic:**
//
// 1. When the instrument's **Last Traded Price (LTP)** reaches the
// specified `stopPrice`, the order is triggered.
//
// 2. A Limit order is then automatically placed at the specified
// `limitPrice`.
//
//
// This two-step process helps protect against price slippage that can
// occur with a standard Stop order.
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
PlaceStopOrder(ctx context.Context, body PlaceStopOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelOrder Cancel a pending order
//
// Attempts to cancel an active, unfilled order by its unique ID.
// Cancellation is not guaranteed if the order is already in the process of
// being filled. A successful response indicates the cancellation request
// was accepted.
//
// **Rate limit:** 50 req / 1m0s
//
// Corresponds with DELETE /api/v0/equity/orders/{id} (the `CancelOrder` operationId).
CancelOrder(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
// OrderById Get a pending order by ID
//
// Retrieves a single pending order using its unique numerical ID. This is
// useful for checking the status of a specific order you have previously
// placed.
//
// **Rate limit:** 1 req / 1s
//
// Corresponds with GET /api/v0/equity/orders/{id} (the `OrderById` operationId).
OrderById(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetAll Fetch all pies
//
// Fetches all pies for the account
//
// **Rate limit:** 1 req / 30s
//
// Corresponds with GET /api/v0/equity/pies (the `GetAll` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
GetAll(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateWithBody Create pie
//
// Creates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/pies (the `Create` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
CreateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// Create Create pie
//
// Creates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/pies (the `Create` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Create(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// Delete Delete pie
//
// Deletes a pie by given id
//
// **Rate limit:** 1 req / 5s
//
// Corresponds with DELETE /api/v0/equity/pies/{id} (the `Delete` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Delete(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetDetailed Fetch a pie
//
// Fetches a pies for the account with detailed information
//
// **Rate limit:** 1 req / 5s
//
// Corresponds with GET /api/v0/equity/pies/{id} (the `GetDetailed` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
GetDetailed(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateWithBody Update pie
//
// Updates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
UpdateWithBody(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// Update Update pie
//
// Updates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Update(ctx context.Context, id int64, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DuplicatePieWithBody Duplicate pie
//
// Duplicates a pie for the account
//
// **Rate limit:** 1 req / 5s
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
DuplicatePieWithBody(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// DuplicatePie Duplicate pie
//
// Duplicates a pie for the account
//
// **Rate limit:** 1 req / 5s
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
DuplicatePie(ctx context.Context, id int64, body DuplicatePieJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetPositions Fetch all open positions
//
// Fetch all open positions for your account
//
// **Rate limit:** 1 req / 1s
//
// Corresponds with GET /api/v0/equity/positions (the `GetPositions` operationId).
GetPositions(ctx context.Context, params *GetPositionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) CancelOrderWithResponse ¶
func (c *ClientWithResponses) CancelOrderWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*CancelOrderResponse, error)
CancelOrderWithResponse Cancel a pending order
Attempts to cancel an active, unfilled order by its unique ID. Cancellation is not guaranteed if the order is already in the process of being filled. A successful response indicates the cancellation request was accepted.
**Rate limit:** 50 req / 1m0s
Returns a wrapper object for the known response body format(s).
Corresponds with DELETE /api/v0/equity/orders/{id} (the `CancelOrder` operationId).
func (*ClientWithResponses) CreateWithBodyWithResponse
deprecated
func (c *ClientWithResponses) CreateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)
CreateWithBodyWithResponse Create pie
Creates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/pies (the `Create` operationId).
Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) CreateWithResponse ¶
func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)
CreateWithResponse Create pie
Creates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/pies (the `Create` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) DeleteWithResponse
deprecated
func (c *ClientWithResponses) DeleteWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*DeleteResponse, error)
DeleteWithResponse Delete pie
Deletes a pie by given id ¶
**Rate limit:** 1 req / 5s
Returns a wrapper object for the known response body format(s).
Corresponds with DELETE /api/v0/equity/pies/{id} (the `Delete` operationId).
Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) DividendsWithResponse ¶
func (c *ClientWithResponses) DividendsWithResponse(ctx context.Context, params *DividendsParams, reqEditors ...RequestEditorFn) (*DividendsResponse, error)
DividendsWithResponse Get paid out dividends
**Rate limit:** 20 req / 1m0s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/history/dividends (the `Dividends` operationId).
func (*ClientWithResponses) DuplicatePieWithBodyWithResponse
deprecated
func (c *ClientWithResponses) DuplicatePieWithBodyWithResponse(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DuplicatePieResponse, error)
DuplicatePieWithBodyWithResponse Duplicate pie
Duplicates a pie for the account ¶
**Rate limit:** 1 req / 5s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId).
Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) DuplicatePieWithResponse ¶
func (c *ClientWithResponses) DuplicatePieWithResponse(ctx context.Context, id int64, body DuplicatePieJSONRequestBody, reqEditors ...RequestEditorFn) (*DuplicatePieResponse, error)
DuplicatePieWithResponse Duplicate pie
Duplicates a pie for the account ¶
**Rate limit:** 1 req / 5s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) ExchangesWithResponse ¶
func (c *ClientWithResponses) ExchangesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ExchangesResponse, error)
ExchangesWithResponse Get exchanges metadata
Retrieves all accessible exchanges and their corresponding working schedules. Data is refreshed every 10 minutes.
**Rate limit:** 1 req / 30s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/metadata/exchanges (the `Exchanges` operationId).
func (*ClientWithResponses) GetAccountSummaryWithResponse ¶
func (c *ClientWithResponses) GetAccountSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAccountSummaryResponse, error)
GetAccountSummaryWithResponse Get account summary
Provides a breakdown of your account's cash and investment metrics, including available funds, invested capital, and total account value.
**Rate limit:** 1 req / 5s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/account/summary (the `GetAccountSummary` operationId).
func (*ClientWithResponses) GetAllWithResponse
deprecated
func (c *ClientWithResponses) GetAllWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllResponse, error)
GetAllWithResponse Fetch all pies
Fetches all pies for the account ¶
**Rate limit:** 1 req / 30s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/pies (the `GetAll` operationId).
Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) GetDetailedWithResponse
deprecated
func (c *ClientWithResponses) GetDetailedWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*GetDetailedResponse, error)
GetDetailedWithResponse Fetch a pie
Fetches a pies for the account with detailed information ¶
**Rate limit:** 1 req / 5s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/pies/{id} (the `GetDetailed` operationId).
Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) GetPositionsWithResponse ¶
func (c *ClientWithResponses) GetPositionsWithResponse(ctx context.Context, params *GetPositionsParams, reqEditors ...RequestEditorFn) (*GetPositionsResponse, error)
GetPositionsWithResponse Fetch all open positions
Fetch all open positions for your account ¶
**Rate limit:** 1 req / 1s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/positions (the `GetPositions` operationId).
func (*ClientWithResponses) GetReportsWithResponse ¶
func (c *ClientWithResponses) GetReportsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetReportsResponse, error)
GetReportsWithResponse List generated reports
Retrieves a list of all requested CSV reports and their current status.
**Asynchronous Workflow:**
1. Call `POST /history/exports` to request a report. You will receive a `reportId`.
2. Periodically call this endpoint (`GET /history/exports`) to check the `status` of the report corresponding to your `reportId`.
3. Once the status is `Finished`, the `downloadLink` field will contain a URL to download the CSV file.
**Rate limit:** 1 req / 1m0s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/history/exports (the `GetReports` operationId).
func (*ClientWithResponses) InstrumentsWithResponse ¶
func (c *ClientWithResponses) InstrumentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstrumentsResponse, error)
InstrumentsWithResponse Get all available instruments
Retrieves all accessible instruments. Data is refreshed every 10 minutes.
**Rate limit:** 1 req / 50s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/metadata/instruments (the `Instruments` operationId).
func (*ClientWithResponses) OrderByIdWithResponse ¶
func (c *ClientWithResponses) OrderByIdWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*OrderByIdResponse, error)
OrderByIdWithResponse Get a pending order by ID
Retrieves a single pending order using its unique numerical ID. This is useful for checking the status of a specific order you have previously placed.
**Rate limit:** 1 req / 1s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/orders/{id} (the `OrderById` operationId).
func (*ClientWithResponses) Orders1WithResponse ¶
func (c *ClientWithResponses) Orders1WithResponse(ctx context.Context, params *Orders1Params, reqEditors ...RequestEditorFn) (*Orders1Response, error)
Orders1WithResponse Get historical orders data
**Rate limit:** 20 req / 1m0s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/history/orders (the `Orders1` operationId).
func (*ClientWithResponses) OrdersWithResponse ¶
func (c *ClientWithResponses) OrdersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrdersResponse, error)
OrdersWithResponse Get all pending orders
Retrieves a list of all orders that are currently active (i.e., not yet filled, cancelled, or expired). This is useful for monitoring the status of your open positions and managing your trading strategy.
**Rate limit:** 1 req / 5s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/orders (the `Orders` operationId).
func (*ClientWithResponses) PlaceLimitOrderWithBodyWithResponse ¶
func (c *ClientWithResponses) PlaceLimitOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceLimitOrderResponse, error)
PlaceLimitOrderWithBodyWithResponse Place a Limit order
Creates a new Limit order, which executes at a specified price or better.
- To place a **buy** order, use a positive `quantity`. The order will fill at the `limitPrice` or lower.
- To place a **sell** order, use a negative `quantity`. The order will fill at the `limitPrice` or higher.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
func (*ClientWithResponses) PlaceLimitOrderWithResponse ¶
func (c *ClientWithResponses) PlaceLimitOrderWithResponse(ctx context.Context, body PlaceLimitOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceLimitOrderResponse, error)
PlaceLimitOrderWithResponse Place a Limit order
Creates a new Limit order, which executes at a specified price or better.
- To place a **buy** order, use a positive `quantity`. The order will fill at the `limitPrice` or lower.
- To place a **sell** order, use a negative `quantity`. The order will fill at the `limitPrice` or higher.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
func (*ClientWithResponses) PlaceMarketOrderWithBodyWithResponse ¶
func (c *ClientWithResponses) PlaceMarketOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceMarketOrderResponse, error)
PlaceMarketOrderWithBodyWithResponse Place a Market order
Creates a new Market order, which is an instruction to trade a security immediately at the next available price.
- To place a **buy** order, use a positive `quantity`.
- To place a **sell** order, use a negative `quantity`.
- **`extendedHours`**: Set to `true` to allow the order to be filled outside of the standard trading session.
- If placed when the market is closed, the order will be queued to execute when the market next opens.
x **Order Limitations**
* Orders can be executed only in the **main account currency**
**Warning:** Market orders can be subject to price slippage, where the final execution price may differ from the price at the time of order placement.
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 50 req / 1m0s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
func (*ClientWithResponses) PlaceMarketOrderWithResponse ¶
func (c *ClientWithResponses) PlaceMarketOrderWithResponse(ctx context.Context, body PlaceMarketOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceMarketOrderResponse, error)
PlaceMarketOrderWithResponse Place a Market order
Creates a new Market order, which is an instruction to trade a security immediately at the next available price.
- To place a **buy** order, use a positive `quantity`.
- To place a **sell** order, use a negative `quantity`.
- **`extendedHours`**: Set to `true` to allow the order to be filled outside of the standard trading session.
- If placed when the market is closed, the order will be queued to execute when the market next opens.
x **Order Limitations**
* Orders can be executed only in the **main account currency**
**Warning:** Market orders can be subject to price slippage, where the final execution price may differ from the price at the time of order placement.
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 50 req / 1m0s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
func (*ClientWithResponses) PlaceStopOrder1WithBodyWithResponse ¶
func (c *ClientWithResponses) PlaceStopOrder1WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceStopOrder1Response, error)
PlaceStopOrder1WithBodyWithResponse Place a Stop order
Creates a new Stop order, which places a Market order once the `stopPrice` is reached.
- To place a **buy** stop order, use a positive `quantity`.
- To place a **sell** stop order (commonly a 'stop-loss'), use a negative `quantity`.
- The `stopPrice` is triggered by the instrument's **Last Traded Price (LTP)**.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
func (*ClientWithResponses) PlaceStopOrder1WithResponse ¶
func (c *ClientWithResponses) PlaceStopOrder1WithResponse(ctx context.Context, body PlaceStopOrder1JSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceStopOrder1Response, error)
PlaceStopOrder1WithResponse Place a Stop order
Creates a new Stop order, which places a Market order once the `stopPrice` is reached.
- To place a **buy** stop order, use a positive `quantity`.
- To place a **sell** stop order (commonly a 'stop-loss'), use a negative `quantity`.
- The `stopPrice` is triggered by the instrument's **Last Traded Price (LTP)**.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
func (*ClientWithResponses) PlaceStopOrderWithBodyWithResponse ¶
func (c *ClientWithResponses) PlaceStopOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceStopOrderResponse, error)
PlaceStopOrderWithBodyWithResponse Place a StopLimit order
Creates a new Stop-Limit order, combining features of a Stop and a Limit order. The direction of the trade (buy/sell) is determined by the sign of the `quantity` field.
**Execution Logic:**
1. When the instrument's **Last Traded Price (LTP)** reaches the specified `stopPrice`, the order is triggered.
2. A Limit order is then automatically placed at the specified `limitPrice`.
This two-step process helps protect against price slippage that can occur with a standard Stop order.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
func (*ClientWithResponses) PlaceStopOrderWithResponse ¶
func (c *ClientWithResponses) PlaceStopOrderWithResponse(ctx context.Context, body PlaceStopOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceStopOrderResponse, error)
PlaceStopOrderWithResponse Place a StopLimit order
Creates a new Stop-Limit order, combining features of a Stop and a Limit order. The direction of the trade (buy/sell) is determined by the sign of the `quantity` field.
**Execution Logic:**
1. When the instrument's **Last Traded Price (LTP)** reaches the specified `stopPrice`, the order is triggered.
2. A Limit order is then automatically placed at the specified `limitPrice`.
This two-step process helps protect against price slippage that can occur with a standard Stop order.
**Order Limitations**
* Orders can be executed only in the **main account currency**
**Important:** In this beta version, this endpoint is **not idempotent**. Sending the same request multiple times may result in duplicate orders.
**Rate limit:** 1 req / 2s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
func (*ClientWithResponses) RequestReportWithBodyWithResponse ¶
func (c *ClientWithResponses) RequestReportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestReportResponse, error)
RequestReportWithBodyWithResponse Request a CSV report
Initiates the generation of a CSV report containing historical account data. This is an asynchronous operation. The response will include a `reportId` which you can use to track the status of the generation process using the `GET /history/exports` endpoint.
**Rate limit:** 1 req / 30s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
func (*ClientWithResponses) RequestReportWithResponse ¶
func (c *ClientWithResponses) RequestReportWithResponse(ctx context.Context, body RequestReportJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestReportResponse, error)
RequestReportWithResponse Request a CSV report
Initiates the generation of a CSV report containing historical account data. This is an asynchronous operation. The response will include a `reportId` which you can use to track the status of the generation process using the `GET /history/exports` endpoint.
**Rate limit:** 1 req / 30s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
func (*ClientWithResponses) TransactionsWithResponse ¶
func (c *ClientWithResponses) TransactionsWithResponse(ctx context.Context, params *TransactionsParams, reqEditors ...RequestEditorFn) (*TransactionsResponse, error)
TransactionsWithResponse Get transactions
Fetch superficial information about movements to and from your account ¶
**Rate limit:** 20 req / 1m0s
Returns a wrapper object for the known response body format(s).
Corresponds with GET /api/v0/equity/history/transactions (the `Transactions` operationId).
func (*ClientWithResponses) UpdateWithBodyWithResponse
deprecated
func (c *ClientWithResponses) UpdateWithBodyWithResponse(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
UpdateWithBodyWithResponse Update pie
Updates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId).
Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
func (*ClientWithResponses) UpdateWithResponse ¶
func (c *ClientWithResponses) UpdateWithResponse(ctx context.Context, id int64, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
UpdateWithResponse Update pie
Updates a pie for the account by given params ¶
**Rate limit:** 1 req / 5s
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId). Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetAccountSummaryWithResponse Get account summary
//
// Provides a breakdown of your account's cash and investment metrics,
// including available funds, invested capital, and total account value.
//
// **Rate limit:** 1 req / 5s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/account/summary (the `GetAccountSummary` operationId).
GetAccountSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAccountSummaryResponse, error)
// DividendsWithResponse Get paid out dividends
//
//
//
// **Rate limit:** 20 req / 1m0s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/history/dividends (the `Dividends` operationId).
DividendsWithResponse(ctx context.Context, params *DividendsParams, reqEditors ...RequestEditorFn) (*DividendsResponse, error)
// GetReportsWithResponse List generated reports
//
// Retrieves a list of all requested CSV reports and their current status.
//
//
// **Asynchronous Workflow:**
//
// 1. Call `POST /history/exports` to request a report. You will receive a
// `reportId`.
//
// 2. Periodically call this endpoint (`GET /history/exports`) to check the
// `status` of the report corresponding to your `reportId`.
//
// 3. Once the status is `Finished`, the `downloadLink` field will contain
// a URL to download the CSV file.
//
// **Rate limit:** 1 req / 1m0s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/history/exports (the `GetReports` operationId).
GetReportsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetReportsResponse, error)
// RequestReportWithBodyWithResponse Request a CSV report
//
// Initiates the generation of a CSV report containing historical account
// data. This is an asynchronous operation. The response will include a
// `reportId` which you can use to track the status of the generation
// process using the `GET /history/exports` endpoint.
//
// **Rate limit:** 1 req / 30s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
RequestReportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestReportResponse, error)
// RequestReportWithResponse Request a CSV report
//
// Initiates the generation of a CSV report containing historical account
// data. This is an asynchronous operation. The response will include a
// `reportId` which you can use to track the status of the generation
// process using the `GET /history/exports` endpoint.
//
// **Rate limit:** 1 req / 30s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/history/exports (the `RequestReport` operationId).
RequestReportWithResponse(ctx context.Context, body RequestReportJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestReportResponse, error)
// Orders1WithResponse Get historical orders data
//
//
//
// **Rate limit:** 20 req / 1m0s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/history/orders (the `Orders1` operationId).
Orders1WithResponse(ctx context.Context, params *Orders1Params, reqEditors ...RequestEditorFn) (*Orders1Response, error)
// TransactionsWithResponse Get transactions
//
// Fetch superficial information about movements to and from your account
//
// **Rate limit:** 20 req / 1m0s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/history/transactions (the `Transactions` operationId).
TransactionsWithResponse(ctx context.Context, params *TransactionsParams, reqEditors ...RequestEditorFn) (*TransactionsResponse, error)
// ExchangesWithResponse Get exchanges metadata
//
// Retrieves all accessible exchanges and their corresponding working schedules.
// Data is refreshed every 10 minutes.
//
// **Rate limit:** 1 req / 30s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/metadata/exchanges (the `Exchanges` operationId).
ExchangesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ExchangesResponse, error)
// InstrumentsWithResponse Get all available instruments
//
// Retrieves all accessible instruments.
// Data is refreshed every 10 minutes.
//
// **Rate limit:** 1 req / 50s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/metadata/instruments (the `Instruments` operationId).
InstrumentsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstrumentsResponse, error)
// OrdersWithResponse Get all pending orders
//
// Retrieves a list of all orders that are currently active (i.e., not yet
// filled, cancelled, or expired). This is useful for monitoring the status
// of your open positions and managing your trading strategy.
//
// **Rate limit:** 1 req / 5s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/orders (the `Orders` operationId).
OrdersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*OrdersResponse, error)
// PlaceLimitOrderWithBodyWithResponse Place a Limit order
//
// Creates a new Limit order, which executes at a specified price or
// better.
//
// - To place a **buy** order, use a positive `quantity`. The order will
// fill at the `limitPrice` or lower.
//
// - To place a **sell** order, use a negative `quantity`. The order will
// fill at the `limitPrice` or higher.
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
PlaceLimitOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceLimitOrderResponse, error)
// PlaceLimitOrderWithResponse Place a Limit order
//
// Creates a new Limit order, which executes at a specified price or
// better.
//
// - To place a **buy** order, use a positive `quantity`. The order will
// fill at the `limitPrice` or lower.
//
// - To place a **sell** order, use a negative `quantity`. The order will
// fill at the `limitPrice` or higher.
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/limit (the `PlaceLimitOrder` operationId).
PlaceLimitOrderWithResponse(ctx context.Context, body PlaceLimitOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceLimitOrderResponse, error)
// PlaceMarketOrderWithBodyWithResponse Place a Market order
//
// Creates a new Market order, which is an instruction to trade a security
// immediately at the next available price.
//
// - To place a **buy** order, use a positive `quantity`.
//
// - To place a **sell** order, use a negative `quantity`.
//
//
// - **`extendedHours`**: Set to `true` to allow the order to be filled
// outside of the standard trading session.
//
// - If placed when the market is closed, the order will be queued to
// execute when the market next opens.
//
// x
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Warning:** Market orders can be subject to price slippage, where the
// final execution price may differ from the price at the time of order
// placement.
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 50 req / 1m0s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
PlaceMarketOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceMarketOrderResponse, error)
// PlaceMarketOrderWithResponse Place a Market order
//
// Creates a new Market order, which is an instruction to trade a security
// immediately at the next available price.
//
// - To place a **buy** order, use a positive `quantity`.
//
// - To place a **sell** order, use a negative `quantity`.
//
//
// - **`extendedHours`**: Set to `true` to allow the order to be filled
// outside of the standard trading session.
//
// - If placed when the market is closed, the order will be queued to
// execute when the market next opens.
//
// x
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Warning:** Market orders can be subject to price slippage, where the
// final execution price may differ from the price at the time of order
// placement.
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 50 req / 1m0s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/market (the `PlaceMarketOrder` operationId).
PlaceMarketOrderWithResponse(ctx context.Context, body PlaceMarketOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceMarketOrderResponse, error)
// PlaceStopOrder1WithBodyWithResponse Place a Stop order
//
// Creates a new Stop order, which places a Market order once the
// `stopPrice` is reached.
//
// - To place a **buy** stop order, use a positive `quantity`.
//
// - To place a **sell** stop order (commonly a 'stop-loss'), use a
// negative `quantity`.
//
//
// - The `stopPrice` is triggered by the instrument's **Last Traded Price
// (LTP)**.
//
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
PlaceStopOrder1WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceStopOrder1Response, error)
// PlaceStopOrder1WithResponse Place a Stop order
//
// Creates a new Stop order, which places a Market order once the
// `stopPrice` is reached.
//
// - To place a **buy** stop order, use a positive `quantity`.
//
// - To place a **sell** stop order (commonly a 'stop-loss'), use a
// negative `quantity`.
//
//
// - The `stopPrice` is triggered by the instrument's **Last Traded Price
// (LTP)**.
//
//
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/stop (the `PlaceStopOrder1` operationId).
PlaceStopOrder1WithResponse(ctx context.Context, body PlaceStopOrder1JSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceStopOrder1Response, error)
// PlaceStopOrderWithBodyWithResponse Place a StopLimit order
//
// Creates a new Stop-Limit order, combining features of a Stop and a Limit
// order. The direction of the trade (buy/sell) is determined by the sign
// of the `quantity` field.
//
//
// **Execution Logic:**
//
// 1. When the instrument's **Last Traded Price (LTP)** reaches the
// specified `stopPrice`, the order is triggered.
//
// 2. A Limit order is then automatically placed at the specified
// `limitPrice`.
//
//
// This two-step process helps protect against price slippage that can
// occur with a standard Stop order.
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
PlaceStopOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PlaceStopOrderResponse, error)
// PlaceStopOrderWithResponse Place a StopLimit order
//
// Creates a new Stop-Limit order, combining features of a Stop and a Limit
// order. The direction of the trade (buy/sell) is determined by the sign
// of the `quantity` field.
//
//
// **Execution Logic:**
//
// 1. When the instrument's **Last Traded Price (LTP)** reaches the
// specified `stopPrice`, the order is triggered.
//
// 2. A Limit order is then automatically placed at the specified
// `limitPrice`.
//
//
// This two-step process helps protect against price slippage that can
// occur with a standard Stop order.
//
//
// **Order Limitations**
//
// * Orders can be executed only in the **main account currency**
//
//
// **Important:** In this beta version, this endpoint is **not
// idempotent**. Sending the same request multiple times may result in
// duplicate orders.
//
// **Rate limit:** 1 req / 2s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/orders/stop_limit (the `PlaceStopOrder` operationId).
PlaceStopOrderWithResponse(ctx context.Context, body PlaceStopOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*PlaceStopOrderResponse, error)
// CancelOrderWithResponse Cancel a pending order
//
// Attempts to cancel an active, unfilled order by its unique ID.
// Cancellation is not guaranteed if the order is already in the process of
// being filled. A successful response indicates the cancellation request
// was accepted.
//
// **Rate limit:** 50 req / 1m0s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/v0/equity/orders/{id} (the `CancelOrder` operationId).
CancelOrderWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*CancelOrderResponse, error)
// OrderByIdWithResponse Get a pending order by ID
//
// Retrieves a single pending order using its unique numerical ID. This is
// useful for checking the status of a specific order you have previously
// placed.
//
// **Rate limit:** 1 req / 1s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/orders/{id} (the `OrderById` operationId).
OrderByIdWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*OrderByIdResponse, error)
// GetAllWithResponse Fetch all pies
//
// Fetches all pies for the account
//
// **Rate limit:** 1 req / 30s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/pies (the `GetAll` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
GetAllWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAllResponse, error)
// CreateWithBodyWithResponse Create pie
//
// Creates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/pies (the `Create` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
CreateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)
// CreateWithResponse Create pie
//
// Creates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/pies (the `Create` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
CreateWithResponse(ctx context.Context, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)
// DeleteWithResponse Delete pie
//
// Deletes a pie by given id
//
// **Rate limit:** 1 req / 5s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/v0/equity/pies/{id} (the `Delete` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
DeleteWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*DeleteResponse, error)
// GetDetailedWithResponse Fetch a pie
//
// Fetches a pies for the account with detailed information
//
// **Rate limit:** 1 req / 5s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/pies/{id} (the `GetDetailed` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
GetDetailedWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*GetDetailedResponse, error)
// UpdateWithBodyWithResponse Update pie
//
// Updates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
UpdateWithBodyWithResponse(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
// UpdateWithResponse Update pie
//
// Updates a pie for the account by given params
//
// **Rate limit:** 1 req / 5s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/pies/{id} (the `Update` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
UpdateWithResponse(ctx context.Context, id int64, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
// DuplicatePieWithBodyWithResponse Duplicate pie
//
// Duplicates a pie for the account
//
// **Rate limit:** 1 req / 5s
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
DuplicatePieWithBodyWithResponse(ctx context.Context, id int64, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DuplicatePieResponse, error)
// DuplicatePieWithResponse Duplicate pie
//
// Duplicates a pie for the account
//
// **Rate limit:** 1 req / 5s
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/v0/equity/pies/{id}/duplicate (the `DuplicatePie` operationId).
//
// Deprecated: this operation has been marked as deprecated upstream, but no `x-deprecated-reason` was set
DuplicatePieWithResponse(ctx context.Context, id int64, body DuplicatePieJSONRequestBody, reqEditors ...RequestEditorFn) (*DuplicatePieResponse, error)
// GetPositionsWithResponse Fetch all open positions
//
// Fetch all open positions for your account
//
// **Rate limit:** 1 req / 1s
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/v0/equity/positions (the `GetPositions` operationId).
GetPositionsWithResponse(ctx context.Context, params *GetPositionsParams, reqEditors ...RequestEditorFn) (*GetPositionsResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateJSONRequestBody
deprecated
type CreateJSONRequestBody = PieRequest
CreateJSONRequestBody defines body for Create for application/json ContentType.
Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set
type CreateResponse ¶
type CreateResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AccountBucketInstrumentsDetailedResponse
}
func ParseCreateResponse ¶
func ParseCreateResponse(rsp *http.Response) (*CreateResponse, error)
ParseCreateResponse parses an HTTP response from a CreateWithResponse call
func (CreateResponse) ContentType ¶
func (r CreateResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CreateResponse) GetBody ¶
func (r CreateResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CreateResponse) GetJSON200 ¶
func (r CreateResponse) GetJSON200() *AccountBucketInstrumentsDetailedResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (CreateResponse) Status ¶
func (r CreateResponse) Status() string
Status returns HTTPResponse.Status
func (CreateResponse) StatusCode ¶
func (r CreateResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DeleteResponse ¶
func ParseDeleteResponse ¶
func ParseDeleteResponse(rsp *http.Response) (*DeleteResponse, error)
ParseDeleteResponse parses an HTTP response from a DeleteWithResponse call
func (DeleteResponse) ContentType ¶
func (r DeleteResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (DeleteResponse) GetBody ¶
func (r DeleteResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (DeleteResponse) Status ¶
func (r DeleteResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteResponse) StatusCode ¶
func (r DeleteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DividendDetails ¶
type DividendDetails struct {
Gained *float64 `json:"gained,omitempty"`
InCash *float64 `json:"inCash,omitempty"`
Reinvested *float64 `json:"reinvested,omitempty"`
}
DividendDetails defines model for DividendDetails.
type DividendsParams ¶
type DividendsParams struct {
// Cursor Pagination cursor
Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`
// Ticker Ticker filter
Ticker *string `form:"ticker,omitempty" json:"ticker,omitempty"`
// Limit Max items: 50
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}
DividendsParams defines parameters for Dividends.
type DividendsResponse ¶
type DividendsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PaginatedResponseHistoryDividendItem
}
func ParseDividendsResponse ¶
func ParseDividendsResponse(rsp *http.Response) (*DividendsResponse, error)
ParseDividendsResponse parses an HTTP response from a DividendsWithResponse call
func (DividendsResponse) ContentType ¶
func (r DividendsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (DividendsResponse) GetBody ¶
func (r DividendsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (DividendsResponse) GetJSON200 ¶
func (r DividendsResponse) GetJSON200() *PaginatedResponseHistoryDividendItem
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (DividendsResponse) Status ¶
func (r DividendsResponse) Status() string
Status returns HTTPResponse.Status
func (DividendsResponse) StatusCode ¶
func (r DividendsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DuplicateBucketRequest ¶
type DuplicateBucketRequest struct {
Icon *string `json:"icon,omitempty"`
Name *string `json:"name,omitempty"`
}
DuplicateBucketRequest defines model for DuplicateBucketRequest.
type DuplicatePieJSONRequestBody
deprecated
type DuplicatePieJSONRequestBody = DuplicateBucketRequest
DuplicatePieJSONRequestBody defines body for DuplicatePie for application/json ContentType.
Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set
type DuplicatePieResponse ¶
type DuplicatePieResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AccountBucketInstrumentsDetailedResponse
}
func ParseDuplicatePieResponse ¶
func ParseDuplicatePieResponse(rsp *http.Response) (*DuplicatePieResponse, error)
ParseDuplicatePieResponse parses an HTTP response from a DuplicatePieWithResponse call
func (DuplicatePieResponse) ContentType ¶
func (r DuplicatePieResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (DuplicatePieResponse) GetBody ¶
func (r DuplicatePieResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (DuplicatePieResponse) GetJSON200 ¶
func (r DuplicatePieResponse) GetJSON200() *AccountBucketInstrumentsDetailedResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (DuplicatePieResponse) Status ¶
func (r DuplicatePieResponse) Status() string
Status returns HTTPResponse.Status
func (DuplicatePieResponse) StatusCode ¶
func (r DuplicatePieResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type EnqueuedReportResponse ¶
type EnqueuedReportResponse struct {
ReportId *int64 `json:"reportId,omitempty"`
}
EnqueuedReportResponse defines model for EnqueuedReportResponse.
type Exchange ¶
type Exchange struct {
Id *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
WorkingSchedules *[]WorkingSchedule `json:"workingSchedules,omitempty"`
}
Exchange defines model for Exchange.
type ExchangesResponse ¶
type ExchangesResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]Exchange
}
func ParseExchangesResponse ¶
func ParseExchangesResponse(rsp *http.Response) (*ExchangesResponse, error)
ParseExchangesResponse parses an HTTP response from a ExchangesWithResponse call
func (ExchangesResponse) ContentType ¶
func (r ExchangesResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ExchangesResponse) GetBody ¶
func (r ExchangesResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ExchangesResponse) GetJSON200 ¶
func (r ExchangesResponse) GetJSON200() *[]Exchange
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ExchangesResponse) Status ¶
func (r ExchangesResponse) Status() string
Status returns HTTPResponse.Status
func (ExchangesResponse) StatusCode ¶
func (r ExchangesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Fill ¶
type Fill struct {
FilledAt *time.Time `json:"filledAt,omitempty"`
Id *int64 `json:"id,omitempty"`
Price *float64 `json:"price,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
TradingMethod *FillTradingMethod `json:"tradingMethod,omitempty"`
Type *FillType `json:"type,omitempty"`
WalletImpact *FillWalletImpact `json:"walletImpact,omitempty"`
}
Fill defines model for Fill.
type FillTradingMethod ¶
type FillTradingMethod string
FillTradingMethod defines model for Fill.TradingMethod.
const ( FillTradingMethodOTC FillTradingMethod = "OTC" FillTradingMethodTOTV FillTradingMethod = "TOTV" )
Defines values for FillTradingMethod.
func (FillTradingMethod) Valid ¶
func (e FillTradingMethod) Valid() bool
Valid indicates whether the value is a known member of the FillTradingMethod enum.
type FillType ¶
type FillType string
FillType defines model for Fill.Type.
const ( FillTypeCASHANDSTOCKACQUISITION FillType = "CASH_AND_STOCK_ACQUISITION" FillTypeCUSTOMSTOCKDISTRIBUTION FillType = "CUSTOM_STOCK_DISTRIBUTION" FillTypeEQUITYRIGHTS FillType = "EQUITY_RIGHTS" FillTypeFOP FillType = "FOP" FillTypeFOPCORRECTION FillType = "FOP_CORRECTION" FillTypeSCRIPSTOCKDIVIDENDS FillType = "SCRIP_STOCK_DIVIDENDS" FillTypeSPINOFF FillType = "SPIN_OFF" FillTypeSTOCKACQUISITION FillType = "STOCK_ACQUISITION" FillTypeSTOCKDISTRIBUTION FillType = "STOCK_DISTRIBUTION" FillTypeSTOCKDIVIDENDS FillType = "STOCK_DIVIDENDS" FillTypeSTOCKSPLIT FillType = "STOCK_SPLIT" FillTypeTRADE FillType = "TRADE" )
Defines values for FillType.
type FillWalletImpact ¶
type FillWalletImpact struct {
Currency *string `json:"currency,omitempty"`
FxRate *float64 `json:"fxRate,omitempty"`
NetValue *float64 `json:"netValue,omitempty"`
RealisedProfitLoss *float64 `json:"realisedProfitLoss,omitempty"`
Taxes *[]Tax `json:"taxes,omitempty"`
}
FillWalletImpact defines model for FillWalletImpact.
type GetAccountSummaryResponse ¶
type GetAccountSummaryResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AccountSummary
}
func ParseGetAccountSummaryResponse ¶
func ParseGetAccountSummaryResponse(rsp *http.Response) (*GetAccountSummaryResponse, error)
ParseGetAccountSummaryResponse parses an HTTP response from a GetAccountSummaryWithResponse call
func (GetAccountSummaryResponse) ContentType ¶
func (r GetAccountSummaryResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetAccountSummaryResponse) GetBody ¶
func (r GetAccountSummaryResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetAccountSummaryResponse) GetJSON200 ¶
func (r GetAccountSummaryResponse) GetJSON200() *AccountSummary
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetAccountSummaryResponse) Status ¶
func (r GetAccountSummaryResponse) Status() string
Status returns HTTPResponse.Status
func (GetAccountSummaryResponse) StatusCode ¶
func (r GetAccountSummaryResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetAllResponse ¶
type GetAllResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]AccountBucketResultResponse
}
func ParseGetAllResponse ¶
func ParseGetAllResponse(rsp *http.Response) (*GetAllResponse, error)
ParseGetAllResponse parses an HTTP response from a GetAllWithResponse call
func (GetAllResponse) ContentType ¶
func (r GetAllResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetAllResponse) GetBody ¶
func (r GetAllResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetAllResponse) GetJSON200 ¶
func (r GetAllResponse) GetJSON200() *[]AccountBucketResultResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetAllResponse) Status ¶
func (r GetAllResponse) Status() string
Status returns HTTPResponse.Status
func (GetAllResponse) StatusCode ¶
func (r GetAllResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetDetailedResponse ¶
type GetDetailedResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AccountBucketInstrumentsDetailedResponse
}
func ParseGetDetailedResponse ¶
func ParseGetDetailedResponse(rsp *http.Response) (*GetDetailedResponse, error)
ParseGetDetailedResponse parses an HTTP response from a GetDetailedWithResponse call
func (GetDetailedResponse) ContentType ¶
func (r GetDetailedResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetDetailedResponse) GetBody ¶
func (r GetDetailedResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetDetailedResponse) GetJSON200 ¶
func (r GetDetailedResponse) GetJSON200() *AccountBucketInstrumentsDetailedResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetDetailedResponse) Status ¶
func (r GetDetailedResponse) Status() string
Status returns HTTPResponse.Status
func (GetDetailedResponse) StatusCode ¶
func (r GetDetailedResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetPositionsParams ¶
type GetPositionsParams struct {
Ticker *string `form:"ticker,omitempty" json:"ticker,omitempty"`
}
GetPositionsParams defines parameters for GetPositions.
type GetPositionsResponse ¶
type GetPositionsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]Position
}
func ParseGetPositionsResponse ¶
func ParseGetPositionsResponse(rsp *http.Response) (*GetPositionsResponse, error)
ParseGetPositionsResponse parses an HTTP response from a GetPositionsWithResponse call
func (GetPositionsResponse) ContentType ¶
func (r GetPositionsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetPositionsResponse) GetBody ¶
func (r GetPositionsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetPositionsResponse) GetJSON200 ¶
func (r GetPositionsResponse) GetJSON200() *[]Position
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetPositionsResponse) Status ¶
func (r GetPositionsResponse) Status() string
Status returns HTTPResponse.Status
func (GetPositionsResponse) StatusCode ¶
func (r GetPositionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetReportsResponse ¶
type GetReportsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]ReportResponse
}
func ParseGetReportsResponse ¶
func ParseGetReportsResponse(rsp *http.Response) (*GetReportsResponse, error)
ParseGetReportsResponse parses an HTTP response from a GetReportsWithResponse call
func (GetReportsResponse) ContentType ¶
func (r GetReportsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetReportsResponse) GetBody ¶
func (r GetReportsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetReportsResponse) GetJSON200 ¶
func (r GetReportsResponse) GetJSON200() *[]ReportResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetReportsResponse) Status ¶
func (r GetReportsResponse) Status() string
Status returns HTTPResponse.Status
func (GetReportsResponse) StatusCode ¶
func (r GetReportsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HistoricalOrder ¶
type HistoricalOrder struct {
Fill *Fill `json:"fill,omitempty"`
Order *Order `json:"order,omitempty"`
}
HistoricalOrder defines model for HistoricalOrder.
type HistoryDividendItem ¶
type HistoryDividendItem struct {
// Amount In account's primary currency.
Amount *float64 `json:"amount,omitempty"`
AmountInEuro *float64 `json:"amountInEuro,omitempty"`
// Currency The account's primary currency.
Currency *string `json:"currency,omitempty"`
GrossAmountPerShare *float64 `json:"grossAmountPerShare,omitempty"`
// Instrument Instrument information as given by /instruments endpoint.
Instrument *Instrument `json:"instrument,omitempty"`
PaidOn *time.Time `json:"paidOn,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
Reference *string `json:"reference,omitempty"`
Ticker *string `json:"ticker,omitempty"`
TickerCurrency *string `json:"tickerCurrency,omitempty"`
Type *HistoryDividendItemType `json:"type,omitempty"`
}
HistoryDividendItem defines model for HistoryDividendItem.
type HistoryDividendItemType ¶
type HistoryDividendItemType string
HistoryDividendItemType defines model for HistoryDividendItem.Type.
const ( HistoryDividendItemTypeBONUS HistoryDividendItemType = "BONUS" HistoryDividendItemTypeBONUSMANUFACTUREDPAYMENT HistoryDividendItemType = "BONUS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeCAPITALGAINS HistoryDividendItemType = "CAPITAL_GAINS" HistoryDividendItemTypeCAPITALGAINSDISTRIBUTION HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION" HistoryDividendItemTypeCAPITALGAINSDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION_MANUFACTURED_PAYMENT" HistoryDividendItemTypeCAPITALGAINSDISTRIBUTIONNONUS HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION_NON_US" HistoryDividendItemTypeCAPITALGAINSDISTRIBUTIONNONUSMANUFACTUREDPAYMENT HistoryDividendItemType = "CAPITAL_GAINS_DISTRIBUTION_NON_US_MANUFACTURED_PAYMENT" HistoryDividendItemTypeCAPITALGAINSMANUFACTUREDPAYMENT HistoryDividendItemType = "CAPITAL_GAINS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeDEMERGER HistoryDividendItemType = "DEMERGER" HistoryDividendItemTypeDEMERGERMANUFACTUREDPAYMENT HistoryDividendItemType = "DEMERGER_MANUFACTURED_PAYMENT" HistoryDividendItemTypeDIVIDEND HistoryDividendItemType = "DIVIDEND" HistoryDividendItemTypeDIVIDENDMANUFACTUREDPAYMENT HistoryDividendItemType = "DIVIDEND_MANUFACTURED_PAYMENT" HistoryDividendItemTypeDIVIDENDSPAIDBYFOREIGNCORPORATIONS HistoryDividendItemType = "DIVIDENDS_PAID_BY_FOREIGN_CORPORATIONS" HistoryDividendItemTypeDIVIDENDSPAIDBYFOREIGNCORPORATIONSMANUFACTUREDPAYMENT HistoryDividendItemType = "DIVIDENDS_PAID_BY_FOREIGN_CORPORATIONS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeDIVIDENDSPAIDBYUSCORPORATIONS HistoryDividendItemType = "DIVIDENDS_PAID_BY_US_CORPORATIONS" HistoryDividendItemTypeDIVIDENDSPAIDBYUSCORPORATIONSMANUFACTUREDPAYMENT HistoryDividendItemType = "DIVIDENDS_PAID_BY_US_CORPORATIONS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeINTEREST HistoryDividendItemType = "INTEREST" HistoryDividendItemTypeINTERESTMANUFACTUREDPAYMENT HistoryDividendItemType = "INTEREST_MANUFACTURED_PAYMENT" HistoryDividendItemTypeINTERESTPAIDBYFOREIGNCORPORATIONS HistoryDividendItemType = "INTEREST_PAID_BY_FOREIGN_CORPORATIONS" HistoryDividendItemTypeINTERESTPAIDBYFOREIGNCORPORATIONSMANUFACTUREDPAYMENT HistoryDividendItemType = "INTEREST_PAID_BY_FOREIGN_CORPORATIONS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeINTERESTPAIDBYUSOBLIGORS HistoryDividendItemType = "INTEREST_PAID_BY_US_OBLIGORS" HistoryDividendItemTypeINTERESTPAIDBYUSOBLIGORSMANUFACTUREDPAYMENT HistoryDividendItemType = "INTEREST_PAID_BY_US_OBLIGORS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeINTERIMLIQUIDATION HistoryDividendItemType = "INTERIM_LIQUIDATION" HistoryDividendItemTypeINTERIMLIQUIDATIONMANUFACTUREDPAYMENT HistoryDividendItemType = "INTERIM_LIQUIDATION_MANUFACTURED_PAYMENT" HistoryDividendItemTypeLONGTERMCAPITALGAINS HistoryDividendItemType = "LONG_TERM_CAPITAL_GAINS" HistoryDividendItemTypeLONGTERMCAPITALGAINSMANUFACTUREDPAYMENT HistoryDividendItemType = "LONG_TERM_CAPITAL_GAINS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeMULTIPLE1042STAXCOMPONENTS HistoryDividendItemType = "MULTIPLE_1042S_TAX_COMPONENTS" HistoryDividendItemTypeMULTIPLE1042STAXCOMPONENTSMANUFACTUREDPAYMENT HistoryDividendItemType = "MULTIPLE_1042S_TAX_COMPONENTS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeORDINARY HistoryDividendItemType = "ORDINARY" HistoryDividendItemTypeORDINARYMANUFACTUREDPAYMENT HistoryDividendItemType = "ORDINARY_MANUFACTURED_PAYMENT" HistoryDividendItemTypeOTHERDIVIDENDEQUIVALENT HistoryDividendItemType = "OTHER_DIVIDEND_EQUIVALENT" HistoryDividendItemTypeOTHERDIVIDENDEQUIVALENTMANUFACTUREDPAYMENT HistoryDividendItemType = "OTHER_DIVIDEND_EQUIVALENT_MANUFACTURED_PAYMENT" HistoryDividendItemTypeOTHERINCOME HistoryDividendItemType = "OTHER_INCOME" HistoryDividendItemTypeOTHERINCOMEMANUFACTUREDPAYMENT HistoryDividendItemType = "OTHER_INCOME_MANUFACTURED_PAYMENT" HistoryDividendItemTypePROPERTYINCOME HistoryDividendItemType = "PROPERTY_INCOME" HistoryDividendItemTypePROPERTYINCOMEDISTRIBUTION HistoryDividendItemType = "PROPERTY_INCOME_DISTRIBUTION" HistoryDividendItemTypePROPERTYINCOMEDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "PROPERTY_INCOME_DISTRIBUTION_MANUFACTURED_PAYMENT" HistoryDividendItemTypePROPERTYINCOMEMANUFACTUREDPAYMENT HistoryDividendItemType = "PROPERTY_INCOME_MANUFACTURED_PAYMENT" HistoryDividendItemTypePTPUNCHARACTERISEDINCOME HistoryDividendItemType = "PTP_UNCHARACTERISED_INCOME" HistoryDividendItemTypePTPUNCHARACTERISEDINCOMEMANUFACTUREDPAYMENT HistoryDividendItemType = "PTP_UNCHARACTERISED_INCOME_MANUFACTURED_PAYMENT" HistoryDividendItemTypePUBLICLYTRADEDPARTNERSHIPDISTRIBUTION HistoryDividendItemType = "PUBLICLY_TRADED_PARTNERSHIP_DISTRIBUTION" HistoryDividendItemTypePUBLICLYTRADEDPARTNERSHIPDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "PUBLICLY_TRADED_PARTNERSHIP_DISTRIBUTION_MANUFACTURED_PAYMENT" HistoryDividendItemTypeQUALIFIEDINVESTMENTENTITY HistoryDividendItemType = "QUALIFIED_INVESTMENT_ENTITY" HistoryDividendItemTypeQUALIFIEDINVESTMENTENTITYMANUFACTUREDPAYMENT HistoryDividendItemType = "QUALIFIED_INVESTMENT_ENTITY_MANUFACTURED_PAYMENT" HistoryDividendItemTypeREALPROPERTYINCOMEANDNATURALRESOURCESROYALTIES HistoryDividendItemType = "REAL_PROPERTY_INCOME_AND_NATURAL_RESOURCES_ROYALTIES" HistoryDividendItemTypeREALPROPERTYINCOMEANDNATURALRESOURCESROYALTIESMANUFACTUREDPAYMENT HistoryDividendItemType = "REAL_PROPERTY_INCOME_AND_NATURAL_RESOURCES_ROYALTIES_MANUFACTURED_PAYMENT" HistoryDividendItemTypeRETURNOFCAPITAL HistoryDividendItemType = "RETURN_OF_CAPITAL" HistoryDividendItemTypeRETURNOFCAPITALMANUFACTUREDPAYMENT HistoryDividendItemType = "RETURN_OF_CAPITAL_MANUFACTURED_PAYMENT" HistoryDividendItemTypeRETURNOFCAPITALNONUS HistoryDividendItemType = "RETURN_OF_CAPITAL_NON_US" HistoryDividendItemTypeRETURNOFCAPITALNONUSMANUFACTUREDPAYMENT HistoryDividendItemType = "RETURN_OF_CAPITAL_NON_US_MANUFACTURED_PAYMENT" HistoryDividendItemTypeSHORTTERMCAPITALGAINS HistoryDividendItemType = "SHORT_TERM_CAPITAL_GAINS" HistoryDividendItemTypeSHORTTERMCAPITALGAINSMANUFACTUREDPAYMENT HistoryDividendItemType = "SHORT_TERM_CAPITAL_GAINS_MANUFACTURED_PAYMENT" HistoryDividendItemTypeTAXEVENT1446FFORPUBLICLYTRADEDSECURITIES HistoryDividendItemType = "TAX_EVENT_1446F_FOR_PUBLICLY_TRADED_SECURITIES" HistoryDividendItemTypeTAXEVENT1446FFORPUBLICLYTRADEDSECURITIESMANUFACTUREDPAYMENT HistoryDividendItemType = "TAX_EVENT_1446F_FOR_PUBLICLY_TRADED_SECURITIES_MANUFACTURED_PAYMENT" HistoryDividendItemTypeTAXEXEMPTED HistoryDividendItemType = "TAX_EXEMPTED" HistoryDividendItemTypeTAXEXEMPTEDMANUFACTUREDPAYMENT HistoryDividendItemType = "TAX_EXEMPTED_MANUFACTURED_PAYMENT" HistoryDividendItemTypeTRUSTDISTRIBUTION HistoryDividendItemType = "TRUST_DISTRIBUTION" HistoryDividendItemTypeTRUSTDISTRIBUTIONMANUFACTUREDPAYMENT HistoryDividendItemType = "TRUST_DISTRIBUTION_MANUFACTURED_PAYMENT" )
Defines values for HistoryDividendItemType.
func (HistoryDividendItemType) Valid ¶
func (e HistoryDividendItemType) Valid() bool
Valid indicates whether the value is a known member of the HistoryDividendItemType enum.
type HistoryTransactionItem ¶
type HistoryTransactionItem struct {
// Amount Amount in the currency of the transaction
Amount *float64 `json:"amount,omitempty"`
// Currency Currency of the transaction
Currency *string `json:"currency,omitempty"`
DateTime *time.Time `json:"dateTime,omitempty"`
// Reference ID
Reference *string `json:"reference,omitempty"`
Type *HistoryTransactionItemType `json:"type,omitempty"`
}
HistoryTransactionItem defines model for HistoryTransactionItem.
type HistoryTransactionItemType ¶
type HistoryTransactionItemType string
HistoryTransactionItemType defines model for HistoryTransactionItem.Type.
const ( HistoryTransactionItemTypeDEPOSIT HistoryTransactionItemType = "DEPOSIT" HistoryTransactionItemTypeFEE HistoryTransactionItemType = "FEE" HistoryTransactionItemTypeINTERESTONFREECASH HistoryTransactionItemType = "INTEREST_ON_FREE_CASH" HistoryTransactionItemTypeLENDINGINTEREST HistoryTransactionItemType = "LENDING_INTEREST" HistoryTransactionItemTypeTRANSFER HistoryTransactionItemType = "TRANSFER" HistoryTransactionItemTypeWITHDRAW HistoryTransactionItemType = "WITHDRAW" )
Defines values for HistoryTransactionItemType.
func (HistoryTransactionItemType) Valid ¶
func (e HistoryTransactionItemType) Valid() bool
Valid indicates whether the value is a known member of the HistoryTransactionItemType enum.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Instrument ¶
type Instrument struct {
// Currency Instrument currency in ISO 4217 format.
Currency *string `json:"currency,omitempty"`
// Isin ISIN of the instrument.
Isin *string `json:"isin,omitempty"`
// Name Name of the instrument.
Name *string `json:"name,omitempty"`
// Ticker Unique instrument identifier.
//
// Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
}
Instrument Instrument information as given by /instruments endpoint.
type InstrumentIssue ¶
type InstrumentIssue struct {
Name *InstrumentIssueName `json:"name,omitempty"`
Severity *InstrumentIssueSeverity `json:"severity,omitempty"`
}
InstrumentIssue defines model for InstrumentIssue.
type InstrumentIssueName ¶
type InstrumentIssueName string
InstrumentIssueName defines model for InstrumentIssue.Name.
const ( InstrumentIssueNameAPPROACHINGMAXPOSITIONSIZE InstrumentIssueName = "APPROACHING_MAX_POSITION_SIZE" InstrumentIssueNameCOMPLEXINSTRUMENTAPPTESTREQUIRED InstrumentIssueName = "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED" InstrumentIssueNameDELISTED InstrumentIssueName = "DELISTED" InstrumentIssueNameETNFINALRISKCONFIRMATIONREQUIRED InstrumentIssueName = "ETN_FINAL_RISK_CONFIRMATION_REQUIRED" InstrumentIssueNameETNRECONFIRMATIONREQUIRED InstrumentIssueName = "ETN_RECONFIRMATION_REQUIRED" InstrumentIssueNameIPOINSTRUMENTNOTAVAILABLE InstrumentIssueName = "IPO_INSTRUMENT_NOT_AVAILABLE" InstrumentIssueNameMAXPOSITIONSIZEREACHED InstrumentIssueName = "MAX_POSITION_SIZE_REACHED" InstrumentIssueNameNOLONGERTRADABLE InstrumentIssueName = "NO_LONGER_TRADABLE" InstrumentIssueNamePRICETOOLOW InstrumentIssueName = "PRICE_TOO_LOW" InstrumentIssueNameSUSPENDED InstrumentIssueName = "SUSPENDED" )
Defines values for InstrumentIssueName.
func (InstrumentIssueName) Valid ¶
func (e InstrumentIssueName) Valid() bool
Valid indicates whether the value is a known member of the InstrumentIssueName enum.
type InstrumentIssueSeverity ¶
type InstrumentIssueSeverity string
InstrumentIssueSeverity defines model for InstrumentIssue.Severity.
const ( InstrumentIssueSeverityINFORMATIVE InstrumentIssueSeverity = "INFORMATIVE" InstrumentIssueSeverityIRREVERSIBLE InstrumentIssueSeverity = "IRREVERSIBLE" InstrumentIssueSeverityREVERSIBLE InstrumentIssueSeverity = "REVERSIBLE" )
Defines values for InstrumentIssueSeverity.
func (InstrumentIssueSeverity) Valid ¶
func (e InstrumentIssueSeverity) Valid() bool
Valid indicates whether the value is a known member of the InstrumentIssueSeverity enum.
type InstrumentsResponse ¶
type InstrumentsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]TradableInstrument
}
func ParseInstrumentsResponse ¶
func ParseInstrumentsResponse(rsp *http.Response) (*InstrumentsResponse, error)
ParseInstrumentsResponse parses an HTTP response from a InstrumentsWithResponse call
func (InstrumentsResponse) ContentType ¶
func (r InstrumentsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (InstrumentsResponse) GetBody ¶
func (r InstrumentsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (InstrumentsResponse) GetJSON200 ¶
func (r InstrumentsResponse) GetJSON200() *[]TradableInstrument
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (InstrumentsResponse) Status ¶
func (r InstrumentsResponse) Status() string
Status returns HTTPResponse.Status
func (InstrumentsResponse) StatusCode ¶
func (r InstrumentsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type InvestmentResult ¶
type InvestmentResult struct {
PriceAvgInvestedValue *float64 `json:"priceAvgInvestedValue,omitempty"`
PriceAvgResult *float64 `json:"priceAvgResult,omitempty"`
PriceAvgResultCoef *float64 `json:"priceAvgResultCoef,omitempty"`
PriceAvgValue *float64 `json:"priceAvgValue,omitempty"`
}
InvestmentResult defines model for InvestmentResult.
type Investments ¶
type Investments struct {
// CurrentValue Current value of all the investments.
CurrentValue *float64 `json:"currentValue,omitempty"`
// RealizedProfitLoss The all-time realised profit loss from all of the trades executed.
RealizedProfitLoss *float64 `json:"realizedProfitLoss,omitempty"`
// TotalCost The cost basis of your current investments. The total amount of funds you've invested in the shares you currently own.
TotalCost *float64 `json:"totalCost,omitempty"`
// UnrealizedProfitLoss The potential profit/loss of your current investments, showing how much you could gain or lose if you were to sell them now.
UnrealizedProfitLoss *float64 `json:"unrealizedProfitLoss,omitempty"`
}
Investments defines model for Investments.
type LimitRequest ¶
type LimitRequest struct {
// LimitPrice Example: 100.23
LimitPrice *float64 `json:"limitPrice,omitempty"`
// Quantity Example: 0.1
Quantity *float64 `json:"quantity,omitempty"`
// Ticker Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
// TimeValidity Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeValidity *TimeValidity `json:"timeValidity,omitempty"`
}
LimitRequest defines model for LimitRequest.
type MarketRequest ¶
type MarketRequest struct {
// ExtendedHours Example: true
ExtendedHours *bool `json:"extendedHours,omitempty"`
// Quantity Example: 0.1
Quantity *float64 `json:"quantity,omitempty"`
// Ticker Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
}
MarketRequest defines model for MarketRequest.
type Order ¶
type Order struct {
// CreatedAt The ISO 8601 formatted date of when the order was created.
CreatedAt *time.Time `json:"createdAt,omitempty"`
// Currency The currency used for the order in ISO 4217 format.
Currency *string `json:"currency,omitempty"`
// ExtendedHours If true, the order is eligible for execution outside regular trading hours.
ExtendedHours *bool `json:"extendedHours,omitempty"`
// FilledQuantity The number of shares that have been successfully executed. Applicable to quantity orders.
FilledQuantity *float64 `json:"filledQuantity,omitempty"`
// FilledValue The total monetary value of the executed portion of the order. Applicable to orders placed by value.Note: Placing orders by value is not currently supported via the API but can be done through other Trading 212 platforms.
FilledValue *float64 `json:"filledValue,omitempty"`
// Id A unique, system-generated identifier for the order.
Id *int64 `json:"id,omitempty"`
// InitiatedFrom How the order was initiated.
InitiatedFrom *OrderInitiatedFrom `json:"initiatedFrom,omitempty"`
// Instrument Instrument information as given by /instruments endpoint.
Instrument *Instrument `json:"instrument,omitempty"`
// LimitPrice Applicable to LIMIT and STOP_LIMIT orders.
LimitPrice *float64 `json:"limitPrice,omitempty"`
// Quantity The total number of shares requested. Applicable to quantity orders.
Quantity *float64 `json:"quantity,omitempty"`
// Side Indicates whether the order is BUY or SELL.
Side *OrderSide `json:"side,omitempty"`
// Status The current state of the order in its lifecycle.
Status *OrderStatus `json:"status,omitempty"`
// StopPrice Applicable to STOP and STOP_LIMIT orders.
StopPrice *float64 `json:"stopPrice,omitempty"`
// Strategy The strategy used to place the order, either by QUANTITY or VALUE. The API currently only supports placing orders by QUANTITY.
Strategy *OrderStrategy `json:"strategy,omitempty"`
// Ticker Unique instrument identifier. Get from the /instruments endpoint
//
// Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
// TimeInForce Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeInForce *TimeValidity `json:"timeInForce,omitempty"`
Type *OrderType `json:"type,omitempty"`
// Value The total monetary value of the order. Applicable to value orders.
Value *float64 `json:"value,omitempty"`
}
Order defines model for Order.
type OrderByIdResponse ¶
type OrderByIdResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Order
}
func ParseOrderByIdResponse ¶
func ParseOrderByIdResponse(rsp *http.Response) (*OrderByIdResponse, error)
ParseOrderByIdResponse parses an HTTP response from a OrderByIdWithResponse call
func (OrderByIdResponse) ContentType ¶
func (r OrderByIdResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (OrderByIdResponse) GetBody ¶
func (r OrderByIdResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (OrderByIdResponse) GetJSON200 ¶
func (r OrderByIdResponse) GetJSON200() *Order
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (OrderByIdResponse) Status ¶
func (r OrderByIdResponse) Status() string
Status returns HTTPResponse.Status
func (OrderByIdResponse) StatusCode ¶
func (r OrderByIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type OrderInitiatedFrom ¶
type OrderInitiatedFrom string
OrderInitiatedFrom How the order was initiated.
const ( OrderInitiatedFromANDROID OrderInitiatedFrom = "ANDROID" OrderInitiatedFromAPI OrderInitiatedFrom = "API" OrderInitiatedFromAUTOINVEST OrderInitiatedFrom = "AUTOINVEST" OrderInitiatedFromINSTRUMENTAUTOINVEST OrderInitiatedFrom = "INSTRUMENT_AUTOINVEST" OrderInitiatedFromIOS OrderInitiatedFrom = "IOS" OrderInitiatedFromSYSTEM OrderInitiatedFrom = "SYSTEM" OrderInitiatedFromWEB OrderInitiatedFrom = "WEB" )
Defines values for OrderInitiatedFrom.
func (OrderInitiatedFrom) Valid ¶
func (e OrderInitiatedFrom) Valid() bool
Valid indicates whether the value is a known member of the OrderInitiatedFrom enum.
type OrderSide ¶
type OrderSide string
OrderSide Indicates whether the order is BUY or SELL.
Defines values for OrderSide.
type OrderStatus ¶
type OrderStatus string
OrderStatus The current state of the order in its lifecycle.
const ( OrderStatusCANCELLED OrderStatus = "CANCELLED" OrderStatusCANCELLING OrderStatus = "CANCELLING" OrderStatusCONFIRMED OrderStatus = "CONFIRMED" OrderStatusFILLED OrderStatus = "FILLED" OrderStatusLOCAL OrderStatus = "LOCAL" OrderStatusNEW OrderStatus = "NEW" OrderStatusPARTIALLYFILLED OrderStatus = "PARTIALLY_FILLED" OrderStatusREJECTED OrderStatus = "REJECTED" OrderStatusREPLACED OrderStatus = "REPLACED" OrderStatusREPLACING OrderStatus = "REPLACING" OrderStatusUNCONFIRMED OrderStatus = "UNCONFIRMED" )
Defines values for OrderStatus.
func (OrderStatus) Valid ¶
func (e OrderStatus) Valid() bool
Valid indicates whether the value is a known member of the OrderStatus enum.
type OrderStrategy ¶
type OrderStrategy string
OrderStrategy The strategy used to place the order, either by QUANTITY or VALUE. The API currently only supports placing orders by QUANTITY.
const ( OrderStrategyQUANTITY OrderStrategy = "QUANTITY" OrderStrategyVALUE OrderStrategy = "VALUE" )
Defines values for OrderStrategy.
func (OrderStrategy) Valid ¶
func (e OrderStrategy) Valid() bool
Valid indicates whether the value is a known member of the OrderStrategy enum.
type OrderType ¶
type OrderType string
OrderType defines model for Order.Type.
type Orders1Params ¶
type Orders1Params struct {
// Cursor Pagination cursor
Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"`
// Ticker Ticker filter
Ticker *string `form:"ticker,omitempty" json:"ticker,omitempty"`
// Limit Max items: 50
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}
Orders1Params defines parameters for Orders1.
type Orders1Response ¶
type Orders1Response struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PaginatedResponseHistoricalOrder
}
func ParseOrders1Response ¶
func ParseOrders1Response(rsp *http.Response) (*Orders1Response, error)
ParseOrders1Response parses an HTTP response from a Orders1WithResponse call
func (Orders1Response) ContentType ¶
func (r Orders1Response) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (Orders1Response) GetBody ¶
func (r Orders1Response) GetBody() []byte
GetBody returns the raw response body bytes
func (Orders1Response) GetJSON200 ¶
func (r Orders1Response) GetJSON200() *PaginatedResponseHistoricalOrder
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (Orders1Response) Status ¶
func (r Orders1Response) Status() string
Status returns HTTPResponse.Status
func (Orders1Response) StatusCode ¶
func (r Orders1Response) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type OrdersResponse ¶
type OrdersResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]Order
}
func ParseOrdersResponse ¶
func ParseOrdersResponse(rsp *http.Response) (*OrdersResponse, error)
ParseOrdersResponse parses an HTTP response from a OrdersWithResponse call
func (OrdersResponse) ContentType ¶
func (r OrdersResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (OrdersResponse) GetBody ¶
func (r OrdersResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (OrdersResponse) GetJSON200 ¶
func (r OrdersResponse) GetJSON200() *[]Order
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (OrdersResponse) Status ¶
func (r OrdersResponse) Status() string
Status returns HTTPResponse.Status
func (OrdersResponse) StatusCode ¶
func (r OrdersResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PaginatedResponseHistoricalOrder ¶
type PaginatedResponseHistoricalOrder struct {
Items *[]HistoricalOrder `json:"items,omitempty"`
NextPagePath *string `json:"nextPagePath,omitempty"`
}
PaginatedResponseHistoricalOrder defines model for PaginatedResponseHistoricalOrder.
type PaginatedResponseHistoryDividendItem ¶
type PaginatedResponseHistoryDividendItem struct {
Items *[]HistoryDividendItem `json:"items,omitempty"`
NextPagePath *string `json:"nextPagePath,omitempty"`
}
PaginatedResponseHistoryDividendItem defines model for PaginatedResponseHistoryDividendItem.
type PaginatedResponseHistoryTransactionItem ¶
type PaginatedResponseHistoryTransactionItem struct {
Items *[]HistoryTransactionItem `json:"items,omitempty"`
NextPagePath *string `json:"nextPagePath,omitempty"`
}
PaginatedResponseHistoryTransactionItem defines model for PaginatedResponseHistoryTransactionItem.
type PieRequest ¶
type PieRequest struct {
DividendCashAction *PieRequestDividendCashAction `json:"dividendCashAction,omitempty"`
EndDate *time.Time `json:"endDate,omitempty"`
// Goal Total desired value of the pie in account currency
Goal *float64 `json:"goal,omitempty"`
Icon *string `json:"icon,omitempty"`
// InstrumentShares Example: {"AAPL_US_EQ":0.5,"MSFT_US_EQ":0.5}
Name *string `json:"name,omitempty"`
}
PieRequest defines model for PieRequest.
type PieRequestDividendCashAction ¶
type PieRequestDividendCashAction string
PieRequestDividendCashAction defines model for PieRequest.DividendCashAction.
const ( PieRequestDividendCashActionREINVEST PieRequestDividendCashAction = "REINVEST" PieRequestDividendCashActionTOACCOUNTCASH PieRequestDividendCashAction = "TO_ACCOUNT_CASH" )
Defines values for PieRequestDividendCashAction.
func (PieRequestDividendCashAction) Valid ¶
func (e PieRequestDividendCashAction) Valid() bool
Valid indicates whether the value is a known member of the PieRequestDividendCashAction enum.
type PlaceLimitOrderJSONRequestBody ¶
type PlaceLimitOrderJSONRequestBody = LimitRequest
PlaceLimitOrderJSONRequestBody defines body for PlaceLimitOrder for application/json ContentType.
type PlaceLimitOrderResponse ¶
type PlaceLimitOrderResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Order
}
func ParsePlaceLimitOrderResponse ¶
func ParsePlaceLimitOrderResponse(rsp *http.Response) (*PlaceLimitOrderResponse, error)
ParsePlaceLimitOrderResponse parses an HTTP response from a PlaceLimitOrderWithResponse call
func (PlaceLimitOrderResponse) ContentType ¶
func (r PlaceLimitOrderResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (PlaceLimitOrderResponse) GetBody ¶
func (r PlaceLimitOrderResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (PlaceLimitOrderResponse) GetJSON200 ¶
func (r PlaceLimitOrderResponse) GetJSON200() *Order
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (PlaceLimitOrderResponse) Status ¶
func (r PlaceLimitOrderResponse) Status() string
Status returns HTTPResponse.Status
func (PlaceLimitOrderResponse) StatusCode ¶
func (r PlaceLimitOrderResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PlaceMarketOrderJSONRequestBody ¶
type PlaceMarketOrderJSONRequestBody = MarketRequest
PlaceMarketOrderJSONRequestBody defines body for PlaceMarketOrder for application/json ContentType.
type PlaceMarketOrderResponse ¶
type PlaceMarketOrderResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Order
}
func ParsePlaceMarketOrderResponse ¶
func ParsePlaceMarketOrderResponse(rsp *http.Response) (*PlaceMarketOrderResponse, error)
ParsePlaceMarketOrderResponse parses an HTTP response from a PlaceMarketOrderWithResponse call
func (PlaceMarketOrderResponse) ContentType ¶
func (r PlaceMarketOrderResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (PlaceMarketOrderResponse) GetBody ¶
func (r PlaceMarketOrderResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (PlaceMarketOrderResponse) GetJSON200 ¶
func (r PlaceMarketOrderResponse) GetJSON200() *Order
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (PlaceMarketOrderResponse) Status ¶
func (r PlaceMarketOrderResponse) Status() string
Status returns HTTPResponse.Status
func (PlaceMarketOrderResponse) StatusCode ¶
func (r PlaceMarketOrderResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PlaceStopOrder1JSONRequestBody ¶
type PlaceStopOrder1JSONRequestBody = StopRequest
PlaceStopOrder1JSONRequestBody defines body for PlaceStopOrder1 for application/json ContentType.
type PlaceStopOrder1Response ¶
type PlaceStopOrder1Response struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Order
}
func ParsePlaceStopOrder1Response ¶
func ParsePlaceStopOrder1Response(rsp *http.Response) (*PlaceStopOrder1Response, error)
ParsePlaceStopOrder1Response parses an HTTP response from a PlaceStopOrder1WithResponse call
func (PlaceStopOrder1Response) ContentType ¶
func (r PlaceStopOrder1Response) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (PlaceStopOrder1Response) GetBody ¶
func (r PlaceStopOrder1Response) GetBody() []byte
GetBody returns the raw response body bytes
func (PlaceStopOrder1Response) GetJSON200 ¶
func (r PlaceStopOrder1Response) GetJSON200() *Order
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (PlaceStopOrder1Response) Status ¶
func (r PlaceStopOrder1Response) Status() string
Status returns HTTPResponse.Status
func (PlaceStopOrder1Response) StatusCode ¶
func (r PlaceStopOrder1Response) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PlaceStopOrderJSONRequestBody ¶
type PlaceStopOrderJSONRequestBody = StopLimitRequest
PlaceStopOrderJSONRequestBody defines body for PlaceStopOrder for application/json ContentType.
type PlaceStopOrderResponse ¶
type PlaceStopOrderResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Order
}
func ParsePlaceStopOrderResponse ¶
func ParsePlaceStopOrderResponse(rsp *http.Response) (*PlaceStopOrderResponse, error)
ParsePlaceStopOrderResponse parses an HTTP response from a PlaceStopOrderWithResponse call
func (PlaceStopOrderResponse) ContentType ¶
func (r PlaceStopOrderResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (PlaceStopOrderResponse) GetBody ¶
func (r PlaceStopOrderResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (PlaceStopOrderResponse) GetJSON200 ¶
func (r PlaceStopOrderResponse) GetJSON200() *Order
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (PlaceStopOrderResponse) Status ¶
func (r PlaceStopOrderResponse) Status() string
Status returns HTTPResponse.Status
func (PlaceStopOrderResponse) StatusCode ¶
func (r PlaceStopOrderResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Position ¶
type Position struct {
// AveragePricePaid Average price paid, in instrument currency, per share.
AveragePricePaid *float64 `json:"averagePricePaid,omitempty"`
// CreatedAt The ISO 8601 formatted date of when the position was opened.
CreatedAt *time.Time `json:"createdAt,omitempty"`
// CurrentPrice Current price, in instrument currency, of a single share.
CurrentPrice *float64 `json:"currentPrice,omitempty"`
// Instrument Instrument information as given by /instruments endpoint.
Instrument *Instrument `json:"instrument,omitempty"`
// Quantity Total quantity of shares owned.
Quantity *float64 `json:"quantity,omitempty"`
// QuantityAvailableForTrading Quantity of shares available for trading.
QuantityAvailableForTrading *float64 `json:"quantityAvailableForTrading,omitempty"`
// QuantityInPies Quantity of shares currently used in pie.
QuantityInPies *float64 `json:"quantityInPies,omitempty"`
WalletImpact *PositionWalletImpact `json:"walletImpact,omitempty"`
}
Position defines model for Position.
type PositionWalletImpact ¶
type PositionWalletImpact struct {
// Currency The currency code used to represent all the wallet impact information.
Currency *string `json:"currency,omitempty"`
// CurrentValue The current market value of the position.
CurrentValue *float64 `json:"currentValue,omitempty"`
// FxImpact The positive or negative impact on the position's value due to currency rate changes. Only applies to positions with instrument currency that differs from the accounts.
FxImpact *float64 `json:"fxImpact,omitempty"`
// TotalCost The total cost paid for the position.
TotalCost *float64 `json:"totalCost,omitempty"`
// UnrealizedProfitLoss The unrealized profit & loss for the position. Calculated as currentValue - totalCost.
UnrealizedProfitLoss *float64 `json:"unrealizedProfitLoss,omitempty"`
}
PositionWalletImpact defines model for PositionWalletImpact.
type PublicReportRequest ¶
type PublicReportRequest struct {
DataIncluded *ReportDataIncluded `json:"dataIncluded,omitempty"`
TimeFrom *time.Time `json:"timeFrom,omitempty"`
TimeTo *time.Time `json:"timeTo,omitempty"`
}
PublicReportRequest defines model for PublicReportRequest.
type ReportDataIncluded ¶
type ReportDataIncluded struct {
IncludeDividends *bool `json:"includeDividends,omitempty"`
IncludeInterest *bool `json:"includeInterest,omitempty"`
IncludeOrders *bool `json:"includeOrders,omitempty"`
IncludeTransactions *bool `json:"includeTransactions,omitempty"`
}
ReportDataIncluded defines model for ReportDataIncluded.
type ReportResponse ¶
type ReportResponse struct {
DataIncluded *ReportDataIncluded `json:"dataIncluded,omitempty"`
DownloadLink *string `json:"downloadLink,omitempty"`
ReportId *int64 `json:"reportId,omitempty"`
Status *ReportResponseStatus `json:"status,omitempty"`
TimeFrom *time.Time `json:"timeFrom,omitempty"`
TimeTo *time.Time `json:"timeTo,omitempty"`
}
ReportResponse defines model for ReportResponse.
type ReportResponseStatus ¶
type ReportResponseStatus string
ReportResponseStatus defines model for ReportResponse.Status.
const ( ReportResponseStatusCanceled ReportResponseStatus = "Canceled" ReportResponseStatusFailed ReportResponseStatus = "Failed" ReportResponseStatusFinished ReportResponseStatus = "Finished" ReportResponseStatusProcessing ReportResponseStatus = "Processing" ReportResponseStatusQueued ReportResponseStatus = "Queued" ReportResponseStatusRunning ReportResponseStatus = "Running" )
Defines values for ReportResponseStatus.
func (ReportResponseStatus) Valid ¶
func (e ReportResponseStatus) Valid() bool
Valid indicates whether the value is a known member of the ReportResponseStatus enum.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RequestReportJSONRequestBody ¶
type RequestReportJSONRequestBody = PublicReportRequest
RequestReportJSONRequestBody defines body for RequestReport for application/json ContentType.
type RequestReportResponse ¶
type RequestReportResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *EnqueuedReportResponse
}
func ParseRequestReportResponse ¶
func ParseRequestReportResponse(rsp *http.Response) (*RequestReportResponse, error)
ParseRequestReportResponse parses an HTTP response from a RequestReportWithResponse call
func (RequestReportResponse) ContentType ¶
func (r RequestReportResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (RequestReportResponse) GetBody ¶
func (r RequestReportResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (RequestReportResponse) GetJSON200 ¶
func (r RequestReportResponse) GetJSON200() *EnqueuedReportResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (RequestReportResponse) Status ¶
func (r RequestReportResponse) Status() string
Status returns HTTPResponse.Status
func (RequestReportResponse) StatusCode ¶
func (r RequestReportResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type StopLimitRequest ¶
type StopLimitRequest struct {
// LimitPrice Example: 100.23
LimitPrice *float64 `json:"limitPrice,omitempty"`
// Quantity Example: 0.1
Quantity *float64 `json:"quantity,omitempty"`
// StopPrice Example: 100.23
StopPrice *float64 `json:"stopPrice,omitempty"`
// Ticker Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
// TimeValidity Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeValidity *TimeValidity `json:"timeValidity,omitempty"`
}
StopLimitRequest defines model for StopLimitRequest.
type StopRequest ¶
type StopRequest struct {
// Quantity Example: 0.1
Quantity *float64 `json:"quantity,omitempty"`
// StopPrice Example: 100.23
StopPrice *float64 `json:"stopPrice,omitempty"`
// Ticker Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
// TimeValidity Specifies how long the order remains active:
// * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange.
// * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
TimeValidity *TimeValidity `json:"timeValidity,omitempty"`
}
StopRequest defines model for StopRequest.
type Tax ¶
type Tax struct {
ChargedAt *time.Time `json:"chargedAt,omitempty"`
Currency *string `json:"currency,omitempty"`
Name *TaxName `json:"name,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
}
Tax defines model for Tax.
type TaxName ¶
type TaxName string
TaxName defines model for Tax.Name.
const ( TaxNameCOMMISSIONTURNOVER TaxName = "COMMISSION_TURNOVER" TaxNameCURRENCYCONVERSIONFEE TaxName = "CURRENCY_CONVERSION_FEE" TaxNameFINRAFEE TaxName = "FINRA_FEE" TaxNameFRENCHTRANSACTIONTAX TaxName = "FRENCH_TRANSACTION_TAX" TaxNamePTMLEVY TaxName = "PTM_LEVY" TaxNameSTAMPDUTY TaxName = "STAMP_DUTY" TaxNameSTAMPDUTYRESERVETAX TaxName = "STAMP_DUTY_RESERVE_TAX" TaxNameTRANSACTIONFEE TaxName = "TRANSACTION_FEE" )
Defines values for TaxName.
type TimeEvent ¶
type TimeEvent struct {
Date *time.Time `json:"date,omitempty"`
Type *TimeEventType `json:"type,omitempty"`
}
TimeEvent defines model for TimeEvent.
type TimeEventType ¶
type TimeEventType string
TimeEventType defines model for TimeEvent.Type.
const ( TimeEventTypeAFTERHOURSCLOSE TimeEventType = "AFTER_HOURS_CLOSE" TimeEventTypeAFTERHOURSOPEN TimeEventType = "AFTER_HOURS_OPEN" TimeEventTypeBREAKEND TimeEventType = "BREAK_END" TimeEventTypeBREAKSTART TimeEventType = "BREAK_START" TimeEventTypeCLOSE TimeEventType = "CLOSE" TimeEventTypeOPEN TimeEventType = "OPEN" TimeEventTypeOVERNIGHTOPEN TimeEventType = "OVERNIGHT_OPEN" TimeEventTypePREMARKETOPEN TimeEventType = "PRE_MARKET_OPEN" )
Defines values for TimeEventType.
func (TimeEventType) Valid ¶
func (e TimeEventType) Valid() bool
Valid indicates whether the value is a known member of the TimeEventType enum.
type TimeValidity ¶
type TimeValidity string
TimeValidity Specifies how long the order remains active: * DAY: The order will automatically expire if not executed by midnight in the time zone of the instrument's exchange. * GOOD_TILL_CANCEL: The order remains active indefinitely until it is either filled or explicitly cancelled by you.
const ( TimeValidityDAY TimeValidity = "DAY" TimeValidityGOODTILLCANCEL TimeValidity = "GOOD_TILL_CANCEL" )
Defines values for TimeValidity.
func (TimeValidity) Valid ¶
func (e TimeValidity) Valid() bool
Valid indicates whether the value is a known member of the TimeValidity enum.
type TradableInstrument ¶
type TradableInstrument struct {
// AddedOn On the platform since
AddedOn *time.Time `json:"addedOn,omitempty"`
// CurrencyCode ISO 4217
//
// Example: USD
CurrencyCode *string `json:"currencyCode,omitempty"`
ExtendedHours *bool `json:"extendedHours,omitempty"`
Isin *string `json:"isin,omitempty"`
MaxOpenQuantity *float64 `json:"maxOpenQuantity,omitempty"`
Name *string `json:"name,omitempty"`
ShortName *string `json:"shortName,omitempty"`
// Ticker Unique identifier
//
// Example: AAPL_US_EQ
Ticker *string `json:"ticker,omitempty"`
// Type Example: ETF
Type *TradableInstrumentType `json:"type,omitempty"`
// WorkingScheduleId Get items in the /exchanges endpoint
WorkingScheduleId *int64 `json:"workingScheduleId,omitempty"`
}
TradableInstrument defines model for TradableInstrument.
type TradableInstrumentType ¶
type TradableInstrumentType string
TradableInstrumentType Example: ETF
const ( TradableInstrumentTypeCORPACT TradableInstrumentType = "CORPACT" TradableInstrumentTypeCRYPTO TradableInstrumentType = "CRYPTO" TradableInstrumentTypeCRYPTOCURRENCY TradableInstrumentType = "CRYPTOCURRENCY" TradableInstrumentTypeCVR TradableInstrumentType = "CVR" TradableInstrumentTypeETF TradableInstrumentType = "ETF" TradableInstrumentTypeFOREX TradableInstrumentType = "FOREX" TradableInstrumentTypeFUTURES TradableInstrumentType = "FUTURES" TradableInstrumentTypeINDEX TradableInstrumentType = "INDEX" TradableInstrumentTypeSTOCK TradableInstrumentType = "STOCK" TradableInstrumentTypeWARRANT TradableInstrumentType = "WARRANT" )
Defines values for TradableInstrumentType.
func (TradableInstrumentType) Valid ¶
func (e TradableInstrumentType) Valid() bool
Valid indicates whether the value is a known member of the TradableInstrumentType enum.
type TransactionsParams ¶
type TransactionsParams struct {
// Cursor Pagination cursor
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
// Time Retrieve transactions starting from the specified time
Time *time.Time `form:"time,omitempty" json:"time,omitempty"`
// Limit Max items: 50
Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}
TransactionsParams defines parameters for Transactions.
type TransactionsResponse ¶
type TransactionsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PaginatedResponseHistoryTransactionItem
}
func ParseTransactionsResponse ¶
func ParseTransactionsResponse(rsp *http.Response) (*TransactionsResponse, error)
ParseTransactionsResponse parses an HTTP response from a TransactionsWithResponse call
func (TransactionsResponse) ContentType ¶
func (r TransactionsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (TransactionsResponse) GetBody ¶
func (r TransactionsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (TransactionsResponse) GetJSON200 ¶
func (r TransactionsResponse) GetJSON200() *PaginatedResponseHistoryTransactionItem
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (TransactionsResponse) Status ¶
func (r TransactionsResponse) Status() string
Status returns HTTPResponse.Status
func (TransactionsResponse) StatusCode ¶
func (r TransactionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type UpdateJSONRequestBody
deprecated
type UpdateJSONRequestBody = PieRequest
UpdateJSONRequestBody defines body for Update for application/json ContentType.
Deprecated: this type has been marked as deprecated upstream, but no `x-deprecated-reason` was set
type UpdateResponse ¶
type UpdateResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AccountBucketInstrumentsDetailedResponse
}
func ParseUpdateResponse ¶
func ParseUpdateResponse(rsp *http.Response) (*UpdateResponse, error)
ParseUpdateResponse parses an HTTP response from a UpdateWithResponse call
func (UpdateResponse) ContentType ¶
func (r UpdateResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (UpdateResponse) GetBody ¶
func (r UpdateResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (UpdateResponse) GetJSON200 ¶
func (r UpdateResponse) GetJSON200() *AccountBucketInstrumentsDetailedResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (UpdateResponse) Status ¶
func (r UpdateResponse) Status() string
Status returns HTTPResponse.Status
func (UpdateResponse) StatusCode ¶
func (r UpdateResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type WorkingSchedule ¶
type WorkingSchedule struct {
Id *int64 `json:"id,omitempty"`
TimeEvents *[]TimeEvent `json:"timeEvents,omitempty"`
}
WorkingSchedule defines model for WorkingSchedule.