1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* It's free open-source software released under the MIT License. |
5
|
|
|
* |
6
|
|
|
* @author Anatoly Fenric <[email protected]> |
7
|
|
|
* @copyright Copyright (c) 2018, Anatoly Fenric |
8
|
|
|
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE |
9
|
|
|
* @link https://github.com/sunrise-php/http-router |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Sunrise\Http\Router\OpenApi; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* OAS OAuth Flows Object |
16
|
|
|
* |
17
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#oauth-flows-object |
18
|
|
|
*/ |
19
|
|
|
class OAuthFlows extends AbstractObject |
20
|
|
|
{ |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var OAuthFlow |
24
|
|
|
* |
25
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowsimplicit |
26
|
|
|
*/ |
27
|
|
|
protected $implicit; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var OAuthFlow |
31
|
|
|
* |
32
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowspassword |
33
|
|
|
*/ |
34
|
|
|
protected $password; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var OAuthFlow |
38
|
|
|
* |
39
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowsclientcredentials |
40
|
|
|
*/ |
41
|
|
|
protected $clientCredentials; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var OAuthFlow |
45
|
|
|
* |
46
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowsauthorizationcode |
47
|
|
|
*/ |
48
|
|
|
protected $authorizationCode; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param OAuthFlow $implicit |
52
|
|
|
* |
53
|
|
|
* @return void |
54
|
|
|
*/ |
55
|
|
|
public function setImplicit(OAuthFlow $implicit) : void |
56
|
|
|
{ |
57
|
|
|
$this->implicit = $implicit; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param OAuthFlow $password |
62
|
|
|
* |
63
|
|
|
* @return void |
64
|
|
|
*/ |
65
|
|
|
public function setPassword(OAuthFlow $password) : void |
66
|
|
|
{ |
67
|
|
|
$this->password = $password; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param OAuthFlow $clientCredentials |
72
|
|
|
* |
73
|
|
|
* @return void |
74
|
|
|
*/ |
75
|
|
|
public function setClientCredentials(OAuthFlow $clientCredentials) : void |
76
|
|
|
{ |
77
|
|
|
$this->clientCredentials = $clientCredentials; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @param OAuthFlow $authorizationCode |
82
|
|
|
* |
83
|
|
|
* @return void |
84
|
|
|
*/ |
85
|
|
|
public function setAuthorizationCode(OAuthFlow $authorizationCode) : void |
86
|
|
|
{ |
87
|
|
|
$this->authorizationCode = $authorizationCode; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|