@@ -13,6 +13,7 @@ class Client
13
13
const CHATAPI_ENDPOINT = 'https://chat.messagebird.com/1 ' ;
14
14
const CONVERSATIONSAPI_ENDPOINT = 'https://conversations.messagebird.com/v1 ' ;
15
15
const VOICEAPI_ENDPOINT = 'https://voice.messagebird.com ' ;
16
+ const PARTNER_ACCOUNT_ENDPOINT = 'https://partner-accounts.messagebird.com ' ;
16
17
17
18
const ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX = 'ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX ' ;
18
19
const CONVERSATIONSAPI_WHATSAPP_SANDBOX_ENDPOINT = 'https://whatsapp-sandbox.messagebird.com/v1 ' ;
@@ -139,6 +140,11 @@ class Client
139
140
*/
140
141
public $ conversationWebhooks ;
141
142
143
+ /**
144
+ * @var Resources\PartnerAccount\Accounts;
145
+ */
146
+ public $ partnerAccounts ;
147
+
142
148
/**
143
149
* @var Common\HttpClient
144
150
*/
@@ -159,6 +165,11 @@ class Client
159
165
*/
160
166
protected $ VoiceAPIHttpClient ;
161
167
168
+ /**
169
+ * @var Common\HttpClient
170
+ */
171
+ protected $ partnerAccountClient ;
172
+
162
173
/**
163
174
* @param string $accessKey
164
175
* @param Common\HttpClient $httpClient
@@ -172,11 +183,13 @@ public function __construct($accessKey = null, Common\HttpClient $httpClient = n
172
183
$ this ->VoiceAPIHttpClient = new Common \HttpClient (self ::VOICEAPI_ENDPOINT , 10 , 2 , array (
173
184
'X-MessageBird-Version ' => '20170314 ' ,
174
185
));
186
+ $ this ->partnerAccountClient = new Common \HttpClient (self ::PARTNER_ACCOUNT_ENDPOINT );
175
187
} else {
176
188
$ this ->ChatAPIHttpClient = $ httpClient ;
177
189
$ this ->ConversationsAPIHttpClient = $ httpClient ;
178
190
$ this ->HttpClient = $ httpClient ;
179
191
$ this ->VoiceAPIHttpClient = $ httpClient ;
192
+ $ this ->partnerAccountClient = $ httpClient ;
180
193
}
181
194
182
195
$ this ->HttpClient ->addUserAgentString ('MessageBird/ApiClient/ ' . self ::CLIENT_VERSION );
@@ -191,6 +204,9 @@ public function __construct($accessKey = null, Common\HttpClient $httpClient = n
191
204
$ this ->VoiceAPIHttpClient ->addUserAgentString ('MessageBird/ApiClient/ ' . self ::CLIENT_VERSION );
192
205
$ this ->VoiceAPIHttpClient ->addUserAgentString ($ this ->getPhpVersion ());
193
206
207
+ $ this ->partnerAccountClient ->addUserAgentString ('MessageBird/ApiClient/ ' . self ::CLIENT_VERSION );
208
+ $ this ->partnerAccountClient ->addUserAgentString ($ this ->getPhpVersion ());
209
+
194
210
if ($ accessKey !== null ) {
195
211
$ this ->setAccessKey ($ accessKey );
196
212
}
@@ -218,6 +234,7 @@ public function __construct($accessKey = null, Common\HttpClient $httpClient = n
218
234
$ this ->conversations = new Resources \Conversation \Conversations ($ this ->ConversationsAPIHttpClient );
219
235
$ this ->conversationMessages = new Resources \Conversation \Messages ($ this ->ConversationsAPIHttpClient );
220
236
$ this ->conversationWebhooks = new Resources \Conversation \Webhooks ($ this ->ConversationsAPIHttpClient );
237
+ $ this ->partnerAccounts = new Resources \PartnerAccount \Accounts ($ this ->partnerAccountClient );
221
238
}
222
239
223
240
/**
@@ -231,6 +248,7 @@ public function setAccessKey ($accessKey)
231
248
$ this ->ConversationsAPIHttpClient ->setAuthentication ($ Authentication );
232
249
$ this ->HttpClient ->setAuthentication ($ Authentication );
233
250
$ this ->VoiceAPIHttpClient ->setAuthentication ($ Authentication );
251
+ $ this ->partnerAccountClient ->setAuthentication ($ Authentication );
234
252
}
235
253
236
254
/**
0 commit comments