// RequestWithContext preforms a command with a context
491303
func (client *Client) RequestWithContext(ctx context.Context, command Command) (interface{}, error) {
	switch c := command.(type) {
	case AsyncCommand:
		return client.asyncRequest(ctx, c)
	default:
		return client.SyncRequestWithContext(ctx, command)
	}
}
179902
func (o *OrderGetParams) WithContext(ctx context.Context) *OrderGetParams {
	o.SetContext(ctx)
	return o
}
1263069
func CommandContext(ctx context.Context, prog string, args ...string) *Cmd {
	return &Cmd{
		Cmd: exec.CommandContext(ctx, prog, args...),
		ctx: ctx,
	}
}
708859
func (r *RoutesService) GetWithContext(ctx context.Context, id string) (*Route, *http.Response, error) {
	resource, _ := url.Parse(routesResourcePath)
	resource.Path = path.Join(resource.Path, id)

	req, err := r.client.NewRequest(ctx, http.MethodGet, resource, nil)

	if err != nil {
		return nil, nil, err
	}

	route := new(Route)

	res, err := r.client.Do(req, route)

	if err != nil {
		return nil, res, err
	}

	return route, res, nil
}
834743
func (o *CreateTaskParams) WithContext(ctx context.Context) *CreateTaskParams {
	o.SetContext(ctx)
	return o
}
601077
func (r *Request) WithContext(ctx context.Context) *Request {
	if ctx == nil {
		panic("nil context")
	}
	r2 := r.copy()
	r2.ctx = ctx
	r2.cancelCtx = nil
	return r2
}
712035
func (o *RevokeConsentSessionsParams) WithContext(ctx context.Context) *RevokeConsentSessionsParams {
	o.SetContext(ctx)
	return o
}
279621
func (q *Query) WithContext(ctx context.Context) *Query {
	q.ctx = ctx
	return q
}
354984
func (client *Client) BooleanRequestWithContext(ctx context.Context, command Command) error {
	resp, err := client.RequestWithContext(ctx, command)
	if err != nil {
		return err
	}

	if b, ok := resp.(*BooleanResponse); ok {
		return b.Error()
	}

	panic(fmt.Errorf("command %q is not a proper boolean response. %#v", client.APIName(command), resp))
}
1177945
func (o *UpdateJSONWebKeyParams) WithContext(ctx context.Context) *UpdateJSONWebKeyParams {
	o.SetContext(ctx)
	return o
}
1069975
func (o *UpdateOAuth2ClientParams) WithContext(ctx context.Context) *UpdateOAuth2ClientParams {
	o.SetContext(ctx)
	return o
}
589304
func RequestFromContext(ctx context.Context) *Request {
	v := ctx.Value(activeContextKey)
	if v == nil {
		return nil
	}
	return v.(*Request)
}
897358
func (o *GetStatusParams) WithContext(ctx context.Context) *GetStatusParams {
	o.SetContext(ctx)
	return o
}
259699
func (o *PetGetParams) WithContext(ctx context.Context) *PetGetParams {
	o.SetContext(ctx)
	return o
}
392349
func (o *AcceptLoginRequestParams) WithContext(ctx context.Context) *AcceptLoginRequestParams {
	o.SetContext(ctx)
	return o
}
375428
func (o *RevokeOAuth2TokenParams) WithContext(ctx context.Context) *RevokeOAuth2TokenParams {
	o.SetContext(ctx)
	return o
}
917867
func (s *ServicesService) GetWithContext(ctx context.Context, idOrName string) (*Service, *http.Response, error) {
	resource, _ := url.Parse(servicesResourcePath)
	resource.Path = path.Join(resource.Path, idOrName)

	req, err := s.client.NewRequest(ctx, http.MethodGet, resource, nil)

	if err != nil {
		return nil, nil, err
	}

	svc := new(Service)

	res, err := s.client.Do(req, svc)

	if err != nil {
		return nil, res, err
	}

	return svc, res, nil
}