// Retrieve The total amount of an account's pending invoice, if one exists.
489875
func (r Account) GetPendingInvoiceTotalAmount() (resp datatypes.Float64, err error) {
	err = r.Session.DoRequest("SoftLayer_Account", "getPendingInvoiceTotalAmount", nil, &r.Options, &resp)
	return
}
730371
func (account *Account) PendingFollowRequests() ([]User, error) {
	insta := account.inst
	resp, err := insta.sendRequest(
		&reqOptions{
			Endpoint: urlFriendshipPending,
		},
	)
	if err != nil {
		return nil, err
	}

	var result struct {
		Users []User `json:"users"`
		// TODO: pagination
		// TODO: SuggestedUsers
		Status string `json:"status"`
	}
	err = json.Unmarshal(resp, &result)
	if err != nil {
		return nil, err
	}
	if result.Status != "ok" {
		return nil, fmt.Errorf("bad status: %s", result.Status)
	}

	return result.Users, nil
}
34393
func GetPendingCounts(c context.Context, builders []string) ([]int, error) {
	entities := make([]builderEntity, len(builders))
	for i, b := range builders {
		parts := strings.SplitN(b, "/", 2)
		if len(parts) < 2 {
			return nil, errors.Reason("builder does not have a slash: %q", b).Err()
		}
		entities[i].MasterKey = datastore.MakeKey(c, masterKind, parts[0])
		entities[i].Name = parts[1]
	}
	if err := datastore.Get(c, entities); err != nil {
		for _, e := range err.(errors.MultiError) {
			if e != nil && e != datastore.ErrNoSuchEntity {
				return nil, err
			}
		}
	}

	counts := make([]int, len(entities))
	for i, e := range entities {
		counts[i] = e.PendingCount
	}
	return counts, nil
}
1279270
func (i *Import) GetCommitCount() int {
	if i == nil || i.CommitCount == nil {
		return 0
	}
	return *i.CommitCount
}
455790
func (r Account) GetNextInvoiceZeroFeeItemCounts() (resp []datatypes.Container_Product_Item_Category_ZeroFee_Count, err error) {
	err = r.Session.DoRequest("SoftLayer_Account", "getNextInvoiceZeroFeeItemCounts", nil, &r.Options, &resp)
	return
}
907812
func (c *Client) AccountEstimateInvoice(mode string, term *int, planID *int,
	linodeID *int) (EstimatedInvoice, error) {

	args := make(map[string]interface{})
	args["mode"] = mode
	args["PaymentTerm"] = term
	args["PlanID"] = planID
	args["LinodeID"] = linodeID

	data, err := c.apiCall("account.estimateinvoice", args)
	if err != nil {
		return EstimatedInvoice{}, err
	}

	var inv EstimatedInvoice
	err = json.Unmarshal(data, &inv)
	if err != nil {
		return EstimatedInvoice{}, err
	}

	return inv, nil
}
1301107
func (s *Service) InvoiceAddressInfo(ctx context.Context) (*InvoiceAddress, error) {
	var invoiceAddress InvoiceAddress
	return &invoiceAddress, s.Get(ctx, &invoiceAddress, fmt.Sprintf("/account/invoice-address"), nil, nil)
}
632868
func (c *Users) GetAccount(in *GetAccountInput) (out *GetAccountOutput, err error) {
	body, err := c.call("/users/get_account", in)
	if err != nil {
		return
	}
	defer body.Close()

	err = json.NewDecoder(body).Decode(&out)
	return
}
1275314
func (s *Server) fetchAccount(name string) (*Account, error) {
	if accClaims, claimJWT, err := s.fetchAccountClaims(name); accClaims != nil {
		// We have released the lock during the low level fetch.
		// Now that we are back under lock, check again if account
		// is in the map or not. If it is, simply return it.
		if v, ok := s.accounts.Load(name); ok {
			acc := v.(*Account)
			// Update with the new claims in case they are new.
			// Following call will return ErrAccountResolverSameClaims
			// if claims are the same.
			err = s.updateAccountWithClaimJWT(acc, claimJWT)
			if err != nil && err != ErrAccountResolverSameClaims {
				return nil, err
			}
			return acc, nil
		}
		acc := s.buildInternalAccount(accClaims)
		acc.claimJWT = claimJWT
		s.registerAccount(acc)
		return acc, nil
	} else {
		return nil, err
	}
}
397351
func (s *NotificationServer) AccountSpentnessNotifications(account uint32) SpentnessNotificationsClient {
	c := make(chan *SpentnessNotifications)
	s.mu.Lock()
	s.spentness[account] = append(s.spentness[account], c)
	s.mu.Unlock()
	return SpentnessNotificationsClient{
		C:       c,
		account: account,
		server:  s,
	}
}
449983
func (ec *EthereumClient) GetTransactionCount(ctx *Context, hash *Hash) (count int, _ error) {
	rawCount, err := ec.client.TransactionCount(ctx.context, hash.hash)
	return int(rawCount), err
}
1226315
func (c *CombinedStatus) GetTotalCount() int {
	if c == nil || c.TotalCount == nil {
		return 0
	}
	return *c.TotalCount
}
1121100
func (r Account) GetPendingInvoiceTopLevelItems() (resp []datatypes.Billing_Invoice_Item, err error) {
	err = r.Session.DoRequest("SoftLayer_Account", "getPendingInvoiceTopLevelItems", nil, &r.Options, &resp)
	return
}
1177696
func (t *TrafficViews) GetCount() int {
	if t == nil || t.Count == nil {
		return 0
	}
	return *t.Count
}
124885
func (r Billing_Invoice_Item) GetTotalOneTimeAmount() (resp datatypes.Float64, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Invoice_Item", "getTotalOneTimeAmount", nil, &r.Options, &resp)
	return
}
210623
func (api *Client) GetAccount() (*Account, error) {
	result, _, err := api.makeRequest(http.MethodGet, api.concatUserPath(accountPath), &Account{})
	if err != nil {
		return nil, err
	}
	return result.(*Account), nil
}
135708
func getUnconfirmedBalance(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
	cmd := icmd.(*btcjson.GetUnconfirmedBalanceCmd)

	acctName := "default"
	if cmd.Account != nil {
		acctName = *cmd.Account
	}
	account, err := w.AccountNumber(waddrmgr.KeyScopeBIP0044, acctName)
	if err != nil {
		return nil, err
	}
	bals, err := w.CalculateAccountBalances(account, 1)
	if err != nil {
		return nil, err
	}

	return (bals.Total - bals.Spendable).ToBTC(), nil
}