// Alias is the name of the alias to rollover.
193860
func (s *IndicesRolloverService) Alias(alias string) *IndicesRolloverService {
	s.alias = alias
	return s
}
896740
func (a Aggregations) Derivative(name string) (*AggregationPipelineDerivative, bool) {
	if raw, found := a[name]; found {
		agg := new(AggregationPipelineDerivative)
		if raw == nil {
			return agg, true
		}
		if err := json.Unmarshal(raw, agg); err == nil {
			return agg, true
		}
	}
	return nil, false
}
135026
func (m *mixpanel) Alias(distinctId, newId string) error {
	props := map[string]interface{}{
		"token":       m.Token,
		"distinct_id": distinctId,
		"alias":       newId,
	}

	params := map[string]interface{}{
		"event":      "$create_alias",
		"properties": props,
	}

	return m.send("track", params, false)
}
857880
func (e *EnumDescriptor) alias() (s []string) {
	s = e.TypeName()
	if gogoproto.IsEnumCustomName(e.EnumDescriptorProto) {
		s[len(s)-1] = gogoproto.GetEnumCustomName(e.EnumDescriptorProto)
	}

	return
}
1141860
func (alias *AliasPackage) AddFunc(decl *ast.FuncDecl) (err error) {

	if decl == nil {
		err = errUnexpectedNil
		return
	}

	paramNames := collection.AsEnumerable(decl.Type.Params.List)
	paramNames = collection.SelectMany(paramNames, func(x interface{}) collection.Enumerator {
		return collection.AsEnumerable(x.(*ast.Field).Names).Enumerate(nil)
	})

	arguments := []ast.Expr{}

	for n := range paramNames.Enumerate(nil) {
		arguments = append(arguments, n.(*ast.Ident))
	}

	decl.Body = &ast.BlockStmt{
		List: []ast.Stmt{
			&ast.ReturnStmt{
				Results: []ast.Expr{
					&ast.CallExpr{
						Fun: &ast.SelectorExpr{
							X: &ast.Ident{
								Name: origImportAlias,
							},
							Sel: &ast.Ident{
								Name: decl.Name.Name,
							},
						},
						Args: arguments,
					},
				},
			},
		},
	}

	targetFile := alias.ModelFile()

	targetFile.Decls = append(targetFile.Decls, decl)

	return
}
964162
func (s *WorkspaceDirectory) SetAlias(v string) *WorkspaceDirectory {
	s.Alias = &v
	return s
}
321003
func aliased(exp Expression, alias interface{}) AliasedExpression {
	switch v := alias.(type) {
	case string:
		return aliasExpression{aliased: exp, alias: I(v)}
	case IdentifierExpression:
		return aliasExpression{aliased: exp, alias: v}
	default:
		panic(fmt.Sprintf("Cannot create alias from %+v", v))
	}
}
332127
func (c *CmdClause) Alias(name string) *CmdClause {
	c.aliases = append(c.aliases, name)
	return c
}
473754
func (a *AliasRemoveAction) Index(index ...string) *AliasRemoveAction {
	a.index = append(a.index, index...)
	return a
}
1251972
func addAlias(aliases map[string]string, importPath, pkgName string) {
	alias, ok := aliases[importPath]
	if ok {
		return
	}
	alias = makePackageAlias(aliases, pkgName)
	aliases[importPath] = alias
}
451331
func alias(inprogress map[string]*ServiceEntry, src, dst string) {
	srcEntry := ensureName(inprogress, src)
	inprogress[dst] = srcEntry
}
280622
func (self *AliasTypeDef) UnmarshalJSON(b []byte) error {
	var m rawAliasTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := AliasTypeDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}
107266
func (a *AliasRemoveAction) Source() (interface{}, error) {
	a.removeBlankIndexNames()
	if err := a.Validate(); err != nil {
		return nil, err
	}
	src := make(map[string]interface{})
	act := make(map[string]interface{})
	src["remove"] = act
	act["alias"] = a.alias
	switch len(a.index) {
	case 1:
		act["index"] = a.index[0]
	default:
		act["indices"] = a.index
	}
	return src, nil
}
905607
func (c *Conn) AddAlias(index string, alias string) (BaseResponse, error) {
	var url string
	var retval BaseResponse

	if len(index) > 0 {
		url = "/_aliases"
	} else {
		return retval, fmt.Errorf("You must specify an index to create the alias on")
	}

	jsonAliases := JsonAliases{}
	jsonAliasAdd := JsonAliasAdd{}
	jsonAliasAdd.Add.Alias = alias
	jsonAliasAdd.Add.Index = index
	jsonAliases.Actions = append(jsonAliases.Actions, jsonAliasAdd)
	requestBody, err := json.Marshal(jsonAliases)

	if err != nil {
		return retval, err
	}

	body, err := c.DoCommand("POST", url, nil, requestBody)
	if err != nil {
		return retval, err
	}

	jsonErr := json.Unmarshal(body, &retval)
	if jsonErr != nil {
		return retval, jsonErr
	}

	return retval, err
}
414361
func url2Alias(aliasedURL string) (alias, path string) {
	// Save aliased url.
	urlStr := aliasedURL

	// Convert '/' on windows to filepath.Separator.
	urlStr = filepath.FromSlash(urlStr)

	if runtime.GOOS == "windows" {
		// Remove '/' prefix before alias if any to support '\\home' alias
		// style under Windows
		urlStr = strings.TrimPrefix(urlStr, string(filepath.Separator))
	}

	// Remove everything after alias (i.e. after '/').
	urlParts := strings.SplitN(urlStr, string(filepath.Separator), 2)
	if len(urlParts) == 2 {
		// Convert windows style path separator to Unix style.
		return urlParts[0], urlParts[1]
	}
	return urlParts[0], ""
}
401908
func (conf *Config) Alias(server string) string {
	longestMatch := ""
	serverAlias := ""
	for alias, serverConf := range conf.Servers {
		if strings.HasPrefix(server, serverConf.Server) {
			if len(serverConf.Server) > len(longestMatch) {
				longestMatch = serverConf.Server
				serverAlias = alias
			}
		}
	}
	return serverAlias
}
234868
func (e EventBuilder) As(alias string) EventBuilder {
	e.fields[len(e.fields)-1].alias = alias
	return e
}