// AcquireWithContext attempts to acquire a lock with a context.
// Returns nil if the lock was acquired.
// Returns an error if it was not. The error is from ctx.Err().
970175
func AcquireWithContext(ctx context.Context, lock sync.Locker) (err error) {
	if err = ctx.Err(); err != nil {
		return err
	}
	acquiredCh := make(chan struct{})
	shouldReleaseCh := make(chan bool, 1)
	go func() {
		lock.Lock()
		close(acquiredCh)
		shouldRelease := <-shouldReleaseCh
		if shouldRelease {
			lock.Unlock()
		}
	}()
	select {
	case <-acquiredCh:
		err = nil
	case <-ctx.Done():
		err = ctx.Err()
	}
	shouldReleaseCh <- err != nil
	return err
}
1156748
func (call *IssueLinkTokenCall) WithContext(ctx context.Context) *IssueLinkTokenCall {
	call.ctx = ctx
	return call
}
179902
func (o *OrderGetParams) WithContext(ctx context.Context) *OrderGetParams {
	o.SetContext(ctx)
	return o
}
249613
func (call *MulticastCall) WithContext(ctx context.Context) *MulticastCall {
	call.ctx = ctx
	return call
}
887701
func (q *Query) WithContext(ctx context.Context) *Query {
	q2 := *q
	q2.context = ctx
	return &q2
}
278569
func (o *GetLoginRequestParams) WithContext(ctx context.Context) *GetLoginRequestParams {
	o.SetContext(ctx)
	return o
}
709835
func (call *GetMessageContentCall) WithContext(ctx context.Context) *GetMessageContentCall {
	call.ctx = ctx
	return call
}
690937
func (o *GetConsentRequestParams) WithContext(ctx context.Context) *GetConsentRequestParams {
	o.SetContext(ctx)
	return o
}
897358
func (o *GetStatusParams) WithContext(ctx context.Context) *GetStatusParams {
	o.SetContext(ctx)
	return o
}
825804
func AcquireWithTimeout(lock sync.Locker, timeout time.Duration) (err error) {
	ctx2, cancel := context.WithTimeout(context.Background(), timeout)
	defer cancel()
	return AcquireWithContext(ctx2, lock)
}
289008
func DialWithContext(ctx context.Context) DialOption {
	return DialOption{func(do *dialOptions) {
		do.context = ctx
	}}
}
1033961
func (o *GetMetricsParams) WithContext(ctx context.Context) *GetMetricsParams {
	o.SetContext(ctx)
	return o
}
1060559
func (o *GetJSONWebKeyParams) WithContext(ctx context.Context) *GetJSONWebKeyParams {
	o.SetContext(ctx)
	return o
}
891110
func WithContext(ctx context.Context, fnctx Context) context.Context {
	return context.WithValue(ctx, ctxKey, fnctx)
}
37685
func (call *GetGroupMemberProfileCall) WithContext(ctx context.Context) *GetGroupMemberProfileCall {
	call.ctx = ctx
	return call
}
1197534
func (call *GetMessageQuotaCall) WithContext(ctx context.Context) *GetMessageQuotaCall {
	call.ctx = ctx
	return call
}
1343689
func (o *UpdateOneParams) WithContext(ctx context.Context) *UpdateOneParams {
	o.SetContext(ctx)
	return o
}