interactionpolicies

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath     = "/v1/interaction_policies"
	DefaultsPath = BasePath + "/defaults"
)

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) PoliciesDefaultsGETHandler

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

PoliciesDefaultsGETHandler swagger:operation GET /api/v1/interaction_policies/defaults policiesDefaultsGet

Get default interaction policies for new statuses created by you.

---
tags:
- interaction_policies

produces:
- application/json

security:
- OAuth2 Bearer:
	- read:accounts

responses:
	'200':
		description: A default policies object containing a policy for each status visibility.
		schema:
			"$ref": "#/definitions/defaultPolicies"
	'401':
		description: unauthorized
	'406':
		description: not acceptable
	'500':
		description: internal server error

func (*Module) PoliciesDefaultsPATCHHandler

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

PoliciesDefaultsPATCHHandler swagger:operation PATCH /api/v1/interaction_policies/defaults policiesDefaultsUpdate

Update default interaction policies per visibility level for new statuses created by you.

If submitting using form data, use the following pattern:

`VISIBILITY[INTERACTION_TYPE][CONDITION][INDEX]=Value`

For example: `public[can_reply][always][0]=author`

Using `curl` this might look something like:

`curl -F 'public[can_reply][always][0]=author' -F 'public[can_reply][always][1]=followers'`

The JSON equivalent would be:

`curl -H 'Content-Type: application/json' -d '{"public":{"can_reply":{"always":["author","followers"]}}}'`

Any visibility level left unspecified in the request body will be returned to the default.

Ie., in the example above, "public" would be updated, but "unlisted", "private", and "direct" would be reset to defaults.

The server will perform some normalization on submitted policies so that you can't submit totally invalid policies.

---
tags:
- interaction_policies

consumes:
- multipart/form-data
- application/x-www-form-urlencoded
- application/json

produces:
- application/json

parameters:
-
	name: public[can_favourite][always][0]
	in: formData
	description: Nth entry for public.can_favourite.always.
	type: string
-
	name: public[can_favourite][with_approval][0]
	in: formData
	description: Nth entry for public.can_favourite.with_approval.
	type: string
-
	name: public[can_reply][always][0]
	in: formData
	description: Nth entry for public.can_reply.always.
	type: string
-
	name: public[can_reply][with_approval][0]
	in: formData
	description: Nth entry for public.can_reply.with_approval.
	type: string
-
	name: public[can_reblog][always][0]
	in: formData
	description: Nth entry for public.can_reblog.always.
	type: string
-
	name: public[can_reblog][with_approval][0]
	in: formData
	description: Nth entry for public.can_reblog.with_approval.
	type: string

-
	name: unlisted[can_favourite][always][0]
	in: formData
	description: Nth entry for unlisted.can_favourite.always.
	type: string
-
	name: unlisted[can_favourite][with_approval][0]
	in: formData
	description: Nth entry for unlisted.can_favourite.with_approval.
	type: string
-
	name: unlisted[can_reply][always][0]
	in: formData
	description: Nth entry for unlisted.can_reply.always.
	type: string
-
	name: unlisted[can_reply][with_approval][0]
	in: formData
	description: Nth entry for unlisted.can_reply.with_approval.
	type: string
-
	name: unlisted[can_reblog][always][0]
	in: formData
	description: Nth entry for unlisted.can_reblog.always.
	type: string
-
	name: unlisted[can_reblog][with_approval][0]
	in: formData
	description: Nth entry for unlisted.can_reblog.with_approval.
	type: string

-
	name: private[can_favourite][always][0]
	in: formData
	description: Nth entry for private.can_favourite.always.
	type: string
-
	name: private[can_favourite][with_approval][0]
	in: formData
	description: Nth entry for private.can_favourite.with_approval.
	type: string
-
	name: private[can_reply][always][0]
	in: formData
	description: Nth entry for private.can_reply.always.
	type: string
-
	name: private[can_reply][with_approval][0]
	in: formData
	description: Nth entry for private.can_reply.with_approval.
	type: string
-
	name: private[can_reblog][always][0]
	in: formData
	description: Nth entry for private.can_reblog.always.
	type: string
-
	name: private[can_reblog][with_approval][0]
	in: formData
	description: Nth entry for private.can_reblog.with_approval.
	type: string

-
	name: direct[can_favourite][always][0]
	in: formData
	description: Nth entry for direct.can_favourite.always.
	type: string
-
	name: direct[can_favourite][with_approval][0]
	in: formData
	description: Nth entry for direct.can_favourite.with_approval.
	type: string
-
	name: direct[can_reply][always][0]
	in: formData
	description: Nth entry for direct.can_reply.always.
	type: string
-
	name: direct[can_reply][with_approval][0]
	in: formData
	description: Nth entry for direct.can_reply.with_approval.
	type: string
-
	name: direct[can_reblog][always][0]
	in: formData
	description: Nth entry for direct.can_reblog.always.
	type: string
-
	name: direct[can_reblog][with_approval][0]
	in: formData
	description: Nth entry for direct.can_reblog.with_approval.
	type: string

security:
- OAuth2 Bearer:
	- write:accounts

responses:
	'200':
		description: Updated default policies object containing a policy for each status visibility.
		schema:
			"$ref": "#/definitions/defaultPolicies"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'406':
		description: not acceptable
	'422':
		description: unprocessable
	'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