swagger

package
v0.0.0-...-db7d511 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2019 License: MIT Imports: 1 Imported by: 0

README

Generated files

The files here are generated with: $ java -jar swagger-codegen-cli.jar generate -i https://api.test.nordnet.se/next/2/api-docs/swagger -l go -o .

Manual changes

And then manually deleted DefaultApi.go and scripts. Added CustomDefines.go to be able to define types, or add stuff without modifying the generated files.

Rename files from CamelCase.

$ rename 's/([A-Z])/$1/g' *.go && rename 's/^//g' *.go && rename 'y/A-Z/a-z/' *.go

And rename attributes ending with _.

$ sed -i 's/Type_/Typ/g' *.go $ sed -i 's/Default_/IsDefault/g' *.go $ sed -i 's/int32/int64/g' *.go # Why use 32 bit ints? Its not the year 2000 $ gofmt -s -w *.go

Documentation

Overview

Contains generated structs from https://api.test.nordnet.se/next/2/api-docs/swagger

Index

Constants

View Source
const DateFormat = "2006-01-02"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Accno         int64  `json:"accno,omitempty"`
	Typ           string `json:"type,omitempty"`
	IsDefault     bool   `json:"default,omitempty"`
	Alias         string `json:"alias,omitempty"`
	IsBlocked     bool   `json:"is_blocked,omitempty"`
	BlockedReason string `json:"blocked_reason,omitempty"`
}

type AccountInfo

type AccountInfo struct {
	AccountCurrency            string `json:"account_currency,omitempty"`
	AccountCredit              Amount `json:"account_credit,omitempty"`
	AccountSum                 Amount `json:"account_sum,omitempty"`
	Collateral                 Amount `json:"collateral,omitempty"`
	CreditAccountSum           Amount `json:"credit_account_sum,omitempty"`
	ForwardSum                 Amount `json:"forward_sum,omitempty"`
	FutureSum                  Amount `json:"future_sum,omitempty"`
	UnrealizedFutureProfitLoss Amount `json:"unrealized_future_profit_loss,omitempty"`
	FullMarketvalue            Amount `json:"full_marketvalue,omitempty"`
	Interest                   Amount `json:"interest,omitempty"`
	IntradayCredit             Amount `json:"intraday_credit,omitempty"`
	LoanLimit                  Amount `json:"loan_limit,omitempty"`
	OwnCapital                 Amount `json:"own_capital,omitempty"`
	OwnCapitalMorning          Amount `json:"own_capital_morning,omitempty"`
	PawnValue                  Amount `json:"pawn_value,omitempty"`
	TradingPower               Amount `json:"trading_power,omitempty"`
}

type ActivationCondition

type ActivationCondition struct {
	Typ              string  `json:"type,omitempty"`
	TrailingValue    float64 `json:"trailing_value,omitempty"`
	TriggerValue     float64 `json:"trigger_value,omitempty"`
	TriggerCondition string  `json:"trigger_condition,omitempty"`
}

type Amount

type Amount struct {
	Value    float64 `json:"value,omitempty"`
	Currency string  `json:"currency,omitempty"`
}

type CalendarDay

type CalendarDay struct {
	Date  Date  `json:"date,omitempty"`
	Open  int64 `json:"open,omitempty"`
	Close int64 `json:"close,omitempty"`
}

type Country

type Country struct {
	Country string `json:"country,omitempty"`
	Name    string `json:"name,omitempty"`
}

type Date

type Date struct {
	time.Time
}

Since swagger generates 'Date', we need to define it, and thus do not need to modify generated files

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(buf []byte) (err error)

UnmarshalJSON implements json.Unmarshaler inferface.

type ErrorResponse

type ErrorResponse struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type Feed

type Feed struct {
	Hostname  string `json:"hostname,omitempty"`
	Port      int64  `json:"port,omitempty"`
	Encrypted bool   `json:"encrypted,omitempty"`
}

type Indicator

type Indicator struct {
	Name         string `json:"name,omitempty"`
	Src          string `json:"src,omitempty"`
	Identifier   string `json:"identifier,omitempty"`
	Delayed      int64  `json:"delayed,omitempty"`
	OnlyEod      bool   `json:"only_eod,omitempty"`
	Open         string `json:"open,omitempty"`
	Close        string `json:"close,omitempty"`
	Country      string `json:"country,omitempty"`
	Typ          string `json:"type,omitempty"`
	Region       string `json:"region,omitempty"`
	InstrumentId int64  `json:"instrument_id,omitempty"`
}

type Instrument

type Instrument struct {
	InstrumentId        int64            `json:"instrument_id,omitempty"`
	Tradables           []Tradable       `json:"tradables,omitempty"`
	Currency            string           `json:"currency,omitempty"`
	InstrumentGroupType string           `json:"instrument_group_type,omitempty"`
	InstrumentType      string           `json:"instrument_type,omitempty"`
	Multiplier          float64          `json:"multiplier,omitempty"`
	Symbol              string           `json:"symbol,omitempty"`
	IsinCode            string           `json:"isin_code,omitempty"`
	MarketView          string           `json:"market_view,omitempty"`
	StrikePrice         float64          `json:"strike_price,omitempty"`
	PawnPercentage      float64          `json:"pawn_percentage,omitempty"`
	NumberOfSecurities  float64          `json:"number_of_securities,omitempty"`
	ProspectusUrl       string           `json:"prospectus_url,omitempty"`
	ExpirationDate      Date             `json:"expiration_date,omitempty"`
	Name                string           `json:"name,omitempty"`
	Sector              string           `json:"sector,omitempty"`
	SectorGroup         string           `json:"sector_group,omitempty"`
	Underlyings         []UnderlyingInfo `json:"underlyings,omitempty"`
}

type InstrumentType

type InstrumentType struct {
	InstrumentType string `json:"instrument_type,omitempty"`
	Name           string `json:"name,omitempty"`
}

type IntradayGraph

type IntradayGraph struct {
	MarketId   int64          `json:"market_id,omitempty"`
	Identifier string         `json:"identifier,omitempty"`
	Ticks      []IntradayTick `json:"ticks,omitempty"`
}

type IntradayTick

type IntradayTick struct {
	Timestamp  int64   `json:"timestamp,omitempty"`
	Last       float64 `json:"last,omitempty"`
	Low        float64 `json:"low,omitempty"`
	High       float64 `json:"high,omitempty"`
	Volume     int64   `json:"volume,omitempty"`
	NoOfTrades int64   `json:"no_of_trades,omitempty"`
}

type Issuer

type Issuer struct {
	Name     string `json:"name,omitempty"`
	IssuerId int64  `json:"issuer_id,omitempty"`
}

type Ledger

type Ledger struct {
	Currency      string `json:"currency,omitempty"`
	AccountSum    Amount `json:"account_sum,omitempty"`
	AccountSumAcc Amount `json:"account_sum_acc,omitempty"`
	AccIntDeb     Amount `json:"acc_int_deb,omitempty"`
	AccIntCred    Amount `json:"acc_int_cred,omitempty"`
	ExchangeRate  Amount `json:"exchange_rate,omitempty"`
}

type LedgerInformation

type LedgerInformation struct {
	TotalAccIntDeb  Amount   `json:"total_acc_int_deb,omitempty"`
	TotalAccIntCred Amount   `json:"total_acc_int_cred,omitempty"`
	Total           Amount   `json:"total,omitempty"`
	Ledgers         []Ledger `json:"ledgers,omitempty"`
}

type LeverageFilter

type LeverageFilter struct {
	Issuers              []Issuer `json:"issuers,omitempty"`
	MarketView           []string `json:"market_view,omitempty"`
	ExpirationDates      []string `json:"expiration_dates,omitempty"`
	InstrumentTypes      []string `json:"instrument_types,omitempty"`
	InstrumentGroupTypes []string `json:"instrument_group_types,omitempty"`
	Currencies           []string `json:"currencies,omitempty"`
	NoOfInstruments      int64    `json:"no_of_instruments,omitempty"`
}

type List

type List struct {
	Symbol       string `json:"symbol,omitempty"`
	DisplayOrder int64  `json:"display_order,omitempty"`
	ListId       int64  `json:"list_id,omitempty"`
	Name         string `json:"name,omitempty"`
	Country      string `json:"country,omitempty"`
	Region       string `json:"region,omitempty"`
}

type LoggedInStatus

type LoggedInStatus struct {
	LoggedIn bool `json:"logged_in,omitempty"`
}

type Login

type Login struct {
	Environment string `json:"environment,omitempty"`
	SessionKey  string `json:"session_key,omitempty"`
	ExpiresIn   int64  `json:"expires_in,omitempty"`
	PrivateFeed Feed   `json:"private_feed,omitempty"`
	PublicFeed  Feed   `json:"public_feed,omitempty"`
}

type Market

type Market struct {
	MarketId int64  `json:"market_id,omitempty"`
	Country  string `json:"country,omitempty"`
	Name     string `json:"name,omitempty"`
}

type NewsItem

type NewsItem struct {
	NewsId      int64   `json:"news_id,omitempty"`
	SourceId    int64   `json:"source_id,omitempty"`
	Headline    string  `json:"headline,omitempty"`
	Body        string  `json:"body,omitempty"`
	Instruments []int64 `json:"instruments,omitempty"`
	Lang        string  `json:"lang,omitempty"`
	Typ         string  `json:"type,omitempty"`
	Timestamp   int64   `json:"timestamp,omitempty"`
}

type NewsPreview

type NewsPreview struct {
	NewsId      int64   `json:"news_id,omitempty"`
	SourceId    int64   `json:"source_id,omitempty"`
	Headline    string  `json:"headline,omitempty"`
	Instruments []int64 `json:"instruments,omitempty"`
	Lang        string  `json:"lang,omitempty"`
	Typ         string  `json:"type,omitempty"`
	Timestamp   int64   `json:"timestamp,omitempty"`
}

type NewsSource

type NewsSource struct {
	Name      string   `json:"name,omitempty"`
	SourceId  int64    `json:"source_id,omitempty"`
	Level     string   `json:"level,omitempty"`
	Countries []string `json:"countries,omitempty"`
}

type OptionPair

type OptionPair struct {
	StrikePrice    float64    `json:"strike_price,omitempty"`
	ExpirationDate Date       `json:"expiration_date,omitempty"`
	Call           Instrument `json:"call,omitempty"`
	Put            Instrument `json:"put,omitempty"`
}

type OptionPairFilter

type OptionPairFilter struct {
	ExpirationDates []string `json:"expiration_dates,omitempty"`
}

type Order

type Order struct {
	Accno               int64               `json:"accno,omitempty"`
	OrderId             int64               `json:"order_id,omitempty"`
	Price               Amount              `json:"price,omitempty"`
	Volume              float64             `json:"volume,omitempty"`
	Tradable            TradableId          `json:"tradable,omitempty"`
	OpenVolume          float64             `json:"open_volume,omitempty"`
	TradedVolume        float64             `json:"traded_volume,omitempty"`
	Side                string              `json:"side,omitempty"`
	Modified            int64               `json:"modified,omitempty"`
	Reference           string              `json:"reference,omitempty"`
	ActivationCondition ActivationCondition `json:"activation_condition,omitempty"`
	PriceCondition      string              `json:"price_condition,omitempty"`
	VolumeCondition     string              `json:"volume_condition,omitempty"`
	Validity            Validity            `json:"validity,omitempty"`
	ActionState         string              `json:"action_state,omitempty"`
	OrderType           string              `json:"order_type,omitempty"`
	OrderState          string              `json:"order_state,omitempty"`
}

type OrderReply

type OrderReply struct {
	OrderId     int64  `json:"order_id,omitempty"`
	ResultCode  string `json:"result_code,omitempty"`
	OrderState  string `json:"order_state,omitempty"`
	ActionState string `json:"action_state,omitempty"`
	Message     string `json:"message,omitempty"`
}

type OrderType

type OrderType struct {
	Typ  string `json:"type,omitempty"`
	Name string `json:"name,omitempty"`
}

type Position

type Position struct {
	Accno          int64      `json:"accno,omitempty"`
	Instrument     Instrument `json:"instrument,omitempty"`
	Qty            float32    `json:"qty,omitempty"`
	PawnPercent    int64      `json:"pawn_percent,omitempty"`
	MarketValueAcc Amount     `json:"market_value_acc,omitempty"`
	MarketValue    Amount     `json:"market_value,omitempty"`
	AcqPrice       Amount     `json:"acq_price,omitempty"`
	AcqPriceAcc    Amount     `json:"acq_price_acc,omitempty"`
	MorningPrice   Amount     `json:"morning_price,omitempty"`
}

type PublicTrade

type PublicTrade struct {
	BrokerBuying  string  `json:"broker_buying,omitempty"`
	BrokerSelling string  `json:"broker_selling,omitempty"`
	Volume        int64   `json:"volume,omitempty"`
	Price         float64 `json:"price,omitempty"`
	TradeId       string  `json:"trade_id,omitempty"`
	TradeType     string  `json:"trade_type,omitempty"`
}

type PublicTrades

type PublicTrades struct {
	MarketId   int64         `json:"market_id,omitempty"`
	Identifier string        `json:"identifier,omitempty"`
	Trades     []PublicTrade `json:"trades,omitempty"`
}

type RealtimeAccess

type RealtimeAccess struct {
	MarketId int64 `json:"market_id,omitempty"`
	Level    int64 `json:"level,omitempty"`
}

type Sector

type Sector struct {
	Sector string `json:"sector,omitempty"`
	Group  string `json:"group,omitempty"`
	Name   string `json:"name,omitempty"`
}

type Status

type Status struct {
	Timestamp     int64  `json:"timestamp,omitempty"`
	ValidVersion  bool   `json:"valid_version,omitempty"`
	SystemRunning bool   `json:"system_running,omitempty"`
	Message       string `json:"message,omitempty"`
}

type TicksizeInterval

type TicksizeInterval struct {
	Decimals  int64   `json:"decimals,omitempty"`
	FromPrice float64 `json:"from_price,omitempty"`
	ToPrice   float64 `json:"to_price,omitempty"`
	Tick      float64 `json:"tick,omitempty"`
}

type TicksizeTable

type TicksizeTable struct {
	TickSizeId int64              `json:"tick_size_id,omitempty"`
	Ticks      []TicksizeInterval `json:"ticks,omitempty"`
}

type Tradable

type Tradable struct {
	MarketId     int64   `json:"market_id,omitempty"`
	Identifier   string  `json:"identifier,omitempty"`
	TickSizeId   int64   `json:"tick_size_id,omitempty"`
	LotSize      float64 `json:"lot_size,omitempty"`
	DisplayOrder int64   `json:"display_order,omitempty"`
}

type TradableId

type TradableId struct {
	Identifier string `json:"identifier,omitempty"`
	MarketId   int64  `json:"market_id,omitempty"`
}

type TradableInfo

type TradableInfo struct {
	MarketId   int64         `json:"market_id,omitempty"`
	Identifier string        `json:"identifier,omitempty"`
	Iceberg    bool          `json:"iceberg,omitempty"`
	Calendar   []CalendarDay `json:"calendar,omitempty"`
	OrderTypes []OrderType   `json:"order_types,omitempty"`
}

type Trade

type Trade struct {
	Accno        int64      `json:"accno,omitempty"`
	OrderId      int64      `json:"order_id,omitempty"`
	TradeId      string     `json:"trade_id,omitempty"`
	Tradable     TradableId `json:"tradable,omitempty"`
	Price        Amount     `json:"price,omitempty"`
	Volume       float64    `json:"volume,omitempty"`
	Side         string     `json:"side,omitempty"`
	Counterparty string     `json:"counterparty,omitempty"`
	Tradetime    int64      `json:"tradetime,omitempty"`
}

type UnderlyingInfo

type UnderlyingInfo struct {
	InstrumentId int64  `json:"instrument_id,omitempty"`
	Symbol       string `json:"symbol,omitempty"`
	IsinCode     string `json:"isin_code,omitempty"`
}

type Validity

type Validity struct {
	Typ        string `json:"type,omitempty"`
	ValidUntil int64  `json:"valid_until,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL