示例#1
0
func createWorkItemLink() {
	a.Description("Create a work item link")
	a.Security("jwt")
	a.Routing(
		a.POST(""),
	)
	a.Payload(createWorkItemLinkPayload)
	a.Response(d.Created, "/workitemlinks/.*", func() {
		a.Media(workItemLink)
	})
	a.Response(d.BadRequest, JSONAPIErrors)
	a.Response(d.InternalServerError, JSONAPIErrors)
	a.Response(d.Unauthorized, JSONAPIErrors)
}
示例#2
0
func deleteWorkItemLink() {
	a.Description("Delete work item link with given id.")
	a.Security("jwt")
	a.Routing(
		a.DELETE("/:linkId"),
	)
	a.Params(func() {
		a.Param("linkId", d.String, "ID of the work item link to be deleted")
	})
	a.Response(d.OK)
	a.Response(d.BadRequest, JSONAPIErrors)
	a.Response(d.InternalServerError, JSONAPIErrors)
	a.Response(d.NotFound, JSONAPIErrors)
	a.Response(d.Unauthorized, JSONAPIErrors)
}
示例#3
0
func updateWorkItemLink() {
	a.Description("Update the given work item link with given id.")
	a.Security("jwt")
	a.Routing(
		a.PATCH("/:linkId"),
	)
	a.Params(func() {
		a.Param("linkId", d.String, "ID of the work item link to be updated")
	})
	a.Payload(updateWorkItemLinkPayload)
	a.Response(d.OK, func() {
		a.Media(workItemLink)
	})
	a.Response(d.BadRequest, JSONAPIErrors)
	a.Response(d.InternalServerError, JSONAPIErrors)
	a.Response(d.NotFound, JSONAPIErrors)
	a.Response(d.Unauthorized, JSONAPIErrors)
}
	})

	a.Action("list", func() {
		a.Routing(
			a.GET(""),
		)
		a.Description("List work item link categories.")
		a.Response(d.OK, func() {
			a.Media(workItemLinkCategoryList)
		})
		a.Response(d.BadRequest, JSONAPIErrors)
		a.Response(d.InternalServerError, JSONAPIErrors)
	})

	a.Action("create", func() {
		a.Security("jwt")
		a.Routing(
			a.POST(""),
		)
		a.Description("Create a work item link category")
		a.Payload(createWorkItemLinkCategoryPayload)
		a.Response(d.Created, "/workitemlinkcategories/.*", func() {
			a.Media(workItemLinkCategory)
		})
		a.Response(d.BadRequest, JSONAPIErrors)
		a.Response(d.InternalServerError, JSONAPIErrors)
		a.Response(d.Unauthorized, JSONAPIErrors)
	})

	a.Action("delete", func() {
		a.Security("jwt")