// applyContextSettings fills fields in the queryRequest from the given context.
762112
func (q *queryRequest) applyContextSettings(ctx context.Context) {
	if ctx == nil {
		return
	}
	if rawValue := ctx.Value(keyQueryCount); rawValue != nil {
		if value, ok := rawValue.(bool); ok {
			q.Count = value
		}
	}
	if rawValue := ctx.Value(keyQueryBatchSize); rawValue != nil {
		if value, ok := rawValue.(int); ok {
			q.BatchSize = value
		}
	}
	if rawValue := ctx.Value(keyQueryCache); rawValue != nil {
		if value, ok := rawValue.(bool); ok {
			q.Cache = value
		}
	}
	if rawValue := ctx.Value(keyQueryMemoryLimit); rawValue != nil {
		if value, ok := rawValue.(int64); ok {
			q.MemoryLimit = value
		}
	}
	if rawValue := ctx.Value(keyQueryTTL); rawValue != nil {
		if value, ok := rawValue.(time.Duration); ok {
			q.TTL = value.Seconds()
		}
	}
	if rawValue := ctx.Value(keyQueryOptSatSyncWait); rawValue != nil {
		if value, ok := rawValue.(time.Duration); ok {
			q.Options.SatelliteSyncWait = value.Seconds()
		}
	}
	if rawValue := ctx.Value(keyQueryOptFullCount); rawValue != nil {
		if value, ok := rawValue.(bool); ok {
			q.Options.FullCount = value
		}
	}
	if rawValue := ctx.Value(keyQueryOptStream); rawValue != nil {
		if value, ok := rawValue.(bool); ok {
			q.Options.Stream = value
		}
	}
}
676194
func (r *FastHttpResponse) SetContext(w *fasthttp.RequestCtx) {
	r.Original = w
	r.Writer = w.Response.BodyWriter()
}
947501
func (o *CreateParams) WithContext(ctx context.Context) *CreateParams {
	o.SetContext(ctx)
	return o
}
664879
func (from *Tree) PatchContext(ctx context.Context, to *Tree) (*Patch, error) {
	changes, err := DiffTreeContext(ctx, from, to)
	if err != nil {
		return nil, err
	}

	return changes.PatchContext(ctx)
}
160785
func (s *ContextEntry) SetContextKeyType(v string) *ContextEntry {
	s.ContextKeyType = &v
	return s
}
346006
func (o *UpdateTaskParams) WithContext(ctx context.Context) *UpdateTaskParams {
	o.SetContext(ctx)
	return o
}
845702
func (a *Application) ModifyContext(ctx context.Context) context.Context {
	if a.Context != nil {
		return a.Context(ctx)
	}
	return ctx
}
532881
func (c *ConfigDataNode) ApplyDefaults(defaults map[string]ctypes.ConfigValue) {
	// Lock here since we are modifying c.table
	c.mutex.Lock()
	defer c.mutex.Unlock()
	for name, def := range defaults {
		if _, ok := c.table[name]; !ok {
			c.table[name] = def
		}
	}
}
106365
func AddParamsToContext(ctx context.Context, params map[string]string) context.Context {
	return context.WithValue(ctx, paramsContextKey, params)
}
574807
func ContextQueryParams(c *APIContext) map[string][]string {
	qp, ok := c.Get("QueryParams")
	if ok == false {
		qp = make(map[string][]string)
		c.Set("QueryParams", qp)
	}
	return qp.(map[string][]string)
}
989095
func (o *CreateJSONWebKeySetParams) WithContext(ctx context.Context) *CreateJSONWebKeySetParams {
	o.SetContext(ctx)
	return o
}
205926
func (s *EndpointSendConfiguration) SetContext(v map[string]*string) *EndpointSendConfiguration {
	s.Context = v
	return s
}
736307
func (qo *queryOptions) applyQueryOptions(options ...QueryOption) {
	for _, option := range options {
		option(qo)
	}
}
579487
func (o *RejectConsentRequestParams) WithContext(ctx context.Context) *RejectConsentRequestParams {
	o.SetContext(ctx)
	return o
}
408600
func ContextParams(ctx context.Context) map[string]string {
	if p, ok := ctx.Value(paramsContextKey).(map[string]string); ok {
		return p
	}
	return map[string]string{}
}
71158
func SetContext(ctx context.Context, e Entry) context.Context {
	return context.WithValue(ctx, ctxIdent, e)
}
977158
func (s *ResourceSpecificResult) SetMissingContextValues(v []*string) *ResourceSpecificResult {
	s.MissingContextValues = v
	return s
}