// Stories returns account stories.
//
// Use StoryMedia.Next for pagination.
//
// See example: examples/account/stories.go
436998
func (account *Account) Stories() *StoryMedia {
	media := &StoryMedia{}
	media.uid = account.ID
	media.inst = account.inst
	media.endpoint = urlUserStories
	return media
}
220075
func (s *Service) AccountFeatureInfo(ctx context.Context, accountFeatureIdentity string) (*AccountFeature, error) {
	var accountFeature AccountFeature
	return &accountFeature, s.Get(ctx, &accountFeature, fmt.Sprintf("/account/features/%v", accountFeatureIdentity), nil, nil)
}
47189
func (tracker *issueTracker) StoryTagToReadableStoryId(tag string) (storyId string, err error) {
	// The format is owner/repo#issueNum
	re := regexp.MustCompile("^[^/]+/[^#]+(#[0-9]+)$")
	match := re.FindStringSubmatch(tag)
	if len(match) == 0 {
		return "", fmt.Errorf("invalid GitHub issue tag: %v", tag)
	}
	return match[1], nil
}
167925
func (acct *account) Incidents(params map[string]string) (incidents []Incident, err error) {
	var (
		buf  []byte
		req  *http.Request
		resp *http.Response
	)

	endpoint := "api/v1/incidents"

	if len(params) > 0 {
		values := url.Values{}
		for k, v := range params {
			values.Set(k, v)
		}
		endpoint = fmt.Sprintf("%s?%s", endpoint, values.Encode())
	}

	if req, err = acct.getRequest(endpoint); err != nil {
		return
	}

	if resp, err = http.DefaultClient.Do(req); err != nil {
		return
	}

	if buf, err = ioutil.ReadAll(resp.Body); err != nil {
		return
	}

	defer resp.Body.Close()

	response := &IncidentsResponse{}

	if err = json.Unmarshal(buf, response); err != nil {
		return
	}

	incidents = response.Incidents
	return
}
1149083
func (api *API) AccountRoles(accountID string) ([]AccountRole, error) {
	uri := "/accounts/" + accountID + "/roles"

	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return []AccountRole{}, errors.Wrap(err, errMakeRequestError)
	}

	var accountRolesListResponse AccountRolesListResponse
	err = json.Unmarshal(res, &accountRolesListResponse)
	if err != nil {
		return []AccountRole{}, errors.Wrap(err, errUnmarshalError)
	}

	return accountRolesListResponse.Result, nil
}
1214496
func (s *PublicAccountAPI) Accounts() []common.Address {
	addresses := make([]common.Address, 0) // return [] instead of nil if empty
	for _, wallet := range s.am.Wallets() {
		for _, account := range wallet.Accounts() {
			addresses = append(addresses, account.Address)
		}
	}
	return addresses
}
371573
func (service *StoryService) Iterate(projectId int, filter string) (c *StoryCursor, err error) {
	reqFunc := newStoriesRequestFunc(service.client, projectId, filter)
	cursor, err := newCursor(service.client, reqFunc, PageLimit)
	if err != nil {
		return nil, err
	}
	return &StoryCursor{cursor, make([]*Story, 0)}, nil
}
1302130
func (c *client) Account() *Account {
	if c == nil {
		return nil
	}
	c.mu.Lock()
	defer c.mu.Unlock()
	return c.acc
}
479265
func (w *wallet) Accounts() []accounts.Account {
	// Attempt self-derivation if it's running
	reqc := make(chan struct{}, 1)
	select {
	case w.deriveReq <- reqc:
		// Self-derivation request accepted, wait for it
		<-reqc
	default:
		// Self-derivation offline, throttled or busy, skip
	}
	// Return whatever account list we ended up with
	w.stateLock.RLock()
	defer w.stateLock.RUnlock()

	cpy := make([]accounts.Account, len(w.accounts))
	copy(cpy, w.accounts)
	return cpy
}
947835
func (r *UserResource) Find(username string) (*Account, error) {
	user := Account{}
	path := fmt.Sprintf("/users/%s", username)

	if err := r.client.do("GET", path, nil, nil, &user); err != nil {
		return nil, err
	}

	return &user, nil
}
905033
func (wfe *WebFrontEndImpl) Account(
	ctx context.Context,
	logEvent *web.RequestEvent,
	response http.ResponseWriter,
	request *http.Request) {
	body, _, currAcct, prob := wfe.validPOSTForAccount(request, ctx, logEvent)
	addRequesterHeader(response, logEvent.Requester)
	if prob != nil {
		// validPOSTForAccount handles its own setting of logEvent.Errors
		wfe.sendError(response, logEvent, prob, nil)
		return
	}

	// Requests to this handler should have a path that leads to a known
	// account
	idStr := request.URL.Path
	id, err := strconv.ParseInt(idStr, 10, 64)
	if err != nil {
		wfe.sendError(response, logEvent, probs.Malformed("Account ID must be an integer"), err)
		return
	} else if id <= 0 {
		msg := fmt.Sprintf("Account ID must be a positive non-zero integer, was %d", id)
		wfe.sendError(response, logEvent, probs.Malformed(msg), nil)
		return
	} else if id != currAcct.ID {
		wfe.sendError(response, logEvent,
			probs.Unauthorized("Request signing key did not match account key"), nil)
		return
	}

	// If the body was not empty, then this is an account update request.
	if string(body) != "" {
		currAcct, prob = wfe.updateAccount(ctx, body, currAcct)
		if prob != nil {
			wfe.sendError(response, logEvent, prob, nil)
			return
		}
	}

	if len(wfe.SubscriberAgreementURL) > 0 {
		response.Header().Add("Link", link(wfe.SubscriberAgreementURL, "terms-of-service"))
	}

	// We populate the account Agreement field when creating a new response to
	// track which terms-of-service URL was in effect when an account with
	// "termsOfServiceAgreed":"true" is created. That said, we don't want to send
	// this value back to a V2 client. The "Agreement" field of an
	// account/registration is a V1 notion so we strip it here in the WFE2 before
	// returning the account.
	currAcct.Agreement = ""

	err = wfe.writeJsonResponse(response, logEvent, http.StatusOK, currAcct)
	if err != nil {
		// ServerInternal because we just generated the account, it should be OK
		wfe.sendError(response, logEvent,
			probs.ServerInternal("Failed to marshal account"), err)
		return
	}
}
832663
func (c *Client) AccountInfo() (*Account, error) {
	var account Account
	return &account, c.Get(&account, "/account")
}
1311749
func (s *Service) AccountFeatureList(ctx context.Context, lr *ListRange) (AccountFeatureListResult, error) {
	var accountFeature AccountFeatureListResult
	return accountFeature, s.Get(ctx, &accountFeature, fmt.Sprintf("/account/features"), nil, lr)
}
823706
func (c *connections) Models() []string {
	models := set.NewStrings()
	for _, value := range c.values {
		models.Add(value.Model)
	}
	return models.Values()
}
256645
func (r Network_Media_Transcode_Account) CreateTranscodeAccount() (resp bool, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Media_Transcode_Account", "createTranscodeAccount", nil, &r.Options, &resp)
	return
}
801828
func NewNews(articles []*Article) *News {
	news := new(News)
	news.ArticleCount = len(articles)
	news.Articles = articles
	return news
}
1353569
func (rpc *EthRPC) EthAccounts() ([]string, error) {
	accounts := []string{}

	err := rpc.call("eth_accounts", &accounts)
	return accounts, err
}