// Helper to grab account name for a client.
170994
func accForClient(c *client) string {
	if c.acc != nil {
		return c.acc.Name
	}
	return "N/A"
}
589714
func (v *Service) GetThriftName() (o string) {
	if v != nil {
		o = v.ThriftName
	}
	return
}
615998
func clientName(apiDef *raml.APIDefinition) string {
	splt := strings.Split(apiDef.Title, " ")
	return "client_" + strings.ToLower(splt[0])
}
624136
func (a *Account) FindOAuthClient(name string) (client *OAuthClient, err error) {
	err = a.get(a.auth.WithScope(scope.Clients), fmt.Sprintf("/api/v2/clients/%s", name), &client)
	return client, err
}
1298719
func (c *ServerContext) GetUsername() (string, error) {
	var ns _SecPkgContext_NativeNames
	ret := sspi.QueryContextAttributes(c.sctxt.Handle, _SECPKG_ATTR_NATIVE_NAMES, (*byte)(unsafe.Pointer(&ns)))
	if ret != sspi.SEC_E_OK {
		return "", ret
	}
	sspi.FreeContextBuffer((*byte)(unsafe.Pointer(ns.ServerName)))
	defer sspi.FreeContextBuffer((*byte)(unsafe.Pointer(ns.ClientName)))
	return syscall.UTF16ToString((*[2 << 20]uint16)(unsafe.Pointer(ns.ClientName))[:]), nil
}
278733
func (s *SourceImportAuthor) GetName() string {
	if s == nil || s.Name == nil {
		return ""
	}
	return *s.Name
}
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
}
494999
func GetUsername() *string {
	// user.Current only fails on some internal cache error: not sure what
	// corrective action is appropriate... on failure return NULL.
	if u, err := user.Current(); err == nil {
		return &u.Username
	}
	return nil
}
1192897
func (a *AccountService) Info() (AccountInfo, error) {
	req, err := a.client.newAuthenticatedRequest("GET", "account_infos", nil)

	if err != nil {
		return AccountInfo{}, err
	}

	var v []AccountInfo
	_, err = a.client.do(req, &v)

	if err != nil {
		return AccountInfo{}, err
	}

	return v[0], nil
}
1172671
func (ccid *CCID) GetName() string {
	if ccid.Version != "" {
		return fmt.Sprintf("%s-%s", ccid.Name, ccid.Version)
	}
	return ccid.Name
}
500378
func (a *Client) GetWorkflowsLibraryInjectableName(params *GetWorkflowsLibraryInjectableNameParams, authInfo runtime.ClientAuthInfoWriter) (*GetWorkflowsLibraryInjectableNameOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetWorkflowsLibraryInjectableNameParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetWorkflowsLibraryInjectableName",
		Method:             "GET",
		PathPattern:        "/workflows/library/{injectableName}",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetWorkflowsLibraryInjectableNameReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetWorkflowsLibraryInjectableNameOK), nil
}
1008557
func ValidateAccountName(name string) error {
	if name == "" {
		str := "accounts may not be named the empty string"
		return managerError(ErrInvalidAccount, str, nil)
	}
	if isReservedAccountName(name) {
		str := "reserved account name"
		return managerError(ErrInvalidAccount, str, nil)
	}
	return nil
}
225533
func (v *Function) GetName() (o string) {
	if v != nil {
		o = v.Name
	}
	return
}
1225216
func (c Client) Get() (*stripe.Account, error) {
	account := &stripe.Account{}
	err := c.B.Call(http.MethodGet, "/v1/account", c.Key, nil, account)
	return account, err
}
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
}
372416
func Name(s string) func(*Client) {
	return func(c *Client) {
		c.config.Name = s
	}
}
777741
func GetOauthClientID(service string) (string, error) {
	session := db.GetSession()
	defer session.Close()

	config := globalconfig.NewManager()
	globalconfig.InitModels()

	clientIDModel, err := config.GetByKey(service + "-clientid")
	log.Warn(clientIDModel.Value)
	if err != nil {
		log.Errorf("No Oauth client id found for %s. Please insert it into the collection globalconfig with key %s-clientid",
			service, service)
	}
	return clientIDModel.Value, err
}