Documentation ¶
Overview ¶
Package fintual provides utilties for interfacing with the Fintual API.
Index ¶
- Constants
- type AssetProvider
- type AssetProviderAttributes
- type AssetProvidersService
- type Bank
- type BankAttributes
- type BankListParams
- type BanksService
- type Client
- type ConceptualAsset
- type ConceptualAssetAttributes
- type ConceptualAssetListParams
- type ConceptualAssetRealAsset
- type ConceptualAssetRealAssetAttributes
- type ConceptualAssetRealAssetLastDay
- type ConceptualAssetsService
- func (s *ConceptualAssetsService) Get(ctx context.Context, id string) (*ConceptualAsset, error)
- func (s *ConceptualAssetsService) ListAll(ctx context.Context, params *ConceptualAssetListParams) ([]*ConceptualAsset, error)
- func (s *ConceptualAssetsService) ListByAssetProvider(ctx context.Context, id string, params *ConceptualAssetListParams) ([]*ConceptualAsset, error)
- type Credentials
- type Error
- type ExpenseRationRealAsset
- type ExpenseRationRealAssetAttributes
- type Goal
- type GoalAttributes
- type GoalsService
- type Investment
- type LastDay
- type RealAsset
- type RealAssetAttributes
- type RealAssetDay
- type RealAssetDayAttributes
- type RealAssetsService
- func (s *RealAssetsService) Get(ctx context.Context, id string) (*RealAsset, error)
- func (s *RealAssetsService) GetDay(ctx context.Context, id string, date string) ([]*RealAssetDay, error)
- func (s *RealAssetsService) GetExpenseRatio(ctx context.Context, id string) (*ExpenseRationRealAsset, error)
- func (s *RealAssetsService) ListByConceptualAsset(ctx context.Context, id string) ([]*ConceptualAssetRealAsset, error)
- func (s *RealAssetsService) ListDaysByDates(ctx context.Context, id, from, to string) ([]*RealAssetDay, error)
Constants ¶
const Version = "1.0.0"
Version is the version of this library.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetProvider ¶
type AssetProvider struct { ID string `json:"id"` Type string `json:"type"` Attributes AssetProviderAttributes `json:"attributes"` }
type AssetProviderAttributes ¶
type AssetProviderAttributes struct {
Name string `json:"name"`
}
type AssetProvidersService ¶
type AssetProvidersService service
AssetProvidersService handles communication with the Asset Providers related methods of the Fintual API.
Fintual API docs: https://fintual.cl/api-docs
func (*AssetProvidersService) Get ¶
func (s *AssetProvidersService) Get(ctx context.Context, id string) (*AssetProvider, error)
Get retrieves a single asset provider.
Endpoint: GET /asset_providers/:id
func (*AssetProvidersService) ListAll ¶
func (s *AssetProvidersService) ListAll(ctx context.Context) ([]*AssetProvider, error)
ListAll lists all asset providers.
Endpoint: GET /asset_providers
type Bank ¶
type Bank struct { ID string `json:"id"` Type string `json:"type"` Attributes BankAttributes `json:"attributes"` }
type BankAttributes ¶
type BankAttributes struct {
Name string `json:"name"`
}
type BankListParams ¶
type BankListParams struct {
Query string `url:"q,omitempty"` // For filtering results
}
BankListParams specifies the optional parameters to the BanksService.ListAll method.
type BanksService ¶
type BanksService service
BanksService handles communication with the Banks related methods of the Fintual API.
Fintual API docs: https://fintual.cl/api-docs
func (*BanksService) ListAll ¶
func (s *BanksService) ListAll(ctx context.Context, params *BankListParams) ([]*Bank, error)
ListAll lists all Banks. Receives a params argument with a Query property for filtering Banks by the Name attribute.
Endpoint: GET /banks
type Client ¶
type Client struct { // Services used for talking to different parts of the Fintual API. AssetProviders *AssetProvidersService Banks *BanksService ConceptualAssets *ConceptualAssetsService Goals *GoalsService RealAssets *RealAssetsService // contains filtered or unexported fields }
type ConceptualAsset ¶
type ConceptualAsset struct { ID string `json:"id"` Type string `json:"type"` Attributes ConceptualAssetAttributes `json:"attributes"` }
type ConceptualAssetListParams ¶
type ConceptualAssetListParams struct { Name string `url:"name,omitempty"` // For filtering results by name Run string `url:"run,omitempty"` // For filtering results by run identifier }
ConceptualAssetListParams specifies the optional parameters to the ListConceptualAssets method.
type ConceptualAssetRealAsset ¶
type ConceptualAssetRealAsset struct { ID string `json:"id"` Type string `json:"type"` Attributes ConceptualAssetRealAssetAttributes `json:"attributes"` }
type ConceptualAssetRealAssetAttributes ¶
type ConceptualAssetRealAssetAttributes struct { Name string `json:"name"` Symbol string `json:"symbol"` Serie string `json:"serie"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` PreviousAssetID string `json:"previous_asset_id"` LastDay ConceptualAssetRealAssetLastDay `json:"last_day"` ConceptualAssetID int `json:"conceptual_asset_id"` }
type ConceptualAssetsService ¶
type ConceptualAssetsService service
ConceptualAssetsService handles communication with the Conceptual Assets related methods of the Fintual API.
Fintual API docs: https://fintual.cl/api-docs
func (*ConceptualAssetsService) Get ¶
func (s *ConceptualAssetsService) Get(ctx context.Context, id string) (*ConceptualAsset, error)
Get retrieves a single Conceptual Asset.
Endpoint: GET /conceptual_assets/:id
func (*ConceptualAssetsService) ListAll ¶
func (s *ConceptualAssetsService) ListAll(ctx context.Context, params *ConceptualAssetListParams) ([]*ConceptualAsset, error)
ListAll lists all conceptual assets. Receives a params argument with Name and/or Run properties for filtering Conceptual Assets by the Name and Run attributes.
Endpoint: GET /conceptual_assets
func (*ConceptualAssetsService) ListByAssetProvider ¶
func (s *ConceptualAssetsService) ListByAssetProvider(ctx context.Context, id string, params *ConceptualAssetListParams) ([]*ConceptualAsset, error)
ListByAssetProvider lists all Conceptual Assets of a given Asset Provider. Receives a params argument with Name and/or Run properties for filtering Conceptual Assets by the Name and Run attributes.
Endpoint: GET /asset_providers/:id/conceptual_assets
type Credentials ¶
type Error ¶
type Error struct { Code int `json:"code"` // The HTTP status code. Status string `json:"status"` // The HTTP response status (error or success). Message string `json:"message"` // A short description of the error. }
Error represents an error returned by the Fintual API.
type ExpenseRationRealAsset ¶
type ExpenseRationRealAsset struct { ID string `json:"id"` Type string `json:"type"` Attributes ExpenseRationRealAssetAttributes `json:"attributes"` }
type ExpenseRationRealAssetAttributes ¶
type ExpenseRationRealAssetAttributes struct {
ExpenseRatio float64 `json:"expense_ratio"`
}
type Goal ¶
type Goal struct { ID string `json:"id"` Type string `json:"type"` Attributes GoalAttributes `json:"attributes"` }
type GoalAttributes ¶
type GoalAttributes struct { Name string `json:"name"` NameWithoutSuffix string `json:"name_without_suffix"` NetAssetValue float64 `json:"nav"` CreatedAt string `json:"created_at"` Timeframe int `json:"timeframe"` Deposited float64 `json:"deposited"` Hidden bool `json:"hidden"` Profit float64 `json:"profit"` Investments []Investment `json:"investments"` PublicLink interface{} `json:"public_link"` ParamID int64 `json:"param_id"` GoalType string `json:"goal_type"` TranslatedGoalType string `json:"translated_goal_type"` Regime interface{} `json:"regime"` Completed bool `json:"completed"` HasAnyWithdrawals bool `json:"has_any_withdrawals"` EligibleForDeposits bool `json:"eligible_for_deposits"` EligibleForInternalMlt bool `json:"eligible_for_internal_mlt"` MonthlyDeposit float64 `json:"monthly_deposit"` SimulatedDeposit float64 `json:"simulated_deposit"` FundsSource interface{} `json:"funds_source"` FundsSourceDescription interface{} `json:"funds_source_description"` NotNetDeposited float64 `json:"not_net_deposited"` Withdrawn float64 `json:"withdrawn"` GroupGoalID interface{} `json:"group_goal_id"` }
type GoalsService ¶
type GoalsService service
GoalsService handles communication with the Goals related methods of the Fintual API.
Fintual API docs: https://fintual.cl/api-docs
type Investment ¶
type LastDay ¶
type LastDay struct { FixedManagementFee float64 `json:"fixed_management_fee"` IvaExclusiveExpenses float64 `json:"iva_exclusive_expenses"` IvaInclusiveExpenses float64 `json:"iva_inclusive_expenses"` NetAssetValue float64 `json:"net_asset_value"` PurchaseFee float64 `json:"purchase_fee"` RedemptionFee float64 `json:"redemption_fee"` TotalAssets float64 `json:"total_assets"` TotalNetAssets float64 `json:"total_net_assets"` VariableManagementFee float64 `json:"variable_management_fee"` FixedFee float64 `json:"fixed_fee"` InstitutionalInvestors float64 `json:"institutional_investors"` Date string `json:"date"` }
type RealAsset ¶
type RealAsset struct { ID string `json:"id"` Type string `json:"type"` Attributes RealAssetAttributes `json:"attributes"` }
type RealAssetAttributes ¶
type RealAssetAttributes struct { Name string `json:"name"` Symbol string `json:"symbol"` Serie string `json:"serie"` StartDate string `json:"start_date"` EndDate interface{} `json:"end_date"` PreviousAssetID interface{} `json:"previous_asset_id"` LastDay LastDay `json:"last_day"` ConceptualAssetID int `json:"conceptual_asset_id"` }
type RealAssetDay ¶
type RealAssetDay struct { ID string `json:"id"` Type string `json:"type"` Attributes RealAssetDayAttributes `json:"attributes"` }
type RealAssetDayAttributes ¶
type RealAssetDayAttributes struct { Date string `json:"date"` Price float64 `json:"price"` FixedManagementFee float64 `json:"fixed_management_fee"` FixedManagementFeeType string `json:"fixed_management_fee_type"` IvaExclusiveExpenses float64 `json:"iva_exclusive_expenses"` IvaExclusiveExpensesType string `json:"iva_exclusive_expenses_type"` IvaInclusiveExpenses float64 `json:"iva_inclusive_expenses"` IvaInclusiveExpensesType string `json:"iva_inclusive_expenses_type"` NetAssetValue float64 `json:"net_asset_value"` NetAssetValueType string `json:"net_asset_value_type"` PurchaseFee float64 `json:"purchase_fee"` PurchaseFeeType string `json:"purchase_fee_type"` RedemptionFee float64 `json:"redemption_fee"` RedemptionFeeType string `json:"redemption_fee_type"` TotalAssets float64 `json:"total_assets"` TotalAssetsType string `json:"total_assets_type"` TotalNetAssets float64 `json:"total_net_assets"` TotalNetAssetsType string `json:"total_net_assets_type"` VariableManagementFee float64 `json:"variable_management_fee"` VariableManagementFeeType string `json:"variable_management_fee_type"` FixedFee float64 `json:"fixed_fee"` FixedFeeType string `json:"fixed_fee_type"` InstitutionalInvestors float64 `json:"institutional_investors"` InstitutionalInvestorsType string `json:"institutional_investors_type"` }
type RealAssetsService ¶
type RealAssetsService service
RealAssetsService handles communication with the Real Assets related methods of the Fintual API.
Fintual API docs: https://fintual.cl/api-docs
func (*RealAssetsService) GetDay ¶
func (s *RealAssetsService) GetDay(ctx context.Context, id string, date string) ([]*RealAssetDay, error)
GetDay retrieves a Real Asset Day. Receives a Real Asset ID and a string date with format YYYY-MM-DD.
Endpoint: GET /real_assets/:id/days
func (*RealAssetsService) GetExpenseRatio ¶
func (s *RealAssetsService) GetExpenseRatio(ctx context.Context, id string) (*ExpenseRationRealAsset, error)
GetExpenseRatio retrieves the Expense Ratio for a single Real Asset.
Endpoint: GET /real_assets/:id/expense_ratio
func (*RealAssetsService) ListByConceptualAsset ¶
func (s *RealAssetsService) ListByConceptualAsset(ctx context.Context, id string) ([]*ConceptualAssetRealAsset, error)
ListByConceptualAsset lists all Real Assets of a given Conceptual Asset.
Endpoint: GET /conceptual_assets/:id/real_assets
func (*RealAssetsService) ListDaysByDates ¶
func (s *RealAssetsService) ListDaysByDates(ctx context.Context, id, from, to string) ([]*RealAssetDay, error)
ListDaysByDates lists Real Asset Days. Receives a Real Asset ID and a from and to string dates with format YYYY-MM-DD.
Endpoint: GET /real_assets/:id/days