Documentation ¶
Index ¶
Constants ¶
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 ¶
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 ¶
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