/*
OrderCreate places an order for a pet
*/
972360
func (a *Client) OrderCreate(ctx context.Context, params *OrderCreateParams) (*OrderCreateOK, error) {

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "OrderCreate",
		Method:             "POST",
		PathPattern:        "/store/order",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &OrderCreateReader{formats: a.formats},
		AuthInfo:           a.authInfo,
		Context:            ctx,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*OrderCreateOK), nil

}
1257380
func (a *Client) PetUpdate(ctx context.Context, params *PetUpdateParams) (*PetUpdateCreated, error) {

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "PetUpdate",
		Method:             "PUT",
		PathPattern:        "/pet",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &PetUpdateReader{formats: a.formats},
		AuthInfo:           a.authInfo,
		Context:            ctx,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*PetUpdateCreated), nil

}
583966
func (rb *route) PushOrderBy(order *sqlparser.Order) error {
	// By this time, if any single shard options were already present,
	// multi-sharded options would have already been removed. So, this
	// call is only for checking if the route has single shard options.
	if rb.removeMultishardOptions() {
		rb.Select.AddOrder(order)
		return nil
	}

	// If it's a scatter, we have to populate the OrderBy field.
	colnum := -1
	switch expr := order.Expr.(type) {
	case *sqlparser.SQLVal:
		var err error
		if colnum, err = ResultFromNumber(rb.resultColumns, expr); err != nil {
			return fmt.Errorf("invalid order by: %v", err)
		}
	case *sqlparser.ColName:
		c := expr.Metadata.(*column)
		for i, rc := range rb.resultColumns {
			if rc.column == c {
				colnum = i
				break
			}
		}
	default:
		return fmt.Errorf("unsupported: in scatter query: complex order by expression: %s", sqlparser.String(expr))
	}
	// If column is not found, then the order by is referencing
	// a column that's not on the select list.
	if colnum == -1 {
		return fmt.Errorf("unsupported: in scatter query: order by must reference a column in the select list: %s", sqlparser.String(order))
	}
	ob := engine.OrderbyParams{
		Col:  colnum,
		Desc: order.Direction == sqlparser.DescScr,
	}
	for _, ro := range rb.routeOptions {
		ro.eroute.OrderBy = append(ro.eroute.OrderBy, ob)
	}

	rb.Select.AddOrder(order)
	return nil
}
9161
func (a *DataTable) GenOrderBy(args ...func(string, string) string) string {
	return a.orders.Sql(args...)
}
798665
func (session *Session) OrderBy(order string) *Session {
	session.statement.OrderBy(order)
	return session
}
1057687
func NewOrder(ctx *plan.Context, p *plan.Order) *Order {
	o := &Order{
		TaskBase: NewTaskBase(ctx),
		p:        p,
		complete: make(chan bool),
	}
	return o
}
240083
func (a *CompositeAggregationDateHistogramValuesSource) Order(order string) *CompositeAggregationDateHistogramValuesSource {
	a.order = order
	return a
}
299000
func (s *ServerRPC) PodCreate(ctx context.Context, req *types.PodCreateRequest) (*types.PodCreateResponse, error) {
	p, err := s.daemon.CreatePod(req.PodID, req.PodSpec)
	if err != nil {
		return nil, err
	}

	return &types.PodCreateResponse{
		PodID: p.Id(),
	}, nil
}
41987
func (m *MockImageAPIClient) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) {
	ret := m.ctrl.Call(m, "ImageCreate", ctx, parentReference, options)
	ret0, _ := ret[0].(io.ReadCloser)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
675149
func (s *OrganizationConfigStore) FindOrCreate(ctx context.Context, orgID string) (*chronograf.OrganizationConfig, error) {
	var c chronograf.OrganizationConfig
	err := s.client.db.Update(func(tx *bolt.Tx) error {
		err := s.get(ctx, tx, orgID, &c)
		if err == chronograf.ErrOrganizationConfigNotFound {
			c = newOrganizationConfig(orgID)
			return s.put(ctx, tx, &c)
		}
		return err
	})

	if err != nil {
		return nil, err
	}
	return &c, nil
}
417319
func (a *DateHistogramAggregation) Order(order string, asc bool) *DateHistogramAggregation {
	a.order = order
	a.orderAsc = asc
	return a
}
253914
func (s *FieldSort) Order(ascending bool) *FieldSort {
	s.ascending = ascending
	return s
}
802806
func NewOrder(stmt *rel.SqlSelect) *Order {
	return &Order{Stmt: stmt, PlanBase: NewPlanBase(false)}
}
774338
func (node *Select) AddOrder(order *Order) {
	node.OrderBy = append(node.OrderBy, order)
}
1186588
func (m *MockServiceAPIClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) {
	ret := m.ctrl.Call(m, "ServiceCreate", ctx, service, options)
	ret0, _ := ret[0].(types.ServiceCreateResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
880743
func (b *UpdateBuilder) OrderBy(exprs ...interface{}) *UpdateBuilder {
	b.Update.OrderBy = makeOrderBy(exprs...)
	return b
}
101631
func (s GeoDistanceSort) Order(ascending bool) GeoDistanceSort {
	s.ascending = ascending
	return s
}