mirror of
https://github.com/valitydev/swag-sender.git
synced 2024-11-06 01:05:23 +00:00
Merge pull request #7 from rbkmoney/ft/JD-444/message-exclusion-rule-api
[JD-444] message exclusion rule API
This commit is contained in:
commit
120f2f44f2
7
openapi/components/parameters/ruleID.yaml
Normal file
7
openapi/components/parameters/ruleID.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
name: ruleID
|
||||
in: path
|
||||
description: Идентификатор правила
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
6
openapi/components/parameters/ruleType.yaml
Normal file
6
openapi/components/parameters/ruleType.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
name: type
|
||||
in: query
|
||||
description: Тип правила
|
||||
required: true
|
||||
schema:
|
||||
$ref: '../schemas/MessageExclusionRuleType.yaml'
|
17
openapi/components/requests/MessageExclusionRuleRequest.yaml
Normal file
17
openapi/components/requests/MessageExclusionRuleRequest.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
description: Запрос на создание правила исключения рассылки
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- value
|
||||
properties:
|
||||
name:
|
||||
description: Название правила
|
||||
type: string
|
||||
type:
|
||||
$ref: '../schemas/MessageExclusionRuleType.yaml'
|
||||
value:
|
||||
description: Набор исключенных значений
|
||||
type: array
|
||||
items:
|
||||
type: string
|
@ -0,0 +1,6 @@
|
||||
type: object
|
||||
properties:
|
||||
result:
|
||||
type: array
|
||||
items:
|
||||
$ref: '../schemas/MessageExclusionRule.yaml'
|
@ -2,4 +2,4 @@ description: Заданный ресурс не найден
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/GeneralError'
|
||||
$ref: '../schemas/Error.yaml'
|
||||
|
22
openapi/components/schemas/Error.yaml
Normal file
22
openapi/components/schemas/Error.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: integer
|
||||
minimum: 100
|
||||
maximum: 600
|
||||
description: The HTTP status code.
|
||||
error:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
description: >-
|
||||
A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] that
|
||||
identifies the problem type. It should provide human-readable
|
||||
documentation for the problem type. When this member is not present, its
|
||||
value is assumed to be "about:blank".
|
||||
title:
|
||||
type: string
|
||||
description: >-
|
||||
A short, human-readable summary of the problem type. It SHOULD NOT change
|
||||
from occurrence to occurrence of the problem, except for purposes of
|
||||
localization.
|
21
openapi/components/schemas/MessageExclusionRule.yaml
Normal file
21
openapi/components/schemas/MessageExclusionRule.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
- type
|
||||
- value
|
||||
properties:
|
||||
id:
|
||||
description: Идентификатор правила
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
description: Название правила
|
||||
type: string
|
||||
type:
|
||||
$ref: 'MessageExclusionRuleType.yaml'
|
||||
value:
|
||||
description: Набор исключенных значений
|
||||
type: array
|
||||
items:
|
||||
type: string
|
4
openapi/components/schemas/MessageExclusionRuleType.yaml
Normal file
4
openapi/components/schemas/MessageExclusionRuleType.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
description: Тип правила исключения рассылки
|
||||
type: string
|
||||
enum:
|
||||
- shop
|
@ -15,6 +15,10 @@ info:
|
||||
paths:
|
||||
/message/feedback:
|
||||
$ref: ./paths/message-feedback.yaml
|
||||
'/message/exclusion-rules/{ruleID}':
|
||||
$ref: './paths/message-exclusion-rules@{ruleID}.yaml'
|
||||
'/message/exclusion-rules':
|
||||
$ref: './paths/message-exclusion-rules.yaml'
|
||||
servers:
|
||||
- url: 'https://{subdomain}.rbk.money/sender/{version}'
|
||||
variables:
|
||||
|
41
openapi/paths/message-exclusion-rules.yaml
Normal file
41
openapi/paths/message-exclusion-rules.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
post:
|
||||
summary: Создание правила исключения рассылки
|
||||
tags:
|
||||
- MessageExclusionRules
|
||||
operationId: createMessageExclusionRule
|
||||
parameters:
|
||||
- $ref: '../components/parameters/requestId.yaml'
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../components/requests/MessageExclusionRuleRequest.yaml'
|
||||
responses:
|
||||
'200':
|
||||
description: Созданное правило исключения рассылки
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../components/schemas/MessageExclusionRule.yaml'
|
||||
'401':
|
||||
$ref: '../components/responses/AccessForbidden.yaml'
|
||||
'404':
|
||||
$ref: '../components/responses/NotFound.yaml'
|
||||
|
||||
get:
|
||||
summary: Поиск правил исключения рассылки по типу
|
||||
tags:
|
||||
- MessageExclusionRules
|
||||
operationId: getMessageExclusionRulesByType
|
||||
parameters:
|
||||
- $ref: '../components/parameters/requestId.yaml'
|
||||
- $ref: '../components/parameters/ruleType.yaml'
|
||||
responses:
|
||||
'200':
|
||||
description: Список правил исключения рассылки
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../components/responses/MessageExclusionRuleList.yaml'
|
||||
'401':
|
||||
$ref: '../components/responses/AccessForbidden.yaml'
|
34
openapi/paths/message-exclusion-rules@{ruleID}.yaml
Normal file
34
openapi/paths/message-exclusion-rules@{ruleID}.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
get:
|
||||
summary: Получение правила исключения рассылки
|
||||
tags:
|
||||
- MessageExclusionRules
|
||||
operationId: getMessageExclusionRule
|
||||
parameters:
|
||||
- $ref: '../components/parameters/requestId.yaml'
|
||||
- $ref: '../components/parameters/ruleID.yaml'
|
||||
responses:
|
||||
'200':
|
||||
description: Правило исключения рассылки
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../components/schemas/MessageExclusionRule.yaml'
|
||||
'401':
|
||||
$ref: '../components/responses/AccessForbidden.yaml'
|
||||
'404':
|
||||
$ref: '../components/responses/NotFound.yaml'
|
||||
delete:
|
||||
summary: Удаление правила исключения рассылки
|
||||
tags:
|
||||
- MessageExclusionRules
|
||||
operationId: deleteMessageExclusionRule
|
||||
parameters:
|
||||
- $ref: '../components/parameters/requestId.yaml'
|
||||
- $ref: '../components/parameters/ruleID.yaml'
|
||||
responses:
|
||||
'204':
|
||||
description: Правило удалено
|
||||
'401':
|
||||
$ref: '../components/responses/AccessForbidden.yaml'
|
||||
'404':
|
||||
$ref: '../components/responses/NotFound.yaml'
|
Loading…
Reference in New Issue
Block a user