// ManagementWithURLs provides API endpoint URL.
551989
func ManagementWithURLs(apiDeleteBackupURL, deleteOldBackupURL, deleteUnitOfBackupURL string) ManagementOption {
	return &managementURLOption{
		APIDeleteBackupsURL:   apiDeleteBackupURL,
		DeleteOldBackupURL:    deleteOldBackupURL,
		DeleteUnitOfBackupURL: deleteUnitOfBackupURL,
	}
}
1333544
func WithServerMiddleware(middlewares ...Middleware) ServerOption {
	return func(opts *serverOptions) {
		opts.middlewares = append(opts.middlewares, middlewares...)
	}
}
367505
func RunWithManager(r http.Handler, m *autocert.Manager) error {
	s := &http.Server{
		Addr:      ":https",
		TLSConfig: m.TLSConfig(),
		Handler:   r,
	}

	go http.ListenAndServe(":http", m.HTTPHandler(nil))

	return s.ListenAndServeTLS("", "")
}
1206172
func WithResources(ctx context.Context, resources []Resource) context.Context {
	return resourceContext{
		Context:   ctx,
		resources: resources,
	}
}
1106760
func (s *Solr) mbeansURL(server string, core string) string {
	return fmt.Sprintf("%s/solr/%s%s", server, core, mbeansPath)
}
1125814
func URLWithPathParams(base string, path string, params map[string]interface{}) (u *url.URL) {

	u, err := url.Parse(base)
	if err != nil {
		log.Fatal(err)
	}

	if len(path) > 0 {
		u, err = u.Parse(path)
		if err != nil {
			log.Fatal(err)
		}
	}

	q := u.Query()

	for k, v := range params {
		val := reflect.ValueOf(v)

		switch val.Kind() {
		case reflect.Slice:
			if val.IsNil() { // TODO: add an option to ignore empty values
				q.Set(k, "")
				continue
			}
			fallthrough

		case reflect.Array:
			for i := 0; i < val.Len(); i++ {
				av := val.Index(i)

				if canStringify(av) {
					q.Add(k, fmt.Sprintf("%v", av))
				}
			}

		default:
			if canStringify(val) {
				q.Set(k, fmt.Sprintf("%v", v))
			} else {
				log.Fatal("Invalid type ", val)
			}
		}
	}

	u.RawQuery = q.Encode()
	return u
}
1129190
func WithIdentityManagerProvider(provider msp.IdentityManagerProvider) SDKContextParams {
	return func(ctx *Provider) {
		ctx.idMgmtProvider = provider
	}
}
153811
func (src List) URLs() map[version.Binary][]string {
	result := map[version.Binary][]string{}
	for _, tools := range src {
		result[tools.Version] = append(result[tools.Version], tools.URL)
	}
	return result
}
677740
func (r Account) GetRemoteManagementCommandRequests() (resp []datatypes.Hardware_Component_RemoteManagement_Command_Request, err error) {
	err = r.Session.DoRequest("SoftLayer_Account", "getRemoteManagementCommandRequests", nil, &r.Options, &resp)
	return
}
1340636
func (e Endpoint) urlWithoutPath() string {
	return fmt.Sprintf("%s://%s", e.scheme(), e.SocketAddress())
}
5820
func WithServer(server *http.Server) RouterOption {
	return func(router *Router) {
		router.server = server
	}
}
1370064
func WithServerOpts(opts []grpc.ServerOption) Option {
	return func(o *options) {
		o.serverOpts = opts
	}
}
791332
func GetWithIdentityURL(url string) (*EC2Metadata, error) {
	metadata, err := requestAWSInfo(url)
	if err != nil {
		return metadata, errors.New("not an aws box")
	}

	if id, err := metadata.GetAWSUniqueID(); err == nil {
		metadata.AWSUniqueID = id
	}
	return metadata, nil
}
1037999
func (vis *VarVisitor) WithParams(params VarVisitorParams) *VarVisitor {
	vis.params = params
	return vis
}
48922
func (f *Force) fullRestUrl(url string) string {
	return fmt.Sprintf("/services/data/%s/%s", apiVersion, strings.TrimLeft(url, "/"))
}
504029
func HTTPManager(server, token string, store TokenStore) Manager {
	return &httpManager{
		server: server,
		token:  token,
		store:  store,
	}
}
500807
func (twilio *Twilio) CallWithUrlCallbacks(from, to string, callbackParameters *CallbackParameters) (*VoiceResponse, *Exception, error) {
	formValues := url.Values{}
	formValues.Set("From", from)
	formValues.Set("To", to)
	formValues.Set("Url", callbackParameters.Url)

	// Optional values
	if callbackParameters.Method != "" {
		formValues.Set("Method", callbackParameters.Method)
	}
	if callbackParameters.FallbackUrl != "" {
		formValues.Set("FallbackUrl", callbackParameters.FallbackUrl)
	}
	if callbackParameters.FallbackMethod != "" {
		formValues.Set("FallbackMethod", callbackParameters.FallbackMethod)
	}
	if callbackParameters.StatusCallback != "" {
		formValues.Set("StatusCallback", callbackParameters.StatusCallback)
	}
	if callbackParameters.StatusCallbackMethod != "" {
		formValues.Set("StatusCallbackMethod", callbackParameters.StatusCallbackMethod)
	}
	for _, event := range callbackParameters.StatusCallbackEvent {
		formValues.Add("StatusCallbackEvent", event)
	}
	if callbackParameters.SendDigits != "" {
		formValues.Set("SendDigits", callbackParameters.SendDigits)
	}
	if callbackParameters.IfMachine != "" {
		formValues.Set("IfMachine", callbackParameters.IfMachine)
	}
	if callbackParameters.Timeout != 0 {
		formValues.Set("Timeout", strconv.Itoa(callbackParameters.Timeout))
	}
	if callbackParameters.MachineDetection != "" {
		formValues.Set("MachineDetection", callbackParameters.MachineDetection)
	}
	if callbackParameters.MachineDetectionTimeout != 0 {
		formValues.Set(
			"MachineDetectionTimeout",
			strconv.Itoa(callbackParameters.MachineDetectionTimeout),
		)
	}

	if callbackParameters.Record {
		formValues.Set("Record", "true")

		if callbackParameters.RecordingChannels != "" {
			formValues.Set("RecordingChannels", callbackParameters.RecordingChannels)
		}
		if callbackParameters.RecordingStatusCallback != "" {
			formValues.Set("RecordingStatusCallback", callbackParameters.RecordingStatusCallback)
		}
		if callbackParameters.RecordingStatusCallbackMethod != "" {
			formValues.Set("RecordingStatusCallbackMethod", callbackParameters.RecordingStatusCallbackMethod)
		}
	} else {
		formValues.Set("Record", "false")
	}

	return twilio.voicePost(formValues)
}