reports

package
v0.17.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath       = "/v1/reports"
	BasePathWithID = BasePath + "/:" + apiutil.IDKey
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

func New

func New(processor *processing.Processor) *Module

func (*Module) ReportGETHandler

func (m *Module) ReportGETHandler(c *gin.Context)

ReportGETHandler swagger:operation GET /api/v1/reports/{id} reportGet

Get one report with the given id.

---
tags:
- reports

produces:
- application/json

parameters:
-
	name: id
	type: string
	description: ID of the report
	in: path
	required: true

security:
- OAuth2 Bearer:
	- read:reports

responses:
	'200':
		description: The requested report.
		schema:
			"$ref": "#/definitions/report"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ReportPOSTHandler

func (m *Module) ReportPOSTHandler(c *gin.Context)

ReportPOSTHandler swagger:operation POST /api/v1/reports reportCreate

Create a new user report with the given parameters.

---
tags:
- reports

consumes:
- application/json
- application/xml
- application/x-www-form-urlencoded

produces:
- application/json

security:
- OAuth2 Bearer:
	- write:reports

responses:
	'200':
		description: The created report.
		schema:
			"$ref": "#/definitions/report"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) ReportsGETHandler

func (m *Module) ReportsGETHandler(c *gin.Context)

ReportsGETHandler swagger:operation GET /api/v1/reports reports

See reports created by the requesting account.

The reports will be returned in descending chronological order (newest first), with sequential IDs (bigger = newer).

The next and previous queries can be parsed from the returned Link header.

Example:

``` <https://example.org/api/v1/reports?limit=20&max_id=01FC0SKA48HNSVR6YKZCQGS2V8>; rel="next", <https://example.org/api/v1/reports?limit=20&min_id=01FC0SKW5JK2Q4EVAV2B462YY0>; rel="prev" ````

---
tags:
- reports

produces:
- application/json

parameters:
-
	name: resolved
	type: boolean
	description: >-
		If set to true, only resolved reports will be returned.
		If false, only unresolved reports will be returned.
		If unset, reports will not be filtered on their resolved status.
	in: query
-
	name: target_account_id
	type: string
	description: Return only reports that target the given account id.
	in: query
-
	name: max_id
	type: string
	description: >-
		Return only reports *OLDER* than the given max ID (for paging downwards).
		The report with the specified ID will not be included in the response.
	in: query
-
	name: since_id
	type: string
	description: >-
		Return only reports *NEWER* than the given since ID.
		The report with the specified ID will not be included in the response.
	in: query
-
	name: min_id
	type: string
	description: >-
		Return only reports immediately *NEWER* than the given min ID (for paging upwards).
		The report with the specified ID will not be included in the response.
	in: query
-
	name: limit
	type: integer
	description: Number of reports to return.
	default: 20
	minimum: 1
	maximum: 100
	in: query

security:
- OAuth2 Bearer:
	- read:reports

responses:
	'200':
		name: reports
		description: Array of reports.
		schema:
			type: array
			items:
				"$ref": "#/definitions/report"
		headers:
			Link:
				type: string
				description: Links to the next and previous queries.
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) Route

func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL