// UpgradeRequired writes a response with status code 426.
359189
func UpgradeRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusUpgradeRequired, response)
}
1315455
func (c *Context) Upgrade(protocols ...string) (err error) {

	wes := websocket.Upgrader{
		ReadBufferSize:    4096,
		WriteBufferSize:   4096,
		EnableCompression: true,
		Subprotocols:      protocols,
		HandshakeTimeout:  time.Second * 10,
		CheckOrigin: func(r *http.Request) bool {
			return true
		},
	}

	if websocket.IsWebSocketUpgrade(c.Request().Request) {

		var sck *websocket.Conn
		res := c.response
		req := c.request.Request
		pro := websocket.Subprotocols(c.Request().Request)

		if len(protocols) > 0 && !in(protocols, pro) {
			return NewHTTPError(415, "Unsupported Media Type")
		}

		if sck, err = wes.Upgrade(res, req, res.Header()); err != nil {
			return NewHTTPError(426, "Upgrade required")
		}

		c.socket = NewSocket(sck, c, c.Fibre())

		return nil

	}

	return NewHTTPError(426, "Upgrade required")

}
238260
func (a *api) UpgradeRegistry(endpoint string, override bool) error {
	client, err := a.connectMaster()
	if err != nil {
		return err
	}
	return client.UpgradeRegistry(endpoint, override)
}
372484
func (_m *DFS) UpgradeRegistry(svcs []service.ServiceDetails, tenantID string, registryHost string, override bool) error {
	ret := _m.Called(svcs, tenantID, registryHost, override)

	var r0 error
	if rf, ok := ret.Get(0).(func([]service.ServiceDetails, string, string, bool) error); ok {
		r0 = rf(svcs, tenantID, registryHost, override)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
918106
func (r Software_Description) GetRequiredUser() (resp string, err error) {
	err = r.Session.DoRequest("SoftLayer_Software_Description", "getRequiredUser", nil, &r.Options, &resp)
	return
}
502099
func upgradeOldAllocMutable(tx *boltdd.Tx, allocID string, oldBytes []byte) error {
	var oldMutable allocRunnerMutableState08
	err := codec.NewDecoderBytes(oldBytes, structs.MsgpackHandle).Decode(&oldMutable)
	if err != nil {
		return err
	}

	// Upgrade Deployment Status
	if err := putDeploymentStatusImpl(tx, allocID, oldMutable.DeploymentStatus); err != nil {
		return err
	}

	// Upgrade Task States
	for taskName, taskState := range oldMutable.TaskStates {
		if err := putTaskStateImpl(tx, allocID, taskName, taskState); err != nil {
			return err
		}
	}

	return nil
}
1278136
func (*OSesTable) needsUpdate(row, cfg *OS) bool {
	return row.Description != cfg.Description
}
442137
func (w *bulkWorker) commitRequired() bool {
	if w.bulkActions >= 0 && w.service.NumberOfActions() >= w.bulkActions {
		return true
	}
	if w.bulkSize >= 0 && w.service.EstimatedSizeInBytes() >= int64(w.bulkSize) {
		return true
	}
	return false
}
495581
func validateRequired(v interface{}, name string) error {
	if v == nil {
		return ErrRequired
	}
	return validateNonEmpty(v, name)
}
890659
func (s *Method) SetApiKeyRequired(v bool) *Method {
	s.ApiKeyRequired = &v
	return s
}
689176
func PaymentRequired(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusPaymentRequired, response)
}
388936
func UpgradeWait(wait bool) UpdateOption {
	return func(opts *options) {
		opts.updateReq.Wait = wait
	}
}
1085472
func (s *CreateJobInput) SetConfirmationRequired(v bool) *CreateJobInput {
	s.ConfirmationRequired = &v
	return s
}
619072
func (p *Loader) UpdateRequest(ctx context.Context, requestID stellar1.KeybaseRequestID) {
	if p.done {
		return
	}

	p.enqueueRequest(requestID)
}
1373446
func ValidateRequired(ch *Changeset, fields []string, opts ...Option) {
	options := Options{
		message: ValidateRequiredErrorMessage,
	}
	options.apply(opts)

	for _, f := range fields {
		val, exist := ch.changes[f]

		// check values if it's not exist in changeset when changeOnly is false and changeset values are all zero value
		if !exist && !options.changeOnly && !ch.zero {
			val, exist = ch.values[f]
		}

		str, isStr := val.(string)
		if exist && (isStr && strings.TrimSpace(str) != "") || (!isStr && val != nil) {
			continue
		}

		msg := strings.Replace(options.message, "{field}", f, 1)
		AddError(ch, f, msg)
	}
}
156789
func IsRefreshRequired(err error) bool {

	res, ok := err.(*gomemcached.MCResponse)
	if ok && (res.Status == gomemcached.NO_BUCKET || res.Status == gomemcached.NOT_MY_VBUCKET) {
		return true
	}

	return false
}
1122590
func (o *ObjectConstraint) IsPropRequired(s string) bool {
	o.reqlock.Lock()
	defer o.reqlock.Unlock()

	_, ok := o.required[s]
	return ok
}