|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @file ATTENTION!!! The code below was carefully crafted by a mean machine. |
|
4
|
|
|
* Please consider to NOT put any emotional human-generated modifications as the splendid AI will throw them away with no mercy. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
namespace Swaggest\JsonSchema\SwaggerSchema; |
|
8
|
|
|
|
|
9
|
|
|
use Swaggest\JsonSchema\Constraint\Properties; |
|
10
|
|
|
use Swaggest\JsonSchema\Schema as JsonBasicSchema; |
|
11
|
|
|
use Swaggest\JsonSchema\Structure\ClassStructure; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
class Oauth2ApplicationSecurity extends ClassStructure { |
|
15
|
|
|
/** @var string */ |
|
16
|
|
|
public $type; |
|
17
|
|
|
|
|
18
|
|
|
/** @var string */ |
|
19
|
|
|
public $flow; |
|
20
|
|
|
|
|
21
|
|
|
/** @var string[] */ |
|
22
|
|
|
public $scopes; |
|
23
|
|
|
|
|
24
|
|
|
/** @var string */ |
|
25
|
|
|
public $tokenUrl; |
|
26
|
|
|
|
|
27
|
|
|
/** @var string */ |
|
28
|
|
|
public $description; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @param Properties|static $properties |
|
32
|
|
|
* @param JsonBasicSchema $ownerSchema |
|
33
|
|
|
*/ |
|
34
|
|
|
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema) |
|
35
|
|
|
{ |
|
36
|
|
|
$properties->type = JsonBasicSchema::string(); |
|
37
|
|
|
$properties->type->enum = array ( |
|
38
|
|
|
0 => 'oauth2', |
|
39
|
|
|
); |
|
40
|
|
|
$properties->flow = JsonBasicSchema::string(); |
|
41
|
|
|
$properties->flow->enum = array ( |
|
42
|
|
|
0 => 'application', |
|
43
|
|
|
); |
|
44
|
|
|
$properties->scopes = JsonBasicSchema::object(); |
|
45
|
|
|
$properties->scopes->additionalProperties = JsonBasicSchema::string(); |
|
46
|
|
|
$properties->tokenUrl = JsonBasicSchema::string(); |
|
47
|
|
|
$properties->tokenUrl->format = 'uri'; |
|
48
|
|
|
$properties->description = JsonBasicSchema::string(); |
|
49
|
|
|
$ownerSchema->type = 'object'; |
|
|
|
|
|
|
50
|
|
|
$ownerSchema->additionalProperties = false; |
|
51
|
|
|
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema(); |
|
52
|
|
|
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.'; |
|
53
|
|
|
$ownerSchema->required = array ( |
|
54
|
|
|
0 => 'type', |
|
55
|
|
|
1 => 'flow', |
|
56
|
|
|
2 => 'tokenUrl', |
|
57
|
|
|
); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @param string $type |
|
62
|
|
|
* @return $this |
|
63
|
|
|
*/ |
|
64
|
|
|
public function setType($type) |
|
65
|
|
|
{ |
|
66
|
|
|
$this->type = $type; |
|
67
|
|
|
return $this; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @param string $flow |
|
72
|
|
|
* @return $this |
|
73
|
|
|
*/ |
|
74
|
|
|
public function setFlow($flow) |
|
75
|
|
|
{ |
|
76
|
|
|
$this->flow = $flow; |
|
77
|
|
|
return $this; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @param string[] $scopes |
|
82
|
|
|
* @return $this |
|
83
|
|
|
*/ |
|
84
|
|
|
public function setScopes($scopes) |
|
85
|
|
|
{ |
|
86
|
|
|
$this->scopes = $scopes; |
|
87
|
|
|
return $this; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @param string $tokenUrl |
|
92
|
|
|
* @return $this |
|
93
|
|
|
*/ |
|
94
|
|
|
public function setTokenUrl($tokenUrl) |
|
95
|
|
|
{ |
|
96
|
|
|
$this->tokenUrl = $tokenUrl; |
|
97
|
|
|
return $this; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @param string $description |
|
102
|
|
|
* @return $this |
|
103
|
|
|
*/ |
|
104
|
|
|
public function setDescription($description) |
|
105
|
|
|
{ |
|
106
|
|
|
$this->description = $description; |
|
107
|
|
|
return $this; |
|
108
|
|
|
} |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..