// CreateOptionAlias function returns an option setter for setting endpoint alias
963415
func CreateOptionAlias(name string, alias string) EndpointOption {
	return func(ep *endpoint) {
		if ep.aliases == nil {
			ep.aliases = make(map[string]string)
		}
		ep.aliases[alias] = name
	}
}
1175486
func (s *SuggesterStatus) SetOptions(v *Suggester) *SuggesterStatus {
	s.Options = v
	return s
}
956381
func (s *UpdateCertificateOptionsInput) SetOptions(v *CertificateOptions) *UpdateCertificateOptionsInput {
	s.Options = v
	return s
}
1042703
func (s *UpdateAliasOutput) SetAlias(v *Alias) *UpdateAliasOutput {
	s.Alias = v
	return s
}
607080
func (a *StartArgs) SetOptions(options string) *StartArgs {
	a.Options = &options
	return a
}
259668
func (f *Fpdf) RegisterAlias(alias, replacement string) {
	f.aliasMap[alias] = replacement
}
1365377
func (s *AliasListEntry) SetAliasName(v string) *AliasListEntry {
	s.AliasName = &v
	return s
}
126619
func (m *MockLambdaAPI) UpdateAlias(arg0 *lambda.UpdateAliasInput) (*lambda.AliasConfiguration, error) {
	ret := m.ctrl.Call(m, "UpdateAlias", arg0)
	ret0, _ := ret[0].(*lambda.AliasConfiguration)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
171603
func (s *ConfigurationOptionSetting) SetOptionName(v string) *ConfigurationOptionSetting {
	s.OptionName = &v
	return s
}
317415
func (s *OptionGroupMembership) SetOptionGroupName(v string) *OptionGroupMembership {
	s.OptionGroupName = &v
	return s
}
1227737
func (s *Option) SetOptionDescription(v string) *Option {
	s.OptionDescription = &v
	return s
}
1276658
func setOptions(settings *Settings, options []Option) error {
	for _, option := range options {
		if option == nil {
			return errInvalidOption
		}
		err := option(settings)
		if err != nil {
			return err
		}
	}
	return nil
}
263812
func (t *Term) SetOption(options ...func(*Term) error) error {
	for _, opt := range options {
		if err := opt(t); err != nil {
			return err
		}
	}
	return nil
}
1214480
func (s *OptionSpecification) SetOptionName(v string) *OptionSpecification {
	s.OptionName = &v
	return s
}
907780
func (l *Loader) AddAlias(name, alias string) *Loader {
	l.Aliases[name] = alias
	return l
}
740957
func NewNodeAlias(s string) (NodeAlias, error) {
	var n NodeAlias

	if len(s) > 32 {
		return n, fmt.Errorf("alias too large: max is %v, got %v", 32,
			len(s))
	}

	if !utf8.ValidString(s) {
		return n, &ErrInvalidNodeAlias{}
	}

	copy(n[:], []byte(s))
	return n, 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
}