Documentation ¶
Index ¶
- Constants
- type CarunaAPIClient
- func (api *CarunaAPIClient) ConsumedHours(customer string, meteringPoint string, date time.Time) ([]ConsumerCost, error)
- func (api *CarunaAPIClient) CustomerInfo(customerId string) (*CustomerInfo, error)
- func (api *CarunaAPIClient) HttpGet(url string) (*http.Response, error)
- func (api *CarunaAPIClient) Login(username, password string) error
- func (api *CarunaAPIClient) LoginInfo() LoginInfo
- func (api *CarunaAPIClient) Logout() error
- func (api *CarunaAPIClient) MeteringPoints(customer string) ([]MeteringPoint, error)
- type ConsumerCost
- type ConsumptionPart
- type CustomerContactingPermissions
- type CustomerInfo
- type CustomerMarketingPermissions
- type ElectronicInvoiceAddress
- type LoginInfo
- type MeteringPoint
- type MeteringPointCoordinate
- type ParsedURL
- type PostalAddress
- type UserInfo
Constants ¶
View Source
const ( AuthorizationURL = "https://plus.caruna.fi/api/authorization/login" AuthenticationURL = "https://authentication2.caruna.fi" PortalURL = "https://authentication2.caruna.fi/portal" TokenURL = "https://plus.caruna.fi/api/authorization/token" RedirectURL = "https://plus.caruna.fi" CustomersURL = "https://plus.caruna.fi/api/customers" LogoutURL = "https://authentication2.caruna.fi/portal/logout" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CarunaAPIClient ¶
type CarunaAPIClient struct {
// contains filtered or unexported fields
}
func NewCarunaClient ¶
func NewCarunaClient() (*CarunaAPIClient, error)
func (*CarunaAPIClient) ConsumedHours ¶
func (api *CarunaAPIClient) ConsumedHours(customer string, meteringPoint string, date time.Time) ([]ConsumerCost, error)
func (*CarunaAPIClient) CustomerInfo ¶
func (api *CarunaAPIClient) CustomerInfo(customerId string) (*CustomerInfo, error)
func (*CarunaAPIClient) HttpGet ¶
func (api *CarunaAPIClient) HttpGet(url string) (*http.Response, error)
func (*CarunaAPIClient) Login ¶
func (api *CarunaAPIClient) Login(username, password string) error
func (*CarunaAPIClient) LoginInfo ¶
func (api *CarunaAPIClient) LoginInfo() LoginInfo
func (*CarunaAPIClient) Logout ¶
func (api *CarunaAPIClient) Logout() error
func (*CarunaAPIClient) MeteringPoints ¶
func (api *CarunaAPIClient) MeteringPoints(customer string) ([]MeteringPoint, error)
type ConsumerCost ¶
type ConsumerCost struct { Timestamp time.Time `json:"timestamp"` TotalConsumption float64 `json:"totalConsumption"` InvoicedConsumption float64 `json:"invoicedConsumption"` TotalFee float64 `json:"totalFee"` DistributionFee float64 `json:"distributionFee"` DistributionFeeBase float64 `json:"distributionFeeBase"` ElectricityTax float64 `json:"electricityTax"` ValueAddedTax float64 `json:"valueAddedTax"` Temperature float64 `json:"temperature"` InvoicedConsumptionByTransferProductParts ConsumptionPart `json:"invoicedConsumptionByTransferProductParts"` DistributionFeeByTransferProductParts ConsumptionPart `json:"distributionFeeByTransferProductParts"` }
type ConsumptionPart ¶
type CustomerContactingPermissions ¶
type CustomerContactingPermissions struct {
ViaEmail bool `json:"email"`
}
type CustomerInfo ¶
type CustomerInfo struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` BusinessID string `json:"businessId"` Phone string `json:"phone"` PostalAddress PostalAddress `json:"postalAddress"` BillingAddresses []PostalAddress `json:"billingAddresses"` MarketingPermissions CustomerMarketingPermissions `json:"marketingPermissions"` ContactingPermissions CustomerContactingPermissions `json:"contactingPermissions"` ElectronicInvoiceAddresses []ElectronicInvoiceAddress `json:"eInvoiceAddresses"` RepresentedCustomer bool `json:"representedCustomer"` JointCustomer bool `json:"jointCustomer"` IsMissingRequiredInfo bool `json:"isMissingRequiredInfo"` Language string `json:"language"` DefaultRefundAccount string `json:"defaultRefundAccount"` DefaultRefundAccountBIC string `json:"defaultRefundAccountBIC"` UpdateCampaignSeen bool `json:"updateCampaignSeen"` }
type ElectronicInvoiceAddress ¶
type ElectronicInvoiceAddress struct { ID string `json:"id"` AddressTypeKey string `json:"addressTypeKey"` Address string `json:"address"` Operator1 string `json:"operator1"` Operator2 string `json:"operator2"` OvtCode string `json:"ovtCode"` PaymentInstruction string `json:"paymentInstruction"` BuyerServiceCode int `json:"buyerSericeCode"` State int `json:"state"` }
type MeteringPoint ¶
type MeteringPoint struct { Type string `json:"type"` ID string `json:"id"` Address PostalAddress `json:"address"` AssetID string `json:"assetId"` ContractID string `json:"contractId"` ContractType string `json:"energyJunctionContract"` CustomerAddressId string `json:"customerAddressId"` IsSupplierInvoiced bool `json:"isSupplierInvoiced"` FuseSize string `json:"fuseSize"` Group string `json:"group"` NetworkID string `json:"networkId"` Position MeteringPointCoordinate `json:"position"` Tabs []string `json:"tabs"` Use string `json:"use"` CustomerID string `json:"customerId"` }
type MeteringPointCoordinate ¶
type ParsedURL ¶
func (*ParsedURL) UnmarshalJSON ¶
type PostalAddress ¶
type UserInfo ¶
type UserInfo struct { UserName string `json:"userName"` UserType string `json:"userType"` Email string `json:"email"` FirstName string `json:"FirstName"` LastName string `json:"LastName"` PhoneNumber string `json:"PhoneNumber"` ProfileURL ParsedURL `json:"iamProfileUrl"` OwnCustomerNumbers []string `json:"ownCustomerNumbers"` RepresentedCustomerNumbers []string `json:"representedCustomerNumbers"` HashedUserID string `json:"HashedUserId"` VisitorParams string `json:"giosgVisitorParams"` }
Click to show internal directories.
Click to hide internal directories.