// ShowAccount returns the account details for the account with the given
// subscription ID. If the subscription is empty then the default Azure
// CLI account is returned.
551282
func (a AzureCLI) ShowAccount(subscription string) (*Account, error) {
	cmd := []string{"account", "show"}
	if subscription != "" {
		cmd = append(cmd, "--subscription", subscription)
	}
	var acc showAccount
	if err := a.run(&acc, cmd...); err != nil {
		return nil, errors.Trace(err)
	}
	if acc.Account.CloudName == "" {
		acc.Account.CloudName = acc.EnvironmentName
	}
	return &acc.Account, nil
}
941133
func (c *Client) GetAccountInfo() (info AccountInfo, err error) {
	if err := c.get(`account/info`, &info); err != nil {
		return AccountInfo{}, err
	}
	return
}
628527
func (c *Client) AccountInfo() (AccInfo, error) {
	data, err := c.apiCall("account.info", nil)
	if err != nil {
		return AccInfo{}, err
	}

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

	return info, nil
}
123993
func (idt *IdentityTable) StellarAccountID() *stellar1.AccountID {
	// Return the account ID of the latest link with the network set to stellar.
	if idt.stellar == nil {
		return nil
	}
	link := idt.stellar
	if link.network == string(WalletNetworkStellar) {
		// Something should have already validated link.address as a stellar account ID.
		tmp := stellar1.AccountID(link.address)
		return &tmp
	}
	return nil
}
597218
func (c *UsersController) Show(ctx *app.ShowUsersContext) error {
	return proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())
}
948689
func (c *gceCloudImplementation) ServiceAccount() (string, error) {
	if c.projectInfo == nil {
		// Find the project info from the compute API, which includes the default service account
		glog.V(2).Infof("fetching project %q from compute API", c.project)
		p, err := c.compute.Projects.Get(c.project).Do()
		if err != nil {
			return "", fmt.Errorf("error fetching info for project %q: %v", c.project, err)
		}

		c.projectInfo = p
	}

	if c.projectInfo.DefaultServiceAccount == "" {
		return "", fmt.Errorf("compute project %q did not have DefaultServiceAccount", c.project)
	}

	return c.projectInfo.DefaultServiceAccount, nil
}
970567
func GetAccount(host, token, id string) (*map[string]interface{}, error) {
	path := variables.APIPathAccount
	path = strings.Replace(path, ":id", id, 1)
	return GenericRequest(host, path, token, nil)
}
610503
func (s *AccountService) EnableAccount(p *EnableAccountParams) (*EnableAccountResponse, error) {
	resp, err := s.cs.newRequest("enableAccount", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r EnableAccountResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
270716
func (a AzureCLI) FindAccountsWithCloudName(name string) ([]Account, error) {
	var accounts []Account
	cmd := []string{
		"account",
		"list",
		"--query", fmt.Sprintf("[?cloudName=='%s']", name),
	}
	if err := a.run(&accounts, cmd...); err != nil {
		return nil, errors.Trace(err)
	}
	return accounts, nil
}
1180985
func NewAccount(ctx context.Context, email string, keyTypeValue string) (*Account, error) {
	keyType := GetKeyType(ctx, keyTypeValue)

	// Create a user. New accounts need an email and private key to start
	privateKey, err := rsa.GenerateKey(rand.Reader, 4096)
	if err != nil {
		return nil, err
	}

	return &Account{
		Email:      email,
		PrivateKey: x509.MarshalPKCS1PrivateKey(privateKey),
		KeyType:    keyType,
	}, nil
}
753798
func (s *AccountService) GetAccountByID(id string, opts ...OptionFunc) (*Account, int, error) {
	p := &ListAccountsParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListAccounts(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.Accounts[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for Account UUID: %s!", id)
}
1021069
func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error) {
	acc, err := fetchKeystore(s.am).NewAccount(password)
	if err == nil {
		return acc.Address, nil
	}
	return common.Address{}, err
}
574354
func (s *LocalStore) GetAccount() (*Account, error) {
	storedData, err := s.get()
	if err != nil {
		return nil, err
	}

	return storedData.Account, nil
}
1342332
func (c *Client) showUsers(ctx context.Context) ([]chronograf.User, error) {
	res, err := c.Query(ctx, chronograf.Query{
		Command: `SHOW USERS`,
	})
	if err != nil {
		return nil, err
	}
	octets, err := res.MarshalJSON()
	if err != nil {
		return nil, err
	}

	results := showResults{}
	if err := json.Unmarshal(octets, &results); err != nil {
		return nil, err
	}

	return results.Users(), nil
}
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
}
706346
func ToAccountLink(accountID int) *app.AccountLink {
	return &app.AccountLink{
		ID:   accountID,
		Href: app.AccountHref(accountID),
	}
}
374462
func Show(cmd *cli.Cmd) {
	email := cmd.String(cli.StringArg{
		Name:      "EMAIL",
		Desc:      "email address",
		HideValue: true,
	})

	cmd.Action = func() {
		a := authorization.Account{
			Email: *email,
		}

		account, resp, errs := a.Show()

		if len(errs) > 0 {
			log.Fatalf("Could not retrieve account: %s", errs[0])
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Could not retrieve account: %s", resp.Status)
		}

		printAccountDetail(account)
	}
}