Skip to content

Commit d644b47

Browse files
October 2020 api spec update (#96)
* sort endpoint parameters by their name, and auto-merge conversation and user objects * updated spec and regenerated patch file * re-generated SDK classes * upgraded to Jane 6.2 * Improve the Changelog Co-authored-by: Damien ALEXANDRE <mobman02@gmail.com>
1 parent c79b5ed commit d644b47

File tree

996 files changed

+39435
-65682
lines changed

Some content is hidden

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

996 files changed

+39435
-65682
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changes between versions
22

3+
## Unreleased
4+
5+
* **Breaking** Specification update to latest Slack official version - see slackapi/slack-api-specs#44
6+
* added methods:
7+
* `/admin.conversations.*`
8+
* `/admin.usergroups.*`
9+
* `/admin.users.session.invalidate`
10+
* `/apps.event.authorizations.list`
11+
* `/calls.*`
12+
* `/conversations.mark`
13+
* `/workflows.*`
14+
* removed methods:
15+
* `/im*`
16+
* `/mpim*`
17+
* `/channels*`
18+
* `/groups*`
19+
* ease up the patching process:
20+
* in the patched json file, sort endpoint query parameters by their `name` attributes, to keep a consistent order
21+
* auto-merge `objs_user` and `objs_conversation` polymorphic properties in order to keep the patch hunks as small as possible
22+
* Upgrade to JanePHP version 6.2
23+
324
## 3.0.2 (2020-10-20)
425

526
* **Specification override** Allow string and integer for the "post_at" field in chatScheduleMessage

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
},
2424
"require": {
2525
"php": ">= 7.2",
26-
"jane-php/open-api-runtime": "~6.1.0",
26+
"jane-php/open-api-runtime": "~6.2.0",
2727
"psr/http-client-implementation": "*",
2828
"php-http/client-common": "^1.9 || ^2.0",
2929
"php-http/discovery": "^1.7",
3030
"php-http/multipart-stream-builder": "^1.1"
3131
},
3232
"require-dev": {
33-
"jane-php/open-api-2": "~6.1.0",
33+
"jane-php/open-api-2": "~6.2.0",
3434
"symfony/http-client": "^4.3.3 || ^5.1",
3535
"nyholm/psr7": "^1.2",
3636
"friendsofphp/php-cs-fixer": "^2.16",

doc/updating-sdk.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ You can now build a new SDK using this patched specification.
2424

2525
## Regenerate the SDk
2626

27+
If you suspect that some endpoints or models have been removed, first remove all the content
28+
of the `generated` directory:
29+
30+
```bash
31+
rm -Rf generated/*
32+
```
33+
34+
2735
When the versioned specification has been updated, you can run Jane to regenerate the SDK:
2836

2937
```bash
@@ -43,4 +51,9 @@ a new specification bug, here is the process to propose changes:
4351
./bin/slack-api-client-generator spec:generate-patch
4452
```
4553

46-
It will create a new version of the cumulative patch in `resources`.
54+
It will create a new version of the cumulative patch in the `resources` directory. Before pushing
55+
changes, you can check that the patch is correctly re-applied:
56+
57+
```bash
58+
./bin/slack-api-client-generator spec:update
59+
```

generated/Client.php

Lines changed: 1245 additions & 1448 deletions
Large diffs are not rendered by default.

generated/Endpoint/AdminAppsApprove.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
namespace JoliCode\Slack\Api\Endpoint;
1515

16-
class AdminAppsApprove extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Endpoint
16+
class AdminAppsApprove extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint
1717
{
18-
use \Jane\OpenApiRuntime\Client\EndpointTrait;
18+
use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait;
1919

2020
/**
2121
* Approve an app for installation on a workspace.
2222
*
2323
* @param array $formParameters {
2424
*
25-
* @var string $team_id
2625
* @var string $app_id the id of the app to approve
27-
* @var string $request_id The id of the request to approve.
26+
* @var string $request_id the id of the request to approve
27+
* @var string $team_id
2828
* }
2929
*
3030
* @param array $headerParameters {
@@ -66,12 +66,12 @@ public function getAuthenticationScopes(): array
6666
protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
6767
{
6868
$optionsResolver = parent::getFormOptionsResolver();
69-
$optionsResolver->setDefined(['team_id', 'app_id', 'request_id']);
69+
$optionsResolver->setDefined(['app_id', 'request_id', 'team_id']);
7070
$optionsResolver->setRequired([]);
7171
$optionsResolver->setDefaults([]);
72-
$optionsResolver->setAllowedTypes('team_id', ['string']);
7372
$optionsResolver->setAllowedTypes('app_id', ['string']);
7473
$optionsResolver->setAllowedTypes('request_id', ['string']);
74+
$optionsResolver->setAllowedTypes('team_id', ['string']);
7575

7676
return $optionsResolver;
7777
}

generated/Endpoint/AdminAppsApprovedList.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313

1414
namespace JoliCode\Slack\Api\Endpoint;
1515

16-
class AdminAppsApprovedList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Endpoint
16+
class AdminAppsApprovedList extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint
1717
{
18-
use \Jane\OpenApiRuntime\Client\EndpointTrait;
18+
use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait;
1919

2020
/**
2121
* List approved apps for an org or workspace.
2222
*
2323
* @param array $queryParameters {
2424
*
2525
* @var string $cursor Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
26-
* @var string $token Authentication token. Requires scope: `admin.apps:read`
26+
* @var string $enterprise_id
2727
* @var int $limit The maximum number of items to return. Must be between 1 - 1000 both inclusive.
2828
* @var string $team_id
29-
* @var string $enterprise_id
29+
* @var string $token Authentication token. Requires scope: `admin.apps:read`
3030
* }
3131
*/
3232
public function __construct(array $queryParameters = [])
@@ -62,14 +62,14 @@ public function getAuthenticationScopes(): array
6262
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
6363
{
6464
$optionsResolver = parent::getQueryOptionsResolver();
65-
$optionsResolver->setDefined(['cursor', 'token', 'limit', 'team_id', 'enterprise_id']);
65+
$optionsResolver->setDefined(['cursor', 'enterprise_id', 'limit', 'team_id', 'token']);
6666
$optionsResolver->setRequired([]);
6767
$optionsResolver->setDefaults([]);
6868
$optionsResolver->setAllowedTypes('cursor', ['string']);
69-
$optionsResolver->setAllowedTypes('token', ['string']);
69+
$optionsResolver->setAllowedTypes('enterprise_id', ['string']);
7070
$optionsResolver->setAllowedTypes('limit', ['int']);
7171
$optionsResolver->setAllowedTypes('team_id', ['string']);
72-
$optionsResolver->setAllowedTypes('enterprise_id', ['string']);
72+
$optionsResolver->setAllowedTypes('token', ['string']);
7373

7474
return $optionsResolver;
7575
}

generated/Endpoint/AdminAppsRequestsList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313

1414
namespace JoliCode\Slack\Api\Endpoint;
1515

16-
class AdminAppsRequestsList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Endpoint
16+
class AdminAppsRequestsList extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint
1717
{
18-
use \Jane\OpenApiRuntime\Client\EndpointTrait;
18+
use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait;
1919

2020
/**
2121
* List app requests for a team/workspace.
2222
*
2323
* @param array $queryParameters {
2424
*
2525
* @var string $cursor Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
26-
* @var string $token Authentication token. Requires scope: `admin.apps:read`
2726
* @var int $limit The maximum number of items to return. Must be between 1 - 1000 both inclusive.
2827
* @var string $team_id
28+
* @var string $token Authentication token. Requires scope: `admin.apps:read`
2929
* }
3030
*/
3131
public function __construct(array $queryParameters = [])
@@ -61,13 +61,13 @@ public function getAuthenticationScopes(): array
6161
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
6262
{
6363
$optionsResolver = parent::getQueryOptionsResolver();
64-
$optionsResolver->setDefined(['cursor', 'token', 'limit', 'team_id']);
64+
$optionsResolver->setDefined(['cursor', 'limit', 'team_id', 'token']);
6565
$optionsResolver->setRequired([]);
6666
$optionsResolver->setDefaults([]);
6767
$optionsResolver->setAllowedTypes('cursor', ['string']);
68-
$optionsResolver->setAllowedTypes('token', ['string']);
6968
$optionsResolver->setAllowedTypes('limit', ['int']);
7069
$optionsResolver->setAllowedTypes('team_id', ['string']);
70+
$optionsResolver->setAllowedTypes('token', ['string']);
7171

7272
return $optionsResolver;
7373
}

generated/Endpoint/AdminAppsRestrict.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
namespace JoliCode\Slack\Api\Endpoint;
1515

16-
class AdminAppsRestrict extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Endpoint
16+
class AdminAppsRestrict extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint
1717
{
18-
use \Jane\OpenApiRuntime\Client\EndpointTrait;
18+
use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait;
1919

2020
/**
2121
* Restrict an app for installation on a workspace.
2222
*
2323
* @param array $formParameters {
2424
*
25-
* @var string $team_id
2625
* @var string $app_id the id of the app to restrict
27-
* @var string $request_id The id of the request to restrict.
26+
* @var string $request_id the id of the request to restrict
27+
* @var string $team_id
2828
* }
2929
*
3030
* @param array $headerParameters {
@@ -66,12 +66,12 @@ public function getAuthenticationScopes(): array
6666
protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
6767
{
6868
$optionsResolver = parent::getFormOptionsResolver();
69-
$optionsResolver->setDefined(['team_id', 'app_id', 'request_id']);
69+
$optionsResolver->setDefined(['app_id', 'request_id', 'team_id']);
7070
$optionsResolver->setRequired([]);
7171
$optionsResolver->setDefaults([]);
72-
$optionsResolver->setAllowedTypes('team_id', ['string']);
7372
$optionsResolver->setAllowedTypes('app_id', ['string']);
7473
$optionsResolver->setAllowedTypes('request_id', ['string']);
74+
$optionsResolver->setAllowedTypes('team_id', ['string']);
7575

7676
return $optionsResolver;
7777
}

generated/Endpoint/AdminAppsRestrictedList.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313

1414
namespace JoliCode\Slack\Api\Endpoint;
1515

16-
class AdminAppsRestrictedList extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Endpoint
16+
class AdminAppsRestrictedList extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint
1717
{
18-
use \Jane\OpenApiRuntime\Client\EndpointTrait;
18+
use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait;
1919

2020
/**
2121
* List restricted apps for an org or workspace.
2222
*
2323
* @param array $queryParameters {
2424
*
2525
* @var string $cursor Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
26-
* @var string $token Authentication token. Requires scope: `admin.apps:read`
26+
* @var string $enterprise_id
2727
* @var int $limit The maximum number of items to return. Must be between 1 - 1000 both inclusive.
2828
* @var string $team_id
29-
* @var string $enterprise_id
29+
* @var string $token Authentication token. Requires scope: `admin.apps:read`
3030
* }
3131
*/
3232
public function __construct(array $queryParameters = [])
@@ -62,14 +62,14 @@ public function getAuthenticationScopes(): array
6262
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
6363
{
6464
$optionsResolver = parent::getQueryOptionsResolver();
65-
$optionsResolver->setDefined(['cursor', 'token', 'limit', 'team_id', 'enterprise_id']);
65+
$optionsResolver->setDefined(['cursor', 'enterprise_id', 'limit', 'team_id', 'token']);
6666
$optionsResolver->setRequired([]);
6767
$optionsResolver->setDefaults([]);
6868
$optionsResolver->setAllowedTypes('cursor', ['string']);
69-
$optionsResolver->setAllowedTypes('token', ['string']);
69+
$optionsResolver->setAllowedTypes('enterprise_id', ['string']);
7070
$optionsResolver->setAllowedTypes('limit', ['int']);
7171
$optionsResolver->setAllowedTypes('team_id', ['string']);
72-
$optionsResolver->setAllowedTypes('enterprise_id', ['string']);
72+
$optionsResolver->setAllowedTypes('token', ['string']);
7373

7474
return $optionsResolver;
7575
}

generated/Endpoint/ChannelsLeave.php renamed to generated/Endpoint/AdminConversationsArchive.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313

1414
namespace JoliCode\Slack\Api\Endpoint;
1515

16-
class ChannelsLeave extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Endpoint
16+
class AdminConversationsArchive extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint
1717
{
18-
use \Jane\OpenApiRuntime\Client\EndpointTrait;
18+
use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait;
1919

2020
/**
21-
* Leaves a channel.
21+
* Archive a public or private channel.
2222
*
2323
* @param array $formParameters {
2424
*
25-
* @var string $channel Channel to leave
25+
* @var string $channel_id The channel to archive.
2626
* }
2727
*
2828
* @param array $headerParameters {
2929
*
30-
* @var string $token Authentication token. Requires scope: `channels:write`
30+
* @var string $token Authentication token. Requires scope: `admin.conversations:write`
3131
* }
3232
*/
3333
public function __construct(array $formParameters = [], array $headerParameters = [])
@@ -43,7 +43,7 @@ public function getMethod(): string
4343

4444
public function getUri(): string
4545
{
46-
return '/channels.leave';
46+
return '/admin.conversations.archive';
4747
}
4848

4949
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
@@ -64,10 +64,10 @@ public function getAuthenticationScopes(): array
6464
protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
6565
{
6666
$optionsResolver = parent::getFormOptionsResolver();
67-
$optionsResolver->setDefined(['channel']);
68-
$optionsResolver->setRequired([]);
67+
$optionsResolver->setDefined(['channel_id']);
68+
$optionsResolver->setRequired(['channel_id']);
6969
$optionsResolver->setDefaults([]);
70-
$optionsResolver->setAllowedTypes('channel', ['string']);
70+
$optionsResolver->setAllowedTypes('channel_id', ['string']);
7171

7272
return $optionsResolver;
7373
}
@@ -86,14 +86,14 @@ protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolv
8686
/**
8787
* {@inheritdoc}
8888
*
89-
* @return \JoliCode\Slack\Api\Model\ChannelsLeavePostResponse200|\JoliCode\Slack\Api\Model\ChannelsLeavePostResponsedefault|null
89+
* @return \JoliCode\Slack\Api\Model\AdminConversationsArchivePostResponse200|\JoliCode\Slack\Api\Model\AdminConversationsArchivePostResponsedefault|null
9090
*/
9191
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType)
9292
{
9393
if (200 === $status) {
94-
return $serializer->deserialize($body, 'JoliCode\\Slack\\Api\\Model\\ChannelsLeavePostResponse200', 'json');
94+
return $serializer->deserialize($body, 'JoliCode\\Slack\\Api\\Model\\AdminConversationsArchivePostResponse200', 'json');
9595
}
9696

97-
return $serializer->deserialize($body, 'JoliCode\\Slack\\Api\\Model\\ChannelsLeavePostResponsedefault', 'json');
97+
return $serializer->deserialize($body, 'JoliCode\\Slack\\Api\\Model\\AdminConversationsArchivePostResponsedefault', 'json');
9898
}
9999
}

0 commit comments

Comments
 (0)