// NewIndicesGetSettingsService creates a new IndicesGetSettingsService.
9966
func NewIndicesGetSettingsService(client *Client) *IndicesGetSettingsService {
	return &IndicesGetSettingsService{
		client: client,
		index:  make([]string, 0),
		name:   make([]string, 0),
	}
}
924173
func (context *OpsManager) GetInstallationSettings() (settings io.Reader, err error) {
	var bytesBuffer = new(bytes.Buffer)
	url := fmt.Sprintf(OpsMgrInstallationSettingsURL, context.Hostname)
	lo.G.Debug(fmt.Sprintf("Exporting url '%s'", url))

	if err = context.saveHTTPResponse(url, bytesBuffer); err == nil {
		settings = bytesBuffer
	}
	return
}
1210234
func NewGCSWatcherService(opts ...GCSWatcherOption) (GCSWatcherService, error) {
	s := &gcsWatcherService{
		QueueName:           "",
		BackupBucketName:    "",
		OCNReceiveURL:       "/api/gcs/object-change-notification",
		GCSObjectToBQJobURL: "/tq/gcs/object-to-bq",
	}

	for _, opt := range opts {
		opt.implements(s)
	}

	if len(s.ImportTargetKinds) == 0 && len(s.ImportTargetKindNames) == 0 {
		return nil, ErrInvalidState
	}
	if s.DatasetID == "" {
		return nil, ErrInvalidState
	}

	return s, nil
}
750150
func (c *Client) RelationUnitSettings(relationUnits []params.RelationUnit) ([]params.SettingsResult, error) {
	args := params.RelationUnits{relationUnits}
	var results params.SettingsResults
	err := c.facade.FacadeCall("RelationUnitSettings", args, &results)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if len(results.Results) != len(relationUnits) {
		return nil, errors.Errorf("expected %d result(s), got %d", len(relationUnits), len(results.Results))
	}
	return results.Results, nil
}
1173214
func (c *Client) GetServiceInstances(serviceID string) ([]service.Instance, error) {
	insts := []service.Instance{}

	err := c.call("GetServiceInstances", serviceID, &insts)
	if err != nil {
		return nil, err
	}
	return insts, nil
}
552732
func GetSettings(c context.Context) *Settings {
	set := Settings{}
	switch err := settings.Get(c, baseName, &set); err {
	case nil:
		break
	case settings.ErrNoSettings:
		// Defaults.
		set = defaultSettings
	default:
		panic(fmt.Errorf("could not fetch Archivist settings - %s", err))
	}
	return &set
}
1316108
func NewIndicesForcemergeService(client *Client) *IndicesForcemergeService {
	return &IndicesForcemergeService{
		client: client,
		index:  make([]string, 0),
	}
}
302853
func NewGetService(ctx *middleware.Context, handler GetServiceHandler) *GetService {
	return &GetService{Context: ctx, Handler: handler}
}
695002
func NewIndicesFlushService(client *Client) *IndicesFlushService {
	return &IndicesFlushService{
		client: client,
		index:  make([]string, 0),
	}
}
1305845
func NewAuthorizationService() *AuthorizationService {
	return &AuthorizationService{
		FindAuthorizationByIDFn:    func(context.Context, platform.ID) (*platform.Authorization, error) { return nil, nil },
		FindAuthorizationByTokenFn: func(context.Context, string) (*platform.Authorization, error) { return nil, nil },
		FindAuthorizationsFn: func(context.Context, platform.AuthorizationFilter, ...platform.FindOptions) ([]*platform.Authorization, int, error) {
			return nil, 0, nil
		},
		CreateAuthorizationFn:    func(context.Context, *platform.Authorization) error { return nil },
		DeleteAuthorizationFn:    func(context.Context, platform.ID) error { return nil },
		SetAuthorizationStatusFn: func(context.Context, platform.ID, platform.Status) error { return nil },
	}
}
471986
func (api *API) ZoneSettings(zoneID string) (*ZoneSettingResponse, error) {
	uri := "/zones/" + zoneID + "/settings"
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return nil, errors.Wrap(err, errMakeRequestError)
	}

	response := &ZoneSettingResponse{}
	err = json.Unmarshal(res, &response)
	if err != nil {
		return nil, errors.Wrap(err, errUnmarshalError)
	}

	return response, nil
}
1100405
func (c *Client) CreateRequestSetting(i *CreateRequestSettingInput) (*RequestSetting, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	path := fmt.Sprintf("/service/%s/version/%d/request_settings", i.Service, i.Version)
	resp, err := c.PostForm(path, i, nil)
	if err != nil {
		return nil, err
	}

	var b *RequestSetting
	if err := decodeJSON(&b, resp.Body); err != nil {
		return nil, err
	}
	return b, nil
}
1101519
func NewIndicesRolloverService(client *Client) *IndicesRolloverService {
	return &IndicesRolloverService{
		client:     client,
		conditions: make(map[string]interface{}),
		settings:   make(map[string]interface{}),
		mappings:   make(map[string]interface{}),
	}
}
1098567
func (s *FlushService) AllowNoIndices(allowNoIndices bool) *FlushService {
	s.allowNoIndices = &allowNoIndices
	return s
}
81329
func NewPutMappingService(client *Client) *PutMappingService {
	return &PutMappingService{
		client: client,
		index:  make([]string, 0),
	}
}
801706
func NewLeadershipSettingsAccessor(
	caller FacadeCallFn,
	newWatcher NewNotifyWatcherFn,
	checkAPIVersion CheckAPIVersionFn,
) *LeadershipSettingsAccessor {
	return &LeadershipSettingsAccessor{caller, newWatcher, checkAPIVersion}
}
781782
func (s *IndicesRolloverService) AddSetting(name string, value interface{}) *IndicesRolloverService {
	s.settings[name] = value
	return s
}