-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathSwaggerSchemasRequest.php
More file actions
122 lines (118 loc) · 3.94 KB
/
SwaggerSchemasRequest.php
File metadata and controls
122 lines (118 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
declare(strict_types=1);
namespace PhpList\RestBundle\Identity\OpenApi;
use OpenApi\Attributes as OA;
use PhpList\Core\Domain\Common\Model\AttributeTypeEnum;
#[OA\Schema(
schema: 'CreateAdministratorRequest',
required: ['login_name', 'password', 'email', 'super_user'],
properties: [
new OA\Property(
property: 'login_name',
type: 'string',
maxLength: 255,
minLength: 3,
example: 'admin'
),
new OA\Property(
property: 'password',
type: 'string',
format: 'password',
maxLength: 255,
minLength: 6,
example: 'StrongP@ssw0rd'
),
new OA\Property(
property: 'email',
type: 'string',
format: 'email',
example: 'admin@example.com'
),
new OA\Property(
property: 'super_user',
type: 'boolean',
example: false
),
new OA\Property(
property: 'privileges',
description: 'Array of privileges where keys are privilege names and values are booleans',
properties: [
new OA\Property(property: 'subscribers', type: 'boolean', example: true),
new OA\Property(property: 'campaigns', type: 'boolean', example: false),
new OA\Property(property: 'statistics', type: 'boolean', example: true),
new OA\Property(property: 'settings', type: 'boolean', example: false),
],
type: 'object',
example: ['subscribers' => true, 'campaigns' => false, 'statistics' => true, 'settings' => false]
),
],
type: 'object'
)]
#[OA\Schema(
schema: 'UpdateAdministratorRequest',
properties: [
new OA\Property(
property: 'login_name',
type: 'string',
maxLength: 255,
minLength: 3,
example: 'admin'
),
new OA\Property(
property: 'password',
type: 'string',
format: 'password',
maxLength: 255,
minLength: 6,
example: 'StrongP@ssw0rd'
),
new OA\Property(
property: 'email',
type: 'string',
format: 'email',
example: 'admin@example.com'
),
new OA\Property(
property: 'super_user',
type: 'boolean',
example: false
),
new OA\Property(
property: 'privileges',
description: 'Array of privileges where keys are privilege names and values are booleans',
properties: [
new OA\Property(property: 'subscribers', type: 'boolean', example: true),
new OA\Property(property: 'campaigns', type: 'boolean', example: false),
new OA\Property(property: 'statistics', type: 'boolean', example: true),
new OA\Property(property: 'settings', type: 'boolean', example: false),
],
type: 'object',
example: ['subscribers' => true, 'campaigns' => false, 'statistics' => true, 'settings' => false]
),
],
type: 'object'
)]
#[OA\Schema(
schema: 'AdminAttributeDefinitionRequest',
required: ['name'],
properties: [
new OA\Property(property: 'name', type: 'string', format: 'string', example: 'Country'),
new OA\Property(
property: 'type',
type: 'string',
enum: [
AttributeTypeEnum::TextLine,
AttributeTypeEnum::Hidden,
],
example: 'hidden',
nullable: true
),
new OA\Property(property: 'order', type: 'number', example: 12),
new OA\Property(property: 'default_value', type: 'string', example: 'United States'),
new OA\Property(property: 'required', type: 'boolean', example: true),
],
type: 'object'
)]
class SwaggerSchemasRequest
{
}