// ZoneSSLSettings returns information about SSL setting to the specified zone.
//
// API reference: https://api.cloudflare.com/#zone-settings-get-ssl-setting
192709
func (api *API) ZoneSSLSettings(zoneID string) (ZoneSSLSetting, error) {
	uri := "/zones/" + zoneID + "/settings/ssl"
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return ZoneSSLSetting{}, errors.Wrap(err, errMakeRequestError)
	}
	var r ZoneSSLSettingResponse
	err = json.Unmarshal(res, &r)
	if err != nil {
		return ZoneSSLSetting{}, errors.Wrap(err, errUnmarshalError)
	}
	return r.Result, nil
}
175749
func ZonesSetToLabelValue(strSet sets.String) string {
	return strings.Join(strSet.UnsortedList(), cloudvolume.LabelMultiZoneDelimiter)
}
1076471
func (s *UpdateStageInput) SetRouteSettings(v map[string]*RouteSettings) *UpdateStageInput {
	s.RouteSettings = v
	return s
}
411159
func (s *CreateStageInput) SetRouteSettings(v map[string]*RouteSettings) *CreateStageInput {
	s.RouteSettings = v
	return s
}
1051119
func (api *API) UniversalSSLSettingDetails(zoneID string) (UniversalSSLSetting, error) {
	uri := "/zones/" + zoneID + "/ssl/universal/settings"
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return UniversalSSLSetting{}, errors.Wrap(err, errMakeRequestError)
	}
	var r universalSSLSettingResponse
	if err := json.Unmarshal(res, &r); err != nil {
		return UniversalSSLSetting{}, errors.Wrap(err, errUnmarshalError)
	}
	return r.Result, nil
}
1051803
func (api *subnetsAPI) AllZones() (params.ZoneResults, error) {
	if err := api.checkCanRead(); err != nil {
		return params.ZoneResults{}, err
	}
	return networkingcommon.AllZones(api.context, api.backing)
}
152614
func (s *Stage) SetRouteSettings(v map[string]*RouteSettings) *Stage {
	s.RouteSettings = v
	return s
}
52868
func (s *ZonesService) ListZones(accountID string, options *ZoneListOptions) (*zonesResponse, error) {
	path := versioned(fmt.Sprintf("/%v/zones", accountID))
	zonesResponse := &zonesResponse{}

	path, err := addURLQueryOptions(path, options)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.get(path, zonesResponse)
	if err != nil {
		return zonesResponse, err
	}

	zonesResponse.HttpResponse = resp
	return zonesResponse, nil
}
125746
func (u *Unit) ConfigSettings() (charm.Settings, error) {
	var results params.ConfigSettingsResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: u.tag.String()}},
	}
	err := u.st.facade.FacadeCall("ConfigSettings", args, &results)
	if err != nil {
		return nil, err
	}
	if len(results.Results) != 1 {
		return nil, errors.Errorf("expected 1 result, got %d", len(results.Results))
	}
	result := results.Results[0]
	if result.Error != nil {
		return nil, result.Error
	}
	return charm.Settings(result.Settings), nil
}
1279354
func (s *UpdateAppInput) SetSslConfiguration(v *SslConfiguration) *UpdateAppInput {
	s.SslConfiguration = v
	return s
}
336694
func (api *API) ListZones(z ...string) ([]Zone, error) {
	v := url.Values{}
	var res []byte
	var r ZonesResponse
	var zones []Zone
	var err error
	if len(z) > 0 {
		for _, zone := range z {
			v.Set("name", zone)
			res, err = api.makeRequest("GET", "/zones?"+v.Encode(), nil)
			if err != nil {
				return []Zone{}, errors.Wrap(err, errMakeRequestError)
			}
			err = json.Unmarshal(res, &r)
			if err != nil {
				return []Zone{}, errors.Wrap(err, errUnmarshalError)
			}
			if !r.Success {
				// TODO: Provide an actual error message instead of always returning nil
				return []Zone{}, err
			}
			for zi := range r.Result {
				zones = append(zones, r.Result[zi])
			}
		}
	} else {
		res, err = api.makeRequest("GET", "/zones?per_page=50", nil)
		if err != nil {
			return []Zone{}, errors.Wrap(err, errMakeRequestError)
		}
		err = json.Unmarshal(res, &r)
		if err != nil {
			return []Zone{}, errors.Wrap(err, errUnmarshalError)
		}

		totalPageCount := r.TotalPages
		var wg sync.WaitGroup
		wg.Add(totalPageCount)
		errc := make(chan error)

		for i := 1; i <= totalPageCount; i++ {
			go func(pageNumber int) error {
				res, err = api.makeRequest("GET", fmt.Sprintf("/zones?per_page=50&page=%d", pageNumber), nil)
				if err != nil {
					errc <- err
				}

				err = json.Unmarshal(res, &r)
				if err != nil {
					errc <- err
				}

				for _, zone := range r.Result {
					zones = append(zones, zone)
				}

				select {
				case err := <-errc:
					return err
				default:
					wg.Done()
				}

				return nil
			}(i)
		}

		wg.Wait()
	}

	return zones, nil
}
1330858
func (s *UpdateRadiusInput) SetRadiusSettings(v *RadiusSettings) *UpdateRadiusInput {
	s.RadiusSettings = v
	return s
}
1033407
func (s *OptionConfiguration) SetOptionSettings(v []*OptionSetting) *OptionConfiguration {
	s.OptionSettings = v
	return s
}
994791
func (s *CreateEndpointInput) SetElasticsearchSettings(v *ElasticsearchSettings) *CreateEndpointInput {
	s.ElasticsearchSettings = v
	return s
}
811945
func (s *IndicesGetTemplateService) FlatSettings(flatSettings bool) *IndicesGetTemplateService {
	s.flatSettings = &flatSettings
	return s
}
187189
func (s *HlsGroupSettings) SetKeyProviderSettings(v *KeyProviderSettings) *HlsGroupSettings {
	s.KeyProviderSettings = v
	return s
}
492574
func (vs *VSphere) Zones() (cloudprovider.Zones, bool) {
	if vs.isZoneEnabled() {
		return vs, true
	}
	klog.V(1).Info("The vSphere cloud provider does not support zones")
	return nil, false
}