Unverified Commit 79dad8e7 authored by Sander van Harmelen's avatar Sander van Harmelen Committed by GitHub

Remove the OrderByValue type (#429)

parent 6ada4440
......@@ -68,7 +68,7 @@ type Deployment struct {
// https://docs.gitlab.com/ce/api/deployments.html#list-project-deployments
type ListProjectDeploymentsOptions struct {
ListOptions
OrderBy *OrderByValue `url:"order_by,omitempty" json:"order_by,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
}
......
......@@ -17,7 +17,7 @@ func pipelineExample() {
YamlErrors: gitlab.Bool(true),
Name: gitlab.String("name"),
Username: gitlab.String("username"),
OrderBy: gitlab.OrderBy(gitlab.OrderByStatus),
OrderBy: gitlab.String("status"),
Sort: gitlab.String("asc"),
}
......
......@@ -186,19 +186,6 @@ var notificationLevelTypes = map[string]NotificationLevelValue{
"custom": CustomNotificationLevel,
}
// OrderByValue represent in which order to sort the item
type OrderByValue string
// These constants represent all valid order by values.
const (
OrderByCreatedAt OrderByValue = "created_at"
OrderByID OrderByValue = "id"
OrderByIID OrderByValue = "iid"
OrderByRef OrderByValue = "ref"
OrderByStatus OrderByValue = "status"
OrderByUserID OrderByValue = "user_id"
)
// VisibilityValue represents a visibility level within GitLab.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/
......@@ -832,14 +819,6 @@ func NotificationLevel(v NotificationLevelValue) *NotificationLevelValue {
return p
}
// OrderBy is a helper routine that allocates a new OrderByValue
// to store v and returns a pointer to it.
func OrderBy(v OrderByValue) *OrderByValue {
p := new(OrderByValue)
*p = v
return p
}
// Visibility is a helper routine that allocates a new VisibilityValue
// to store v and returns a pointer to it.
func Visibility(v VisibilityValue) *VisibilityValue {
......
......@@ -87,7 +87,7 @@ type ListProjectPipelinesOptions struct {
YamlErrors *bool `url:"yaml_errors,omitempty" json:"yaml_errors,omitempty"`
Name *string `url:"name,omitempty" json:"name,omitempty"`
Username *string `url:"username,omitempty" json:"username,omitempty"`
OrderBy *OrderByValue `url:"order_by,omitempty" json:"order_by,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment