Skip to content

Commit 9341a61

Browse files
committed
SDK regeneration
1 parent 76c35cb commit 9341a61

File tree

431 files changed

+26471
-10354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

431 files changed

+26471
-10354
lines changed

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fintercom%2Fintercom-php)
44
[![php shield](https://img.shields.io/badge/php-packagist-pink)](https://packagist.org/packages/intercom/intercom-php)
55

6-
The Intercom PHP library provides convenient access to the Intercom API from PHP.
6+
The Intercom PHP library provides convenient access to the Intercom APIs from PHP.
77

88
## Installation
99

@@ -656,19 +656,15 @@ Instantiate and use the client with the following:
656656
namespace Example;
657657

658658
use Intercom\IntercomClient;
659-
use Intercom\Articles\Requests\CreateArticleRequest;
660-
use Intercom\Articles\Types\CreateArticleRequestState;
659+
use Intercom\AiContent\Requests\CreateContentImportSourceRequest;
661660

662661
$client = new IntercomClient(
663662
token: '<token>',
664663
);
665-
$client->articles->create(
666-
new CreateArticleRequest([
667-
'title' => 'Thanks for everything',
668-
'description' => 'Description of the Article',
669-
'body' => 'Body of the Article',
670-
'authorId' => 1295,
671-
'state' => CreateArticleRequestState::Published->value,
664+
$client->aiContent->createContentImportSource(
665+
new CreateContentImportSourceRequest([
666+
'syncBehavior' => 'api',
667+
'url' => 'https://www.example.com',
672668
]),
673669
);
674670

@@ -683,7 +679,7 @@ use Intercom\Exceptions\IntercomApiException;
683679
use Intercom\Exceptions\IntercomException;
684680

685681
try {
686-
$response = $client->articles->create(...);
682+
$response = $client->aiContent->createContentImportSource(...);
687683
} catch (IntercomApiException $e) {
688684
echo 'API Exception occurred: ' . $e->getMessage() . "\n";
689685
echo 'Status Code: ' . $e->getCode() . "\n";
@@ -739,7 +735,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
739735
Use the `maxRetries` request option to configure this behavior.
740736

741737
```php
742-
$response = $client->articles->create(
738+
$response = $client->aiContent->createContentImportSource(
743739
...,
744740
options: [
745741
'maxRetries' => 0 // Override maxRetries at the request level
@@ -752,7 +748,7 @@ $response = $client->articles->create(
752748
The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior.
753749

754750
```php
755-
$response = $client->articles->create(
751+
$response = $client->aiContent->createContentImportSource(
756752
...,
757753
options: [
758754
'timeout' => 3.0 // Override timeout to 3 seconds
@@ -768,4 +764,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t
768764
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
769765
an issue first to discuss with us!
770766

771-
On the other hand, contributions to the README are always very welcome!
767+
On the other hand, contributions to the README are always very welcome!

composer.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "intercom/intercom-php",
3-
3+
"version": "6.0.0",
44
"description": "Intercom API client.",
55
"keywords": [
66
"intercom",
77
"api",
88
"sdk"
99
],
10-
"license": "MIT",
10+
"license": [],
1111
"require": {
1212
"php": "^8.1",
1313
"ext-json": "*",
@@ -36,11 +36,9 @@
3636
"test": "phpunit",
3737
"analyze": "phpstan analyze src tests --memory-limit=1G"
3838
},
39-
"authors": [
40-
{
41-
"name": "Intercom Platform Team",
42-
"homepage": "https://www.intercom.com"
43-
}
44-
],
39+
"author": {
40+
"name": "Intercom Platform Team",
41+
"url": "https://www.intercom.com"
42+
},
4543
"homepage": "https://developers.intercom.com/docs"
4644
}

src/Admins/AdminsClient.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ public function __construct(
7272
* queryParameters?: array<string, mixed>,
7373
* bodyProperties?: array<string, mixed>,
7474
* } $options
75-
* @return AdminWithApp
75+
* @return ?AdminWithApp
7676
* @throws IntercomException
7777
* @throws IntercomApiException
7878
*/
79-
public function identify(?array $options = null): AdminWithApp
79+
public function identify(?array $options = null): ?AdminWithApp
8080
{
8181
$options = array_merge($this->options, $options ?? []);
8282
try {
@@ -91,6 +91,9 @@ public function identify(?array $options = null): AdminWithApp
9191
$statusCode = $response->getStatusCode();
9292
if ($statusCode >= 200 && $statusCode < 400) {
9393
$json = $response->getBody()->getContents();
94+
if (empty($json)) {
95+
return null;
96+
}
9497
return AdminWithApp::fromJson($json);
9598
}
9699
} catch (JsonException $e) {
@@ -127,11 +130,11 @@ public function identify(?array $options = null): AdminWithApp
127130
* queryParameters?: array<string, mixed>,
128131
* bodyProperties?: array<string, mixed>,
129132
* } $options
130-
* @return Admin
133+
* @return ?Admin
131134
* @throws IntercomException
132135
* @throws IntercomApiException
133136
*/
134-
public function away(ConfigureAwayAdminRequest $request, ?array $options = null): Admin
137+
public function away(ConfigureAwayAdminRequest $request, ?array $options = null): ?Admin
135138
{
136139
$options = array_merge($this->options, $options ?? []);
137140
try {
@@ -147,6 +150,9 @@ public function away(ConfigureAwayAdminRequest $request, ?array $options = null)
147150
$statusCode = $response->getStatusCode();
148151
if ($statusCode >= 200 && $statusCode < 400) {
149152
$json = $response->getBody()->getContents();
153+
if (empty($json)) {
154+
return null;
155+
}
150156
return Admin::fromJson($json);
151157
}
152158
} catch (JsonException $e) {
@@ -298,11 +304,11 @@ public function list(?array $options = null): AdminList
298304
* queryParameters?: array<string, mixed>,
299305
* bodyProperties?: array<string, mixed>,
300306
* } $options
301-
* @return Admin
307+
* @return ?Admin
302308
* @throws IntercomException
303309
* @throws IntercomApiException
304310
*/
305-
public function find(FindAdminRequest $request, ?array $options = null): Admin
311+
public function find(FindAdminRequest $request, ?array $options = null): ?Admin
306312
{
307313
$options = array_merge($this->options, $options ?? []);
308314
try {
@@ -317,6 +323,9 @@ public function find(FindAdminRequest $request, ?array $options = null): Admin
317323
$statusCode = $response->getStatusCode();
318324
if ($statusCode >= 200 && $statusCode < 400) {
319325
$json = $response->getBody()->getContents();
326+
if (empty($json)) {
327+
return null;
328+
}
320329
return Admin::fromJson($json);
321330
}
322331
} catch (JsonException $e) {

src/Admins/Requests/ConfigureAwayAdminRequest.php

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
class ConfigureAwayAdminRequest extends JsonSerializableType
99
{
1010
/**
11-
* @var string $adminId The unique identifier of a given admin
11+
* @var int $adminId The unique identifier of a given admin
1212
*/
13-
private string $adminId;
13+
private int $adminId;
1414

1515
/**
1616
* @var bool $awayModeEnabled Set to "true" to change the status of the admin to away.
@@ -24,11 +24,18 @@ class ConfigureAwayAdminRequest extends JsonSerializableType
2424
#[JsonProperty('away_mode_reassign')]
2525
private bool $awayModeReassign;
2626

27+
/**
28+
* @var ?int $awayStatusReasonId The unique identifier of the away status reason
29+
*/
30+
#[JsonProperty('away_status_reason_id')]
31+
private ?int $awayStatusReasonId;
32+
2733
/**
2834
* @param array{
29-
* adminId: string,
35+
* adminId: int,
3036
* awayModeEnabled: bool,
3137
* awayModeReassign: bool,
38+
* awayStatusReasonId?: ?int,
3239
* } $values
3340
*/
3441
public function __construct(
@@ -37,20 +44,21 @@ public function __construct(
3744
$this->adminId = $values['adminId'];
3845
$this->awayModeEnabled = $values['awayModeEnabled'];
3946
$this->awayModeReassign = $values['awayModeReassign'];
47+
$this->awayStatusReasonId = $values['awayStatusReasonId'] ?? null;
4048
}
4149

4250
/**
43-
* @return string
51+
* @return int
4452
*/
45-
public function getAdminId(): string
53+
public function getAdminId(): int
4654
{
4755
return $this->adminId;
4856
}
4957

5058
/**
51-
* @param string $value
59+
* @param int $value
5260
*/
53-
public function setAdminId(string $value): self
61+
public function setAdminId(int $value): self
5462
{
5563
$this->adminId = $value;
5664
return $this;
@@ -89,4 +97,21 @@ public function setAwayModeReassign(bool $value): self
8997
$this->awayModeReassign = $value;
9098
return $this;
9199
}
100+
101+
/**
102+
* @return ?int
103+
*/
104+
public function getAwayStatusReasonId(): ?int
105+
{
106+
return $this->awayStatusReasonId;
107+
}
108+
109+
/**
110+
* @param ?int $value
111+
*/
112+
public function setAwayStatusReasonId(?int $value = null): self
113+
{
114+
$this->awayStatusReasonId = $value;
115+
return $this;
116+
}
92117
}

src/Admins/Requests/FindAdminRequest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
class FindAdminRequest extends JsonSerializableType
88
{
99
/**
10-
* @var string $adminId The unique identifier of a given admin
10+
* @var int $adminId The unique identifier of a given admin
1111
*/
12-
private string $adminId;
12+
private int $adminId;
1313

1414
/**
1515
* @param array{
16-
* adminId: string,
16+
* adminId: int,
1717
* } $values
1818
*/
1919
public function __construct(
@@ -23,17 +23,17 @@ public function __construct(
2323
}
2424

2525
/**
26-
* @return string
26+
* @return int
2727
*/
28-
public function getAdminId(): string
28+
public function getAdminId(): int
2929
{
3030
return $this->adminId;
3131
}
3232

3333
/**
34-
* @param string $value
34+
* @param int $value
3535
*/
36-
public function setAdminId(string $value): self
36+
public function setAdminId(int $value): self
3737
{
3838
$this->adminId = $value;
3939
return $this;

0 commit comments

Comments
 (0)