Merge pull request #7 from rbkmoney/ft/JD-444/message-exclusion-rule-api

[JD-444] message exclusion rule API
This commit is contained in:
ElenaKushchenko 2021-08-26 18:36:45 +03:00 committed by GitHub
commit 120f2f44f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 163 additions and 1 deletions

View File

@ -0,0 +1,7 @@
name: ruleID
in: path
description: Идентификатор правила
required: true
schema:
type: integer
format: int64

View File

@ -0,0 +1,6 @@
name: type
in: query
description: Тип правила
required: true
schema:
$ref: '../schemas/MessageExclusionRuleType.yaml'

View 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

View File

@ -0,0 +1,6 @@
type: object
properties:
result:
type: array
items:
$ref: '../schemas/MessageExclusionRule.yaml'

View File

@ -2,4 +2,4 @@ description: Заданный ресурс не найден
content:
application/json:
schema:
$ref: '#/components/schemas/GeneralError'
$ref: '../schemas/Error.yaml'

View 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.

View 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

View File

@ -0,0 +1,4 @@
description: Тип правила исключения рассылки
type: string
enum:
- shop

View File

@ -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:

View 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'

View 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'