// DescribeAccounts describes db accounts
//
// You can read doc at https://help.aliyun.com/document_detail/26265.html?spm=5176.doc26266.6.739.UjtjaI
357910
func (client *Client) DescribeAccounts(args *DescribeAccountsArgs) (resp *DescribeAccountsResponse, err error) {

	response := DescribeAccountsResponse{}

	err = client.Invoke("DescribeAccounts", args, &response)

	if err == nil {
		return &response, nil
	}

	return nil, err
}
984924
func (api *API) UpdateAccount(accountID string, account Account) (Account, error) {
	uri := "/accounts/" + accountID

	res, err := api.makeRequest("PUT", uri, account)
	if err != nil {
		return Account{}, errors.Wrap(err, errMakeRequestError)
	}

	var a AccountDetailResponse
	err = json.Unmarshal(res, &a)
	if err != nil {
		return Account{}, errors.Wrap(err, errUnmarshalError)
	}

	return a.Result, nil
}
447219
func (db *DB) DeleteAccount(model AccountModel) {
	db.Lock()
	defer db.Unlock()
	delete(db.bottles, model.ID)
	delete(db.accounts, model.ID)
}
747063
func (d *IdentityDescriber) Describe(namespace, name string, settings describe.DescriberSettings) (string, error) {
	userClient := d.c.Users()
	identityClient := d.c.Identities()

	identity, err := identityClient.Get(name, metav1.GetOptions{})
	if err != nil {
		return "", err
	}

	return tabbedString(func(out *tabwriter.Writer) error {
		formatMeta(out, identity.ObjectMeta)

		if len(identity.User.Name) == 0 {
			formatString(out, "User Name", identity.User.Name)
			formatString(out, "User UID", identity.User.UID)
		} else {
			resolvedUser, err := userClient.Get(identity.User.Name, metav1.GetOptions{})

			nameValue := identity.User.Name
			uidValue := string(identity.User.UID)

			if kerrs.IsNotFound(err) {
				nameValue += fmt.Sprintf(" (Error: User does not exist)")
			} else if err != nil {
				nameValue += fmt.Sprintf(" (Error: User lookup failed)")
			} else {
				if !sets.NewString(resolvedUser.Identities...).Has(name) {
					nameValue += fmt.Sprintf(" (Error: User identities do not include %s)", name)
				}
				if resolvedUser.UID != identity.User.UID {
					uidValue += fmt.Sprintf(" (Error: Actual user UID is %s)", string(resolvedUser.UID))
				}
			}

			formatString(out, "User Name", nameValue)
			formatString(out, "User UID", uidValue)
		}
		return nil
	})

}
324558
func (client *Client) ModifyAccountDescription(args *ModifyAccountDescriptionArgs) error {
	response := common.Response{}
	return client.Invoke("ModifyAccountDescription", args, &response)
}
935913
func (v *version) ServiceAccounts() ServiceAccountInformer {
	return &serviceAccountInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
1123265
func (d *TemplateInstanceDescriber) DescribeObjects(objects []templateapi.TemplateInstanceObject, out *tabwriter.Writer) {
	formatString(out, "Objects", " ")
	indent := "    "
	for _, o := range objects {
		formatString(out, indent+o.Ref.Kind, fmt.Sprintf("%s/%s", o.Ref.Namespace, o.Ref.Name))
	}
}
205632
func (c *Client) ShowAccount(ctx context.Context, path string) (*http.Response, error) {
	req, err := c.NewShowAccountRequest(ctx, path)
	if err != nil {
		return nil, err
	}
	return c.Client.Do(ctx, req)
}
679555
func (b *Broker) DescribeConfigs(request *DescribeConfigsRequest) (*DescribeConfigsResponse, error) {
	response := new(DescribeConfigsResponse)

	err := b.sendAndReceive(request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
108989
func (a AzureCLI) ListAccounts() ([]Account, error) {
	var accounts []Account
	if err := a.run(&accounts, "account", "list"); err != nil {
		return nil, errors.Trace(err)
	}
	return accounts, nil
}
293075
func (db *DB) NewAccount() (model AccountModel) {
	db.Lock()
	defer db.Unlock()
	db.maxAccountModelID++
	model = AccountModel{ID: db.maxAccountModelID}
	db.accounts[db.maxAccountModelID] = &model
	return
}
634829
func describeInstance(ec2Client EC2, instanceID InstanceID) (*ec2.Instance, error) {
	request := &ec2.DescribeInstancesInput{
		InstanceIds: []*string{instanceID.awsString()},
	}

	instances, err := ec2Client.DescribeInstances(request)
	if err != nil {
		return nil, err
	}
	if len(instances) == 0 {
		return nil, fmt.Errorf("no instances found for instance: %s", instanceID)
	}
	if len(instances) > 1 {
		return nil, fmt.Errorf("multiple instances found for instance: %s", instanceID)
	}
	return instances[0], nil
}
362654
func ValidateAccountDetails(details AccountDetails) error {
	if err := validateUser(details.User); err != nil {
		return errors.Trace(err)
	}
	// It is valid for a password to be blank, because the client
	// may use macaroons instead.
	return nil
}
858856
func (s *AccountsService) ListAccounts(options *ListOptions) (*accountsResponse, error) {
	path := versioned("/accounts")
	accountsResponse := &accountsResponse{}

	path, err := addURLQueryOptions(path, options)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.get(path, accountsResponse)
	if err != nil {
		return accountsResponse, err
	}

	accountsResponse.HttpResponse = resp
	return accountsResponse, nil
}
1057785
func (s *serviceAccountLister) ServiceAccounts(namespace string) ServiceAccountNamespaceLister {
	return serviceAccountNamespaceLister{indexer: s.indexer, namespace: namespace}
}
805654
func (client *Client) DescribeSubDomainRecords(args *DescribeSubDomainRecordsArgs) (response *DescribeSubDomainRecordsResponse, err error) {
	action := "DescribeSubDomainRecords"
	response = &DescribeSubDomainRecordsResponse{}
	err = client.Invoke(action, args, response)
	if err == nil {
		return response, nil
	} else {
		return nil, err
	}
}
757252
func NewAccountCaptureMigrateAccountType(Description string) *AccountCaptureMigrateAccountType {
	s := new(AccountCaptureMigrateAccountType)
	s.Description = Description
	return s
}