billing

package
v0.9.180 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package billing provides the billing service.

Package billing: billing client for open api

Index

Constants

View Source
const (
	DEFAULT_ENDPOINT        = "http://billing.baidubce.com"
	VERSION                 = "v1"
	URI_RESOURCE_MONTH_BILL = "/bill/resource/month"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*bce.BceClient
}

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) ResourceMonthBill

func (c *Client) ResourceMonthBill(month string, beginTime string, endTime string, productType string, serviceType string,
	queryAccountId string, pageNo int, pageSize int) (*ResourceMonthBillResponse, error)

ResourceMonthBill - get user's resource month bill

PARAMS:

  • month: the month of bill, format: yyyy-MM
  • beginTime: the start time of bill, format: yyyy-MM-dd
  • endTime: the end time of bill, format: yyyy-MM-dd
  • productType: is required. the type of bill, "postpay" or "prepay"
  • serviceType: bill filter condition. english code, em: "BCC","CDS"...
  • granularity: the granularity of bill, "monthly" or "daily"
  • queryAccountId: query sub-account
  • pageNo: the page number of result, min:1
  • pageSize: the size of each page, max:100

RETURNS:

  • error: nil if success otherwise the specific error

type ResourceMonthBill

type ResourceMonthBill struct {
	Vendor                          string  `json:"vendor"`
	BillId                          string  `json:"billId"`
	AccountId                       string  `json:"accountId"`
	ServiceType                     string  `json:"serviceType"`
	ServiceTypeName                 string  `json:"serviceTypeName"`
	ProductType                     string  `json:"productType"`
	Region                          string  `json:"region"`
	InstanceId                      string  `json:"instanceId"`
	InstanceName                    string  `json:"instanceName"`
	OrderId                         string  `json:"orderId"`
	OrderType                       string  `json:"orderType"`
	OrderTypeDesc                   string  `json:"orderTypeDesc"`
	OrderPurchaseTime               string  `json:"orderPurchaseTime"`
	StartTime                       string  `json:"startTime"`
	EndTime                         string  `json:"endTime"`
	ServiceStartTime                string  `json:"serviceStartTime"`
	ServiceEndTime                  string  `json:"serviceEndTime"`
	ConfigurationCH                 string  `json:"configurationCH"`
	Tag                             string  `json:"tag"`
	Duration                        string  `json:"duration"`
	ChargeItem                      string  `json:"chargeItem"`
	ChargeItemDesc                  string  `json:"chargeItemDesc"`
	Amount                          string  `json:"amount"`
	AmountUnit                      string  `json:"amountUnit"`
	DiscountAmount                  string  `json:"discountAmount"`
	UnitPrice                       string  `json:"unitPrice"`
	PricingUnit                     string  `json:"pricingUnit"`
	CatalogUnitPrice                string  `json:"catalogUnitPrice"`
	DiscountUnit                    string  `json:"discountUnit"`
	Tex                             string  `json:"tex"`
	OriginPrice                     float64 `json:"originPrice"`
	CatalogPrice                    float64 `json:"catalogPrice"`
	FinancePrice                    float64 `json:"financePrice"`
	Cash                            float64 `json:"cash"`
	Rebate                          float64 `json:"rebate"`
	CreditCost                      float64 `json:"creditCost"`
	CreditRefund                    float64 `json:"creditRefund"`
	CreditRefundDeduct              float64 `json:"creditRefundDeduct"`
	Debt                            float64 `json:"debt"`
	NoPaidPrice                     float64 `json:"noPaidPrice"`
	CouponPrice                     float64 `json:"couponPrice"`
	DiscountCouponPrice             float64 `json:"discountCouponPrice"`
	CashEquivalentCouponPrice       float64 `json:"cashEquivalentCouponPrice"`
	DiscountPrice                   float64 `json:"discountPrice"`
	SysGold                         float64 `json:"sysGold"`
	DeductPrice                     float64 `json:"deductPrice"`
	DeductCash                      float64 `json:"deductCash"`
	DeductRebate                    float64 `json:"deductRebate"`
	DeductCreditCost                float64 `json:"deductCreditCost"`
	DeductCouponPrice               float64 `json:"deductCouponPrice"`
	DeductDiscountCouponPrice       float64 `json:"deductDiscountCouponPrice"`
	DeductDiscountPrice             float64 `json:"deductDiscountPrice"`
	DeductCashEquivalentCouponPrice float64 `json:"deductCashEquivalentCouponPrice"`
}

type ResourceMonthBillResponse

type ResourceMonthBillResponse struct {
	BillMonth    string              `json:"billMonth"`
	BeginTime    string              `json:"beginTime"`
	EndTime      string              `json:"endTime"`
	AccountId    string              `json:"accountId"`
	LoginName    string              `json:"loginName"`
	SubAccountId string              `json:"subAccountId"`
	SubLoginName string              `json:"subLoginName"`
	OuName       string              `json:"ouName"`
	PageNo       int                 `json:"pageNo"`
	PageSize     int                 `json:"pageSize"`
	TotalCount   int                 `json:"totalCount"`
	Bills        []ResourceMonthBill `json:"bills"`
}

Jump to

Keyboard shortcuts

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