Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <dev@noladev.com>
8 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Mail\Api;
16
17use Pop\Http;
18
19/**
20 * Http interface
21 *
22 * @category   Pop
23 * @package    Pop\Mail
24 * @author     Nick Sagona, III <dev@noladev.com>
25 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
26 * @license    https://www.popphp.org/license     New BSD License
27 * @version    5.0.0
28 */
29interface HttpClientInterface
30{
31
32    /**
33     * Set client ID
34     *
35     * @param  string $clientId
36     * @return HttpClientInterface
37     */
38    public function setClientId(string $clientId): HttpClientInterface;
39
40    /**
41     * Get client ID
42     *
43     * @return ?string
44     */
45    public function getClientId(): ?string;
46
47    /**
48     * Has client ID
49     *
50     * @return bool
51     */
52    public function hasClientId(): bool;
53
54    /**
55     * Set client secret
56     *
57     * @param  string $clientSecret
58     * @return HttpClientInterface
59     */
60    public function setClientSecret(string $clientSecret): HttpClientInterface;
61
62    /**
63     * Get client ID
64     *
65     * @return ?string
66     */
67    public function getClientSecret(): ?string;
68
69    /**
70     * Has client ID
71     *
72     * @return bool
73     */
74    public function hasClientSecret(): bool;
75
76    /**
77     * Set scope
78     * @param  string $scope
79     * @return HttpClientInterface
80     */
81    public function setScope(string $scope): HttpClientInterface;
82
83    /**
84     * Get scope ID
85     *
86     * @return ?string
87     */
88    public function getScope(): ?string;
89
90    /**
91     * Has scope ID
92     *
93     * @return bool
94     */
95    public function hasScope(): bool;
96
97    /**
98     * Set account ID
99     *
100     * @param  string $accountId
101     * @return HttpClientInterface
102     */
103    public function setAccountId(string $accountId): HttpClientInterface;
104
105    /**
106     * Get account ID
107     *
108     * @return ?string
109     */
110    public function getAccountId(): ?string;
111
112    /**
113     * Has account ID
114     *
115     * @return bool
116     */
117    public function hasAccountId(): bool;
118
119    /**
120     * Set account username
121     *
122     * @param  string $username
123     * @return HttpClientInterface
124     */
125    public function setUsername(string $username): HttpClientInterface;
126
127    /**
128     * Get account username
129     *
130     * @return ?string
131     */
132    public function getUsername(): ?string;
133
134    /**
135     * Has account username
136     *
137     * @return bool
138     */
139    public function hasUsername(): bool;
140
141    /**
142     * Set token
143     *
144     * @param  string $token
145     * @return HttpClientInterface
146     */
147    public function setToken(string $token): HttpClientInterface;
148
149    /**
150     * Get token
151     *
152     * @return ?string
153     */
154    public function getToken(): ?string;
155
156    /**
157     * Has token
158     *
159     * @return bool
160     */
161    public function hasToken(): bool;
162
163    /**
164     * Set token expires
165     *
166     * @param  string $tokenExpires
167     * @return HttpClientInterface
168     */
169    public function setTokenExpires(string $tokenExpires): HttpClientInterface;
170
171    /**
172     * Get token expires
173     *
174     * @return ?string
175     */
176    public function getTokenExpires(): ?string;
177
178    /**
179     * Has token expires
180     *
181     * @return bool
182     */
183    public function hasTokenExpires(): bool;
184
185    /**
186     * Check if token is expired
187     *
188     * @return boolean
189     */
190    public function isTokenExpired(): bool;
191
192    /**
193     * Verify token and refresh is expired
194     *
195     * @return boolean
196     */
197    public function verifyToken(): bool;
198
199    /**
200     * Request token
201     *
202     * @throws Exception|Http\Exception|Http\Client\Exception|Http\Client\Handler\Exception
203     * @return HttpClientInterface
204     */
205    public function requestToken(): HttpClientInterface;
206
207}