diff --git a/.gitignore b/.gitignore index 16b32593..94fc0f33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# misc +.idea/ + # Dependencies /vendor diff --git a/composer.json b/composer.json index bf96631c..1a4f3e26 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ } }, "require": { + "ext-curl": "*", "php": ">=8.0", "jane-php/open-api-runtime": "^7.7", "psr/http-client-implementation": "*", diff --git a/generated/Client.php b/generated/Client.php index 3aa43f75..01abd438 100644 --- a/generated/Client.php +++ b/generated/Client.php @@ -2478,6 +2478,33 @@ public function filesCommentsDelete(array $formParameters = [], array $headerPar return $this->executeEndpoint(new Endpoint\FilesCommentsDelete($formParameters, $headerParameters), $fetch); } + /** + * Finishes an upload started with files.getUploadURLExternal. + * + * @param array $queryParameters { + * + * @var string $blocks A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored. + * @var string $channel_id Channel ID where the file will be shared. If not specified, the file will remain private. + * @var string $channels comma-separated list of channel IDs where the file will be shared + * @var string $files an array of file objects, each containing the `id` of the file to be completed + * @var string $initial_comment the message text introducing the file in specified channels + * @var string $thread_ts Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. Also, make sure to provide only one channel when using `thread_ts`. + * } + * + * @param array $formParameters { + * + * @var string $token Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter. + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return Model\FilesCompleteUploadExternalPostResponse200|Model\FilesCompleteUploadExternalPostResponsedefault|\Psr\Http\Message\ResponseInterface|null + */ + public function filesCompleteUploadExternal(array $queryParameters = [], array $formParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new Endpoint\FilesCompleteUploadExternal($queryParameters, $formParameters), $fetch); + } + /** * Deletes a file. * @@ -2500,6 +2527,31 @@ public function filesDelete(array $formParameters = [], array $headerParameters return $this->executeEndpoint(new Endpoint\FilesDelete($formParameters, $headerParameters), $fetch); } + /** + * Gets a URL for an edge external file upload. + * + * @param array $queryParameters { + * + * @var string $alt_txt description of image for screen-reader + * @var string $filename name of the file being uploaded + * @var int $length size in bytes of the file being uploaded + * @var string $snippet_type Syntax type of the snippet being uploaded. + * } + * + * @param array $formParameters { + * + * @var string $token Authentication token. Requires scope: `files:write` + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return Model\FilesGetUploadURLExternalPostResponse200|Model\FilesGetUploadURLExternalPostResponsedefault|\Psr\Http\Message\ResponseInterface|null + */ + public function filesGetUploadUrlExternal(array $queryParameters = [], array $formParameters = [], string $fetch = self::FETCH_OBJECT) + { + return $this->executeEndpoint(new Endpoint\FilesGetUploadUrlExternal($queryParameters, $formParameters), $fetch); + } + /** * Gets information about a file. * diff --git a/generated/Endpoint/FilesCompleteUploadExternal.php b/generated/Endpoint/FilesCompleteUploadExternal.php new file mode 100644 index 00000000..22881b29 --- /dev/null +++ b/generated/Endpoint/FilesCompleteUploadExternal.php @@ -0,0 +1,109 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Endpoint; + +class FilesCompleteUploadExternal extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint +{ + use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait; + + /** + * Finishes an upload started with files.getUploadURLExternal. + * + * @param array $queryParameters { + * + * @var string $blocks A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored. + * @var string $channel_id Channel ID where the file will be shared. If not specified, the file will remain private. + * @var string $channels comma-separated list of channel IDs where the file will be shared + * @var string $files an array of file objects, each containing the `id` of the file to be completed + * @var string $initial_comment the message text introducing the file in specified channels + * @var string $thread_ts Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. Also, make sure to provide only one channel when using `thread_ts`. + * } + * + * @param array $formParameters { + * + * @var string $token Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter. + * } + */ + public function __construct(array $queryParameters = [], array $formParameters = []) + { + $this->queryParameters = $queryParameters; + $this->formParameters = $formParameters; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function getUri(): string + { + return '/files.completeUploadExternal'; + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getFormBody(); + } + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array + { + return ['slackAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['blocks', 'channel_id', 'channels', 'files', 'initial_comment', 'thread_ts']); + $optionsResolver->setRequired(['files']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('blocks', ['string']); + $optionsResolver->addAllowedTypes('channel_id', ['string']); + $optionsResolver->addAllowedTypes('channels', ['string']); + $optionsResolver->addAllowedTypes('files', ['string']); + $optionsResolver->addAllowedTypes('initial_comment', ['string']); + $optionsResolver->addAllowedTypes('thread_ts', ['string']); + + return $optionsResolver; + } + + protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getFormOptionsResolver(); + $optionsResolver->setDefined(['token']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('token', ['string']); + + return $optionsResolver; + } + + /** + * @return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200|\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault|null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200', 'json'); + } + + return $serializer->deserialize($body, 'JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault', 'json'); + } +} diff --git a/generated/Endpoint/FilesGetUploadUrlExternal.php b/generated/Endpoint/FilesGetUploadUrlExternal.php new file mode 100644 index 00000000..ade794c5 --- /dev/null +++ b/generated/Endpoint/FilesGetUploadUrlExternal.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Endpoint; + +class FilesGetUploadUrlExternal extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Slack\Api\Runtime\Client\Endpoint +{ + use \JoliCode\Slack\Api\Runtime\Client\EndpointTrait; + + /** + * Gets a URL for an edge external file upload. + * + * @param array $queryParameters { + * + * @var string $alt_txt description of image for screen-reader + * @var string $filename name of the file being uploaded + * @var int $length size in bytes of the file being uploaded + * @var string $snippet_type Syntax type of the snippet being uploaded. + * } + * + * @param array $formParameters { + * + * @var string $token Authentication token. Requires scope: `files:write` + * } + */ + public function __construct(array $queryParameters = [], array $formParameters = []) + { + $this->queryParameters = $queryParameters; + $this->formParameters = $formParameters; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function getUri(): string + { + return '/files.getUploadURLExternal'; + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return $this->getFormBody(); + } + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array + { + return ['slackAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getQueryOptionsResolver(); + $optionsResolver->setDefined(['alt_txt', 'filename', 'length', 'snippet_type']); + $optionsResolver->setRequired(['filename', 'length']); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('alt_txt', ['string']); + $optionsResolver->addAllowedTypes('filename', ['string']); + $optionsResolver->addAllowedTypes('length', ['int']); + $optionsResolver->addAllowedTypes('snippet_type', ['string']); + + return $optionsResolver; + } + + protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver + { + $optionsResolver = parent::getFormOptionsResolver(); + $optionsResolver->setDefined(['token']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->addAllowedTypes('token', ['string']); + + return $optionsResolver; + } + + /** + * @return \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200|\JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault|null + */ + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); + if (200 === $status) { + return $serializer->deserialize($body, 'JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200', 'json'); + } + + return $serializer->deserialize($body, 'JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault', 'json'); + } +} diff --git a/generated/Model/FilesCompleteUploadExternalPostResponse200.php b/generated/Model/FilesCompleteUploadExternalPostResponse200.php new file mode 100644 index 00000000..d2cd8c34 --- /dev/null +++ b/generated/Model/FilesCompleteUploadExternalPostResponse200.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Model; + +class FilesCompleteUploadExternalPostResponse200 +{ + /** + * @var array + */ + protected $initialized = []; + /** + * @var list|null + */ + protected $files; + /** + * @var bool|null + */ + protected $ok; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + + /** + * @return list|null + */ + public function getFiles(): ?array + { + return $this->files; + } + + /** + * @param list|null $files + */ + public function setFiles(?array $files): self + { + $this->initialized['files'] = true; + $this->files = $files; + + return $this; + } + + public function getOk(): ?bool + { + return $this->ok; + } + + public function setOk(?bool $ok): self + { + $this->initialized['ok'] = true; + $this->ok = $ok; + + return $this; + } +} diff --git a/generated/Model/FilesCompleteUploadExternalPostResponse200FilesItem.php b/generated/Model/FilesCompleteUploadExternalPostResponse200FilesItem.php new file mode 100644 index 00000000..8d37d7bc --- /dev/null +++ b/generated/Model/FilesCompleteUploadExternalPostResponse200FilesItem.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Model; + +class FilesCompleteUploadExternalPostResponse200FilesItem +{ + /** + * @var array + */ + protected $initialized = []; + /** + * @var string|null + */ + protected $id; + /** + * @var string|null + */ + protected $title; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + + public function getId(): ?string + { + return $this->id; + } + + public function setId(?string $id): self + { + $this->initialized['id'] = true; + $this->id = $id; + + return $this; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(?string $title): self + { + $this->initialized['title'] = true; + $this->title = $title; + + return $this; + } +} diff --git a/generated/Model/FilesCompleteUploadExternalPostResponsedefault.php b/generated/Model/FilesCompleteUploadExternalPostResponsedefault.php new file mode 100644 index 00000000..900bea91 --- /dev/null +++ b/generated/Model/FilesCompleteUploadExternalPostResponsedefault.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Model; + +class FilesCompleteUploadExternalPostResponsedefault +{ + /** + * @var array + */ + protected $initialized = []; + /** + * Note: PHP callstack is only visible in dev/qa. + * + * @var string|null + */ + protected $callstack; + /** + * @var string|null + */ + protected $error; + /** + * @var bool|null + */ + protected $ok; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + + /** + * Note: PHP callstack is only visible in dev/qa. + */ + public function getCallstack(): ?string + { + return $this->callstack; + } + + /** + * Note: PHP callstack is only visible in dev/qa. + */ + public function setCallstack(?string $callstack): self + { + $this->initialized['callstack'] = true; + $this->callstack = $callstack; + + return $this; + } + + public function getError(): ?string + { + return $this->error; + } + + public function setError(?string $error): self + { + $this->initialized['error'] = true; + $this->error = $error; + + return $this; + } + + public function getOk(): ?bool + { + return $this->ok; + } + + public function setOk(?bool $ok): self + { + $this->initialized['ok'] = true; + $this->ok = $ok; + + return $this; + } +} diff --git a/generated/Model/FilesGetUploadURLExternalPostResponse200.php b/generated/Model/FilesGetUploadURLExternalPostResponse200.php new file mode 100644 index 00000000..8928a489 --- /dev/null +++ b/generated/Model/FilesGetUploadURLExternalPostResponse200.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Model; + +class FilesGetUploadURLExternalPostResponse200 +{ + /** + * @var array + */ + protected $initialized = []; + /** + * @var string|null + */ + protected $fileId; + /** + * @var bool|null + */ + protected $ok; + /** + * URL where the file should be uploaded. + * + * @var string|null + */ + protected $uploadUrl; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + + public function getFileId(): ?string + { + return $this->fileId; + } + + public function setFileId(?string $fileId): self + { + $this->initialized['fileId'] = true; + $this->fileId = $fileId; + + return $this; + } + + public function getOk(): ?bool + { + return $this->ok; + } + + public function setOk(?bool $ok): self + { + $this->initialized['ok'] = true; + $this->ok = $ok; + + return $this; + } + + /** + * URL where the file should be uploaded. + */ + public function getUploadUrl(): ?string + { + return $this->uploadUrl; + } + + /** + * URL where the file should be uploaded. + */ + public function setUploadUrl(?string $uploadUrl): self + { + $this->initialized['uploadUrl'] = true; + $this->uploadUrl = $uploadUrl; + + return $this; + } +} diff --git a/generated/Model/FilesGetUploadURLExternalPostResponsedefault.php b/generated/Model/FilesGetUploadURLExternalPostResponsedefault.php new file mode 100644 index 00000000..f601368f --- /dev/null +++ b/generated/Model/FilesGetUploadURLExternalPostResponsedefault.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Model; + +class FilesGetUploadURLExternalPostResponsedefault +{ + /** + * @var array + */ + protected $initialized = []; + /** + * Note: PHP callstack is only visible in dev/qa. + * + * @var string|null + */ + protected $callstack; + /** + * @var string|null + */ + protected $error; + /** + * @var bool|null + */ + protected $ok; + + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + + /** + * Note: PHP callstack is only visible in dev/qa. + */ + public function getCallstack(): ?string + { + return $this->callstack; + } + + /** + * Note: PHP callstack is only visible in dev/qa. + */ + public function setCallstack(?string $callstack): self + { + $this->initialized['callstack'] = true; + $this->callstack = $callstack; + + return $this; + } + + public function getError(): ?string + { + return $this->error; + } + + public function setError(?string $error): self + { + $this->initialized['error'] = true; + $this->error = $error; + + return $this; + } + + public function getOk(): ?bool + { + return $this->ok; + } + + public function setOk(?bool $ok): self + { + $this->initialized['ok'] = true; + $this->ok = $ok; + + return $this; + } +} diff --git a/generated/Normalizer/FilesCompleteUploadExternalPostResponse200FilesItemNormalizer.php b/generated/Normalizer/FilesCompleteUploadExternalPostResponse200FilesItemNormalizer.php new file mode 100644 index 00000000..428248ba --- /dev/null +++ b/generated/Normalizer/FilesCompleteUploadExternalPostResponse200FilesItemNormalizer.php @@ -0,0 +1,154 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Normalizer; + +use Jane\Component\JsonSchemaRuntime\Reference; +use JoliCode\Slack\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Slack\Api\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FilesCompleteUploadExternalPostResponse200FilesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class === \get_class($data); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('title', $data) && null !== $data['title']) { + $object->setTitle($data['title']); + } elseif (\array_key_exists('title', $data) && null === $data['title']) { + $object->setTitle(null); + } + + return $object; + } + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('title') && null !== $object->getTitle()) { + $data['title'] = $object->getTitle(); + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class => false]; + } + } +} else { + class FilesCompleteUploadExternalPostResponse200FilesItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class === \get_class($data); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('id', $data) && null !== $data['id']) { + $object->setId($data['id']); + } elseif (\array_key_exists('id', $data) && null === $data['id']) { + $object->setId(null); + } + if (\array_key_exists('title', $data) && null !== $data['title']) { + $object->setTitle($data['title']); + } elseif (\array_key_exists('title', $data) && null === $data['title']) { + $object->setTitle(null); + } + + return $object; + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('id') && null !== $object->getId()) { + $data['id'] = $object->getId(); + } + if ($object->isInitialized('title') && null !== $object->getTitle()) { + $data['title'] = $object->getTitle(); + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class => false]; + } + } +} diff --git a/generated/Normalizer/FilesCompleteUploadExternalPostResponse200Normalizer.php b/generated/Normalizer/FilesCompleteUploadExternalPostResponse200Normalizer.php new file mode 100644 index 00000000..4cf7aa85 --- /dev/null +++ b/generated/Normalizer/FilesCompleteUploadExternalPostResponse200Normalizer.php @@ -0,0 +1,162 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Normalizer; + +use Jane\Component\JsonSchemaRuntime\Reference; +use JoliCode\Slack\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Slack\Api\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FilesCompleteUploadExternalPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class === \get_class($data); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('files', $data) && null !== $data['files']) { + $values = []; + foreach ($data['files'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class, 'json', $context); + } + $object->setFiles($values); + } elseif (\array_key_exists('files', $data) && null === $data['files']) { + $object->setFiles(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + + return $object; + } + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $values = []; + foreach ($object->getFiles() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['files'] = $values; + $data['ok'] = $object->getOk(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class => false]; + } + } +} else { + class FilesCompleteUploadExternalPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class === \get_class($data); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('files', $data) && null !== $data['files']) { + $values = []; + foreach ($data['files'] as $value) { + $values[] = $this->denormalizer->denormalize($value, \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class, 'json', $context); + } + $object->setFiles($values); + } elseif (\array_key_exists('files', $data) && null === $data['files']) { + $object->setFiles(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + + return $object; + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $values = []; + foreach ($object->getFiles() as $value) { + $values[] = $this->normalizer->normalize($value, 'json', $context); + } + $data['files'] = $values; + $data['ok'] = $object->getOk(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class => false]; + } + } +} diff --git a/generated/Normalizer/FilesCompleteUploadExternalPostResponsedefaultNormalizer.php b/generated/Normalizer/FilesCompleteUploadExternalPostResponsedefaultNormalizer.php new file mode 100644 index 00000000..17162e8b --- /dev/null +++ b/generated/Normalizer/FilesCompleteUploadExternalPostResponsedefaultNormalizer.php @@ -0,0 +1,162 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Normalizer; + +use Jane\Component\JsonSchemaRuntime\Reference; +use JoliCode\Slack\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Slack\Api\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FilesCompleteUploadExternalPostResponsedefaultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class === \get_class($data); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('callstack', $data) && null !== $data['callstack']) { + $object->setCallstack($data['callstack']); + } elseif (\array_key_exists('callstack', $data) && null === $data['callstack']) { + $object->setCallstack(null); + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + + return $object; + } + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('callstack') && null !== $object->getCallstack()) { + $data['callstack'] = $object->getCallstack(); + } + $data['error'] = $object->getError(); + $data['ok'] = $object->getOk(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class => false]; + } + } +} else { + class FilesCompleteUploadExternalPostResponsedefaultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class === \get_class($data); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('callstack', $data) && null !== $data['callstack']) { + $object->setCallstack($data['callstack']); + } elseif (\array_key_exists('callstack', $data) && null === $data['callstack']) { + $object->setCallstack(null); + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + + return $object; + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('callstack') && null !== $object->getCallstack()) { + $data['callstack'] = $object->getCallstack(); + } + $data['error'] = $object->getError(); + $data['ok'] = $object->getOk(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class => false]; + } + } +} diff --git a/generated/Normalizer/FilesGetUploadURLExternalPostResponse200Normalizer.php b/generated/Normalizer/FilesGetUploadURLExternalPostResponse200Normalizer.php new file mode 100644 index 00000000..ea693631 --- /dev/null +++ b/generated/Normalizer/FilesGetUploadURLExternalPostResponse200Normalizer.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Normalizer; + +use Jane\Component\JsonSchemaRuntime\Reference; +use JoliCode\Slack\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Slack\Api\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FilesGetUploadURLExternalPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class === \get_class($data); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('file_id', $data) && null !== $data['file_id']) { + $object->setFileId($data['file_id']); + } elseif (\array_key_exists('file_id', $data) && null === $data['file_id']) { + $object->setFileId(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + if (\array_key_exists('upload_url', $data) && null !== $data['upload_url']) { + $object->setUploadUrl($data['upload_url']); + } elseif (\array_key_exists('upload_url', $data) && null === $data['upload_url']) { + $object->setUploadUrl(null); + } + + return $object; + } + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + $data['file_id'] = $object->getFileId(); + $data['ok'] = $object->getOk(); + $data['upload_url'] = $object->getUploadUrl(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class => false]; + } + } +} else { + class FilesGetUploadURLExternalPostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class === \get_class($data); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('file_id', $data) && null !== $data['file_id']) { + $object->setFileId($data['file_id']); + } elseif (\array_key_exists('file_id', $data) && null === $data['file_id']) { + $object->setFileId(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + if (\array_key_exists('upload_url', $data) && null !== $data['upload_url']) { + $object->setUploadUrl($data['upload_url']); + } elseif (\array_key_exists('upload_url', $data) && null === $data['upload_url']) { + $object->setUploadUrl(null); + } + + return $object; + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + $data['file_id'] = $object->getFileId(); + $data['ok'] = $object->getOk(); + $data['upload_url'] = $object->getUploadUrl(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class => false]; + } + } +} diff --git a/generated/Normalizer/FilesGetUploadURLExternalPostResponsedefaultNormalizer.php b/generated/Normalizer/FilesGetUploadURLExternalPostResponsedefaultNormalizer.php new file mode 100644 index 00000000..9a4698e6 --- /dev/null +++ b/generated/Normalizer/FilesGetUploadURLExternalPostResponsedefaultNormalizer.php @@ -0,0 +1,162 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Slack\Api\Normalizer; + +use Jane\Component\JsonSchemaRuntime\Reference; +use JoliCode\Slack\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Slack\Api\Runtime\Normalizer\ValidatorTrait; +use Symfony\Component\HttpKernel\Kernel; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) { + class FilesGetUploadURLExternalPostResponsedefaultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class === \get_class($data); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('callstack', $data) && null !== $data['callstack']) { + $object->setCallstack($data['callstack']); + } elseif (\array_key_exists('callstack', $data) && null === $data['callstack']) { + $object->setCallstack(null); + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + + return $object; + } + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + if ($object->isInitialized('callstack') && null !== $object->getCallstack()) { + $data['callstack'] = $object->getCallstack(); + } + $data['error'] = $object->getError(); + $data['ok'] = $object->getOk(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class => false]; + } + } +} else { + class FilesGetUploadURLExternalPostResponsedefaultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use CheckArray; + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return \is_object($data) && \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class === \get_class($data); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault(); + if (null === $data || false === \is_array($data)) { + return $object; + } + if (\array_key_exists('callstack', $data) && null !== $data['callstack']) { + $object->setCallstack($data['callstack']); + } elseif (\array_key_exists('callstack', $data) && null === $data['callstack']) { + $object->setCallstack(null); + } + if (\array_key_exists('error', $data) && null !== $data['error']) { + $object->setError($data['error']); + } elseif (\array_key_exists('error', $data) && null === $data['error']) { + $object->setError(null); + } + if (\array_key_exists('ok', $data) && null !== $data['ok']) { + $object->setOk($data['ok']); + } elseif (\array_key_exists('ok', $data) && null === $data['ok']) { + $object->setOk(null); + } + + return $object; + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + if ($object->isInitialized('callstack') && null !== $object->getCallstack()) { + $data['callstack'] = $object->getCallstack(); + } + $data['error'] = $object->getError(); + $data['ok'] = $object->getOk(); + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class => false]; + } + } +} diff --git a/generated/Normalizer/JaneObjectNormalizer.php b/generated/Normalizer/JaneObjectNormalizer.php index ce25856a..87b65e05 100644 --- a/generated/Normalizer/JaneObjectNormalizer.php +++ b/generated/Normalizer/JaneObjectNormalizer.php @@ -611,10 +611,20 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface \JoliCode\Slack\Api\Model\FilesCommentsDeletePostResponsedefault::class => FilesCommentsDeletePostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class => FilesCompleteUploadExternalPostResponse200Normalizer::class, + + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class => FilesCompleteUploadExternalPostResponse200FilesItemNormalizer::class, + + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class => FilesCompleteUploadExternalPostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesDeletePostResponse200::class => FilesDeletePostResponse200Normalizer::class, \JoliCode\Slack\Api\Model\FilesDeletePostResponsedefault::class => FilesDeletePostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class => FilesGetUploadURLExternalPostResponse200Normalizer::class, + + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class => FilesGetUploadURLExternalPostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesInfoGetResponse200::class => FilesInfoGetResponse200Normalizer::class, \JoliCode\Slack\Api\Model\FilesInfoGetResponsedefault::class => FilesInfoGetResponsedefaultNormalizer::class, @@ -1248,8 +1258,13 @@ public function getSupportedTypes(?string $format = null): array \JoliCode\Slack\Api\Model\EmojiListGetResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesCommentsDeletePostResponse200::class => false, \JoliCode\Slack\Api\Model\FilesCommentsDeletePostResponsedefault::class => false, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class => false, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class => false, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesDeletePostResponse200::class => false, \JoliCode\Slack\Api\Model\FilesDeletePostResponsedefault::class => false, + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class => false, + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesInfoGetResponse200::class => false, \JoliCode\Slack\Api\Model\FilesInfoGetResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesListGetResponse200::class => false, @@ -2012,10 +2027,20 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface \JoliCode\Slack\Api\Model\FilesCommentsDeletePostResponsedefault::class => FilesCommentsDeletePostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class => FilesCompleteUploadExternalPostResponse200Normalizer::class, + + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class => FilesCompleteUploadExternalPostResponse200FilesItemNormalizer::class, + + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class => FilesCompleteUploadExternalPostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesDeletePostResponse200::class => FilesDeletePostResponse200Normalizer::class, \JoliCode\Slack\Api\Model\FilesDeletePostResponsedefault::class => FilesDeletePostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class => FilesGetUploadURLExternalPostResponse200Normalizer::class, + + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class => FilesGetUploadURLExternalPostResponsedefaultNormalizer::class, + \JoliCode\Slack\Api\Model\FilesInfoGetResponse200::class => FilesInfoGetResponse200Normalizer::class, \JoliCode\Slack\Api\Model\FilesInfoGetResponsedefault::class => FilesInfoGetResponsedefaultNormalizer::class, @@ -2652,8 +2677,13 @@ public function getSupportedTypes(?string $format = null): array \JoliCode\Slack\Api\Model\EmojiListGetResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesCommentsDeletePostResponse200::class => false, \JoliCode\Slack\Api\Model\FilesCommentsDeletePostResponsedefault::class => false, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200::class => false, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200FilesItem::class => false, + \JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesDeletePostResponse200::class => false, \JoliCode\Slack\Api\Model\FilesDeletePostResponsedefault::class => false, + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200::class => false, + \JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesInfoGetResponse200::class => false, \JoliCode\Slack\Api\Model\FilesInfoGetResponsedefault::class => false, \JoliCode\Slack\Api\Model\FilesListGetResponse200::class => false, diff --git a/resources/slack-openapi-patched.json b/resources/slack-openapi-patched.json index 4ad29224..bf681888 100644 --- a/resources/slack-openapi-patched.json +++ b/resources/slack-openapi-patched.json @@ -16828,6 +16828,198 @@ ] } }, + "/files.completeUploadExternal": { + "post": { + "consumes": [ + "application/json", + "application/x-www-form-urlencoded" + ], + "description": "Finishes an upload started with files.getUploadURLExternal", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/files.completeUploadExternal" + }, + "operationId": "files_complete_upload_external", + "parameters": [ + { + "description": "A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored.", + "example": "[{\"type\": \"section\", \"text\": {\"type\": \"plain_text\", \"text\": \"Hello world\"}}]", + "in": "query", + "name": "blocks", + "required": false, + "type": "string" + }, + { + "description": "Channel ID where the file will be shared. If not specified, the file will remain private.", + "example": "C0NF841BK", + "in": "query", + "name": "channel_id", + "required": false, + "type": "string" + }, + { + "description": "Comma-separated list of channel IDs where the file will be shared.", + "example": "C0NF841BK,C2AW648GH", + "in": "query", + "name": "channels", + "required": false, + "type": "string" + }, + { + "description": "An array of file objects, each containing the `id` of the file to be completed.", + "in": "query", + "name": "files", + "required": true, + "type": "string" + }, + { + "description": "The message text introducing the file in specified channels.", + "in": "query", + "name": "initial_comment", + "required": false, + "type": "string" + }, + { + "description": "Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. Also, make sure to provide only one channel when using `thread_ts`.", + "example": "1524523204.000192", + "in": "query", + "name": "thread_ts", + "required": false, + "type": "string" + }, + { + "description": "Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.", + "in": "formData", + "name": "token", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Typical success response", + "examples": { + "application/json": { + "files": [ + { + "id": "F123ABC456", + "title": "slack-test" + } + ], + "ok": true + } + }, + "schema": { + "additionalProperties": false, + "description": "Schema for successful response files.completeUploadExternal method", + "properties": { + "files": { + "items": { + "properties": { + "id": { + "$ref": "#/definitions/defs_file_id" + }, + "title": { + "example": "slack-test", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "ok": { + "$ref": "#/definitions/defs_ok_true" + } + }, + "required": [ + "files", + "ok" + ], + "title": "files.completeUploadExternal schema", + "type": "object" + } + }, + "default": { + "description": "Typical error response", + "examples": { + "application/json": { + "error": "invalid_auth", + "ok": false + } + }, + "schema": { + "additionalProperties": false, + "description": "Schema for error response files.completeUploadExternal method", + "properties": { + "callstack": { + "description": "Note: PHP callstack is only visible in dev/qa", + "type": "string" + }, + "error": { + "enum": [ + "access_denied", + "accesslimited", + "account_inactive", + "channel_not_found", + "channels_limit_exceeded", + "deprecated_endpoint", + "ekm_access_denied", + "enterprise_is_restricted", + "fatal_error", + "file_not_found", + "file_update_failed", + "invalid_array_arg", + "invalid_auth", + "invalid_blocks", + "invalid_channel", + "invalid_charset", + "invalid_form_data", + "invalid_post_type", + "method_deprecated", + "missing_post_type", + "missing_scope", + "no_permission", + "not_allowed_token_type", + "not_authed", + "not_in_channel", + "posting_to_channel_denied", + "ratelimited", + "request_timeout", + "service_unavailable", + "team_access_not_granted", + "team_added_to_org", + "two_factor_setup_required" + ], + "type": "string" + }, + "ok": { + "$ref": "#/definitions/defs_ok_false" + } + }, + "required": [ + "error", + "ok" + ], + "title": "files.completeUploadExternal error schema", + "type": "object" + } + } + }, + "security": [ + { + "slackAuth": [ + "files:write:user" + ] + } + ], + "tags": [ + "files" + ] + } + }, "/files.delete": { "post": { "consumes": [ @@ -16944,6 +17136,156 @@ ] } }, + "/files.getUploadURLExternal": { + "post": { + "consumes": [ + "application/x-www-form-urlencoded" + ], + "description": "Gets a URL for an edge external file upload", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/files.getUploadURLExternal" + }, + "operationId": "files_get_upload_url_external", + "parameters": [ + { + "description": "Description of image for screen-reader.", + "in": "query", + "name": "alt_txt", + "required": false, + "type": "string" + }, + { + "description": "Name of the file being uploaded.", + "in": "query", + "name": "filename", + "required": true, + "type": "string" + }, + { + "description": "Size in bytes of the file being uploaded.", + "in": "query", + "name": "length", + "required": true, + "type": "integer" + }, + { + "description": "Syntax type of the snippet being uploaded.", + "in": "query", + "name": "snippet_type", + "required": false, + "type": "string" + }, + { + "description": "Authentication token. Requires scope: `files:write`", + "in": "formData", + "name": "token", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Typical success response", + "examples": { + "application/json": { + "file_id": "F123ABC456", + "ok": true, + "upload_url": "https://files.slack.com/upload/v1/ABC123..." + } + }, + "schema": { + "additionalProperties": false, + "description": "Schema for successful response files.getUploadURLExternal method", + "properties": { + "file_id": { + "$ref": "#/definitions/defs_file_id" + }, + "ok": { + "$ref": "#/definitions/defs_ok_true" + }, + "upload_url": { + "description": "URL where the file should be uploaded.", + "example": "https://files.slack.com/upload/v1/ABC123...", + "pattern": "^https://files\\.slack\\.com/upload/v1/[A-Z0-9]+$", + "type": "string" + } + }, + "required": [ + "file_id", + "ok", + "upload_url" + ], + "title": "files.getUploadURLExternal schema", + "type": "object" + } + }, + "default": { + "description": "Typical error response", + "examples": { + "application/json": { + "error": "invalid_auth", + "ok": false + } + }, + "schema": { + "additionalProperties": false, + "description": "Schema for error response files.getUploadURLExternal method", + "properties": { + "callstack": { + "description": "Note: PHP callstack is only visible in dev/qa", + "type": "string" + }, + "error": { + "enum": [ + "account_inactive", + "cant_delete_file", + "file_deleted", + "file_not_found", + "invalid_arg_name", + "invalid_array_arg", + "invalid_auth", + "invalid_charset", + "invalid_form_data", + "invalid_json", + "invalid_post_type", + "json_not_object", + "missing_post_type", + "no_permission", + "not_authed", + "request_timeout", + "team_added_to_org", + "upgrade_required" + ], + "type": "string" + }, + "ok": { + "$ref": "#/definitions/defs_ok_false" + } + }, + "required": [ + "error", + "ok" + ], + "title": "files.getUploadURLExternal error schema", + "type": "object" + } + } + }, + "security": [ + { + "slackAuth": [ + "files:write:user" + ] + } + ], + "tags": [ + "files" + ] + } + }, "/files.info": { "get": { "consumes": [ @@ -26938,4 +27280,4 @@ }, "swagger": "2.0", "tags": [] -} +} \ No newline at end of file diff --git a/resources/slack-openapi-sorted.json b/resources/slack-openapi-sorted.json index 9adbe589..bb02bb95 100644 --- a/resources/slack-openapi-sorted.json +++ b/resources/slack-openapi-sorted.json @@ -2418,6 +2418,12 @@ }, "operationId": "admin_apps_approved_list", "parameters": [ + { + "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", + "in": "query", + "name": "limit", + "type": "integer" + }, { "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", "in": "query", @@ -2429,12 +2435,6 @@ "name": "enterprise_id", "type": "string" }, - { - "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", - "in": "query", - "name": "limit", - "type": "integer" - }, { "in": "query", "name": "team_id", @@ -2568,18 +2568,18 @@ }, "operationId": "admin_apps_requests_list", "parameters": [ - { - "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", - "in": "query", - "name": "cursor", - "type": "string" - }, { "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", "in": "query", "name": "limit", "type": "integer" }, + { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", + "in": "query", + "name": "cursor", + "type": "string" + }, { "in": "query", "name": "team_id", @@ -2824,6 +2824,12 @@ }, "operationId": "admin_apps_restricted_list", "parameters": [ + { + "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", + "in": "query", + "name": "limit", + "type": "integer" + }, { "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", "in": "query", @@ -2835,12 +2841,6 @@ "name": "enterprise_id", "type": "string" }, - { - "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", - "in": "query", - "name": "limit", - "type": "integer" - }, { "in": "query", "name": "team_id", @@ -4168,16 +4168,16 @@ "type": "string" }, { - "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to be an allowlist for the private channel.", + "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", "in": "formData", - "name": "group_id", - "required": true, + "name": "team_id", "type": "string" }, { - "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", + "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to be an allowlist for the private channel.", "in": "formData", - "name": "team_id", + "name": "group_id", + "required": true, "type": "string" }, { @@ -4369,16 +4369,16 @@ "type": "string" }, { - "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to remove from the private channel.", + "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", "in": "formData", - "name": "group_id", + "name": "team_id", "required": true, "type": "string" }, { - "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", + "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to remove from the private channel.", "in": "formData", - "name": "team_id", + "name": "group_id", "required": true, "type": "string" }, @@ -5076,16 +5076,16 @@ "operationId": "admin_emoji_addAlias", "parameters": [ { - "description": "The alias of the emoji.", + "description": "The name of the emoji to be aliased. Colons (`:myemoji:`) around the value are not required, although they may be included.", "in": "formData", - "name": "alias_for", + "name": "name", "required": true, "type": "string" }, { - "description": "The name of the emoji to be aliased. Colons (`:myemoji:`) around the value are not required, although they may be included.", + "description": "The alias of the emoji.", "in": "formData", - "name": "name", + "name": "alias_for", "required": true, "type": "string" }, @@ -5488,16 +5488,16 @@ "operationId": "admin_inviteRequests_approve", "parameters": [ { - "description": "ID of the request to invite.", + "description": "ID for the workspace where the invite request was made.", "in": "formData", - "name": "invite_request_id", - "required": true, + "name": "team_id", "type": "string" }, { - "description": "ID for the workspace where the invite request was made.", + "description": "ID of the request to invite.", "in": "formData", - "name": "team_id", + "name": "invite_request_id", + "required": true, "type": "string" }, { @@ -5584,6 +5584,12 @@ }, "operationId": "admin_inviteRequests_approved_list", "parameters": [ + { + "description": "ID for the workspace where the invite requests were made.", + "in": "query", + "name": "team_id", + "type": "string" + }, { "description": "Value of the `next_cursor` field sent as part of the previous API response", "in": "query", @@ -5596,12 +5602,6 @@ "name": "limit", "type": "integer" }, - { - "description": "ID for the workspace where the invite requests were made.", - "in": "query", - "name": "team_id", - "type": "string" - }, { "description": "Authentication token. Requires scope: `admin.invites:read`", "in": "header", @@ -5686,6 +5686,12 @@ }, "operationId": "admin_inviteRequests_denied_list", "parameters": [ + { + "description": "ID for the workspace where the invite requests were made.", + "in": "query", + "name": "team_id", + "type": "string" + }, { "description": "Value of the `next_cursor` field sent as part of the previous api response", "in": "query", @@ -5698,12 +5704,6 @@ "name": "limit", "type": "integer" }, - { - "description": "ID for the workspace where the invite requests were made.", - "in": "query", - "name": "team_id", - "type": "string" - }, { "description": "Authentication token. Requires scope: `admin.invites:read`", "in": "header", @@ -5789,16 +5789,16 @@ "operationId": "admin_inviteRequests_deny", "parameters": [ { - "description": "ID of the request to invite.", + "description": "ID for the workspace where the invite request was made.", "in": "formData", - "name": "invite_request_id", - "required": true, + "name": "team_id", "type": "string" }, { - "description": "ID for the workspace where the invite request was made.", + "description": "ID of the request to invite.", "in": "formData", - "name": "team_id", + "name": "invite_request_id", + "required": true, "type": "string" }, { @@ -5885,6 +5885,12 @@ }, "operationId": "admin_inviteRequests_list", "parameters": [ + { + "description": "ID for the workspace where the invite requests were made.", + "in": "query", + "name": "team_id", + "type": "string" + }, { "description": "Value of the `next_cursor` field sent as part of the previous API response", "in": "query", @@ -5897,12 +5903,6 @@ "name": "limit", "type": "integer" }, - { - "description": "ID for the workspace where the invite requests were made.", - "in": "query", - "name": "team_id", - "type": "string" - }, { "description": "Authentication token. Requires scope: `admin.invites:read`", "in": "header", @@ -5986,18 +5986,18 @@ }, "operationId": "admin_teams_admins_list", "parameters": [ - { - "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", - "in": "query", - "name": "cursor", - "type": "string" - }, { "description": "The maximum number of items to return.", "in": "query", "name": "limit", "type": "integer" }, + { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", + "in": "query", + "name": "cursor", + "type": "string" + }, { "in": "query", "name": "team_id", @@ -6202,18 +6202,18 @@ }, "operationId": "admin_teams_list", "parameters": [ - { - "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", - "in": "query", - "name": "cursor", - "type": "string" - }, { "description": "The maximum number of items to return. Must be between 1 - 100 both inclusive.", "in": "query", "name": "limit", "type": "integer" }, + { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", + "in": "query", + "name": "cursor", + "type": "string" + }, { "description": "Authentication token. Requires scope: `admin.teams:read`", "in": "header", @@ -6315,18 +6315,18 @@ "name": "cursor", "type": "string" }, - { - "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", - "in": "query", - "name": "limit", - "type": "integer" - }, { "in": "query", "name": "team_id", "required": true, "type": "string" }, + { + "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", + "in": "query", + "name": "limit", + "type": "integer" + }, { "description": "Authentication token. Requires scope: `admin.teams:read`", "in": "query", @@ -6514,16 +6514,16 @@ "operationId": "admin_teams_settings_setDefaultChannels", "parameters": [ { - "description": "An array of channel IDs.", + "description": "ID for the workspace to set the default channel for.", "in": "formData", - "name": "channel_ids", + "name": "team_id", "required": true, "type": "string" }, { - "description": "ID for the workspace to set the default channel for.", + "description": "An array of channel IDs.", "in": "formData", - "name": "team_id", + "name": "channel_ids", "required": true, "type": "string" }, @@ -6612,16 +6612,16 @@ "operationId": "admin_teams_settings_setDescription", "parameters": [ { - "description": "The new description for the workspace.", + "description": "ID for the workspace to set the description for.", "in": "formData", - "name": "description", + "name": "team_id", "required": true, "type": "string" }, { - "description": "ID for the workspace to set the description for.", + "description": "The new description for the workspace.", "in": "formData", - "name": "team_id", + "name": "description", "required": true, "type": "string" }, @@ -6710,16 +6710,16 @@ "operationId": "admin_teams_settings_setDiscoverability", "parameters": [ { - "description": "This workspace's discovery setting. It must be set to one of `open`, `invite_only`, `closed`, or `unlisted`.", + "description": "The ID of the workspace to set discoverability on.", "in": "formData", - "name": "discoverability", + "name": "team_id", "required": true, "type": "string" }, { - "description": "The ID of the workspace to set discoverability on.", + "description": "This workspace's discovery setting. It must be set to one of `open`, `invite_only`, `closed`, or `unlisted`.", "in": "formData", - "name": "team_id", + "name": "discoverability", "required": true, "type": "string" }, @@ -6905,16 +6905,16 @@ "operationId": "admin_teams_settings_setName", "parameters": [ { - "description": "The new name of the workspace.", + "description": "ID for the workspace to set the name for.", "in": "formData", - "name": "name", + "name": "team_id", "required": true, "type": "string" }, { - "description": "ID for the workspace to set the name for.", + "description": "The new name of the workspace.", "in": "formData", - "name": "team_id", + "name": "name", "required": true, "type": "string" }, @@ -7693,6 +7693,13 @@ }, "operationId": "admin_users_list", "parameters": [ + { + "description": "The ID (`T1234`) of the workspace.", + "in": "query", + "name": "team_id", + "required": true, + "type": "string" + }, { "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", "in": "query", @@ -7705,13 +7712,6 @@ "name": "limit", "type": "integer" }, - { - "description": "The ID (`T1234`) of the workspace.", - "in": "query", - "name": "team_id", - "required": true, - "type": "string" - }, { "description": "Authentication token. Requires scope: `admin.users:read`", "in": "header", @@ -7907,17 +7907,17 @@ "operationId": "admin_users_session_invalidate", "parameters": [ { + "description": "ID of the team that the session belongs to", "in": "formData", - "name": "session_id", + "name": "team_id", "required": true, - "type": "integer" + "type": "string" }, { - "description": "ID of the team that the session belongs to", "in": "formData", - "name": "team_id", + "name": "session_id", "required": true, - "type": "string" + "type": "integer" }, { "description": "Authentication token. Requires scope: `admin.users:write`", @@ -8606,13 +8606,13 @@ "parameters": [ { "in": "query", - "name": "cursor", + "name": "event_context", + "required": true, "type": "string" }, { "in": "query", - "name": "event_context", - "required": true, + "name": "cursor", "type": "string" }, { @@ -10353,12 +10353,6 @@ }, "operationId": "calls_end", "parameters": [ - { - "description": "Call duration in seconds", - "in": "formData", - "name": "duration", - "type": "integer" - }, { "description": "`id` returned when registering the call using the [`calls.add`](/methods/calls.add) method.", "in": "formData", @@ -10366,6 +10360,12 @@ "required": true, "type": "string" }, + { + "description": "Call duration in seconds", + "in": "formData", + "name": "duration", + "type": "integer" + }, { "description": "Authentication token. Requires scope: `calls:write`", "in": "header", @@ -12921,18 +12921,18 @@ }, "operationId": "conversations_create", "parameters": [ - { - "description": "Create a private channel instead of a public one", - "in": "formData", - "name": "is_private", - "type": "boolean" - }, { "description": "Name of the public or private channel to create", "in": "formData", "name": "name", "type": "string" }, + { + "description": "Create a private channel instead of a public one", + "in": "formData", + "name": "is_private", + "type": "boolean" + }, { "description": "Authentication token. Requires scope: `conversations:write`", "in": "header", @@ -17480,15 +17480,15 @@ "operationId": "files_remote_info", "parameters": [ { - "description": "Creator defined GUID for the file.", + "description": "Specify a file by providing its ID.", "in": "query", - "name": "external_id", + "name": "file", "type": "string" }, { - "description": "Specify a file by providing its ID.", + "description": "Creator defined GUID for the file.", "in": "query", - "name": "file", + "name": "external_id", "type": "string" }, { @@ -17686,15 +17686,15 @@ "operationId": "files_remote_remove", "parameters": [ { - "description": "Creator defined GUID for the file.", + "description": "Specify a file by providing its ID.", "in": "formData", - "name": "external_id", + "name": "file", "type": "string" }, { - "description": "Specify a file by providing its ID.", + "description": "Creator defined GUID for the file.", "in": "formData", - "name": "file", + "name": "external_id", "type": "string" }, { @@ -17786,15 +17786,15 @@ "type": "string" }, { - "description": "The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required.", + "description": "Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required.", "in": "query", - "name": "external_id", + "name": "file", "type": "string" }, { - "description": "Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required.", + "description": "The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required.", "in": "query", - "name": "file", + "name": "external_id", "type": "string" }, { @@ -24788,6 +24788,12 @@ }, "operationId": "users_list", "parameters": [ + { + "description": "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors.", + "in": "query", + "name": "limit", + "type": "integer" + }, { "description": "Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first \"page\" of the collection. See [pagination](/docs/pagination) for more detail.", "in": "query", @@ -24800,12 +24806,6 @@ "name": "include_locale", "type": "boolean" }, - { - "description": "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors.", - "in": "query", - "name": "limit", - "type": "integer" - }, { "description": "Authentication token. Requires scope: `users:read`", "in": "query", @@ -26892,4 +26892,4 @@ }, "swagger": "2.0", "tags": [] -} +} \ No newline at end of file diff --git a/resources/slack-openapi-sorted.patch b/resources/slack-openapi-sorted.patch index 9e3ceaab..266a307e 100644 --- a/resources/slack-openapi-sorted.patch +++ b/resources/slack-openapi-sorted.patch @@ -1,5 +1,5 @@ ---- resources/slack-openapi-sorted.json 2023-11-10 10:07:30 -+++ resources/slack-openapi-patched.json 2023-11-10 10:07:30 +--- resources/slack-openapi-sorted.json 2025-03-31 00:40:42.690653795 +0200 ++++ resources/slack-openapi-patched.json 2025-03-31 01:49:19.070638651 +0200 @@ -397,21 +397,24 @@ }, "type": "array" @@ -48,8 +48,7 @@ "is_open": { "type": "boolean" }, -@@ -559,20 +563,23 @@ - }, +@@ -560,20 +564,23 @@ "latest": { "items": [ { @@ -59,10 +58,10 @@ "type": "null" } ] -+ }, + }, + "locale": { + "type": "string" - }, ++ }, "members": { "items": { "$ref": "#/definitions/defs_user_id" @@ -72,6 +71,7 @@ "uniqueItems": true }, "name": { + "type": "string" @@ -822,20 +829,24 @@ }, "comments_count": { @@ -368,9 +368,7 @@ "$ref": "#/definitions/defs_user_id" }, "permalink": { -@@ -1287,20 +1417,37 @@ - "username": { - "type": "string" +@@ -1289,20 +1419,37 @@ } }, "required": [ @@ -379,8 +377,8 @@ "type" ], "title": "Message object", -+ "type": "object" -+ }, + "type": "object" + }, + "objs_metadata": { + "additionalProperties": false, + "properties": { @@ -396,8 +394,8 @@ + "event_type" + ], + "title": "Metadata object", - "type": "object" - }, ++ "type": "object" ++ }, "objs_paging": { "additionalProperties": false, "properties": { @@ -406,6 +404,8 @@ }, "page": { "type": "integer" + }, + "pages": { @@ -1431,91 +1578,46 @@ "type": "boolean" } @@ -462,7 +462,9 @@ - ], - "title": "deprecation_warning", - "type": "object" -- }, ++ "next_cursor": { ++ "type": "string" + }, - { - "additionalProperties": false, - "properties": { @@ -484,9 +486,6 @@ - }, - "type": "array" - } -+ "next_cursor": { -+ "type": "string" -+ }, + "warnings": { + "items": { + "enum": [ @@ -602,9 +601,40 @@ "200": { "description": "Typical success response", "examples": { -@@ -2437,21 +2524,20 @@ +@@ -2412,46 +2499,45 @@ + "application/x-www-form-urlencoded" + ], + "description": "List approved apps for an org or workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.apps.approved.list" + }, + "operationId": "admin_apps_approved_list", + "parameters": [ + { +- "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", +- "in": "query", +- "name": "limit", +- "type": "integer" +- }, +- { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", + "in": "query", + "name": "cursor", + "type": "string" }, { + "in": "query", + "name": "enterprise_id", + "type": "string" + }, + { ++ "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", ++ "in": "query", ++ "name": "limit", ++ "type": "integer" ++ }, ++ { "in": "query", "name": "team_id", "type": "string" @@ -624,9 +654,35 @@ "200": { "description": "Typical success response", "examples": { -@@ -2582,21 +2668,20 @@ +@@ -2562,41 +2648,40 @@ + "application/x-www-form-urlencoded" + ], + "description": "List app requests for a team/workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.apps.requests.list" + }, + "operationId": "admin_apps_requests_list", + "parameters": [ + { +- "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", +- "in": "query", +- "name": "limit", +- "type": "integer" +- }, +- { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", + "in": "query", + "name": "cursor", + "type": "string" }, { ++ "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", ++ "in": "query", ++ "name": "limit", ++ "type": "integer" ++ }, ++ { "in": "query", "name": "team_id", "type": "string" @@ -668,9 +724,40 @@ "200": { "description": "Typical success response", "examples": { -@@ -2843,21 +2927,20 @@ +@@ -2818,46 +2902,45 @@ + "application/x-www-form-urlencoded" + ], + "description": "List restricted apps for an org or workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.apps.restricted.list" + }, + "operationId": "admin_apps_restricted_list", + "parameters": [ + { +- "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", +- "in": "query", +- "name": "limit", +- "type": "integer" +- }, +- { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page", + "in": "query", + "name": "cursor", + "type": "string" }, { + "in": "query", + "name": "enterprise_id", + "type": "string" + }, + { ++ "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", ++ "in": "query", ++ "name": "limit", ++ "type": "integer" ++ }, ++ { "in": "query", "name": "team_id", "type": "string" @@ -910,11 +997,32 @@ "200": { "description": "Typical success response", "examples": { -@@ -4177,21 +4250,20 @@ +@@ -4161,37 +4234,36 @@ + "operationId": "admin_conversations_restrictAccess_addGroup", + "parameters": [ { - "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", + "description": "The channel to link this group to.", "in": "formData", - "name": "team_id", + "name": "channel_id", + "required": true, + "type": "string" + }, + { +- "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", ++ "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to be an allowlist for the private channel.", + "in": "formData", +- "name": "team_id", ++ "name": "group_id", ++ "required": true, + "type": "string" + }, + { +- "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to be an allowlist for the private channel.", ++ "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", + "in": "formData", +- "name": "group_id", +- "required": true, ++ "name": "team_id", "type": "string" }, { @@ -954,10 +1062,31 @@ "200": { "description": "Typical success response", "examples": { -@@ -4379,21 +4450,20 @@ - "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", +@@ -4362,38 +4433,37 @@ + "operationId": "admin_conversations_restrictAccess_removeGroup", + "parameters": [ + { + "description": "The channel to remove the linked group from.", "in": "formData", - "name": "team_id", + "name": "channel_id", + "required": true, + "type": "string" + }, + { +- "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", ++ "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to remove from the private channel.", + "in": "formData", +- "name": "team_id", ++ "name": "group_id", + "required": true, + "type": "string" + }, + { +- "description": "The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to remove from the private channel.", ++ "description": "The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.", + "in": "formData", +- "name": "group_id", ++ "name": "team_id", "required": true, "type": "string" }, @@ -1086,10 +1215,31 @@ "type": "string" } ], -@@ -5086,21 +5151,20 @@ - "description": "The name of the emoji to be aliased. Colons (`:myemoji:`) around the value are not required, although they may be included.", +@@ -5069,38 +5134,37 @@ + "application/x-www-form-urlencoded" + ], + "description": "Add an emoji alias.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.emoji.addAlias" + }, + "operationId": "admin_emoji_addAlias", + "parameters": [ + { +- "description": "The name of the emoji to be aliased. Colons (`:myemoji:`) around the value are not required, although they may be included.", ++ "description": "The alias of the emoji.", "in": "formData", - "name": "name", +- "name": "name", ++ "name": "alias_for", + "required": true, + "type": "string" + }, + { +- "description": "The alias of the emoji.", ++ "description": "The name of the emoji to be aliased. Colons (`:myemoji:`) around the value are not required, although they may be included.", + "in": "formData", +- "name": "alias_for", ++ "name": "name", "required": true, "type": "string" }, @@ -1174,11 +1324,32 @@ "200": { "description": "Typical success response", "examples": { -@@ -5497,21 +5558,20 @@ +@@ -5481,37 +5542,36 @@ + "application/x-www-form-urlencoded" + ], + "description": "Approve a workspace invite request.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.inviteRequests.approve" + }, + "operationId": "admin_inviteRequests_approve", + "parameters": [ { - "description": "ID for the workspace where the invite request was made.", +- "description": "ID for the workspace where the invite request was made.", ++ "description": "ID of the request to invite.", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "invite_request_id", ++ "required": true, + "type": "string" + }, + { +- "description": "ID of the request to invite.", ++ "description": "ID for the workspace where the invite request was made.", + "in": "formData", +- "name": "invite_request_id", +- "required": true, ++ "name": "team_id", "type": "string" }, { @@ -1196,14 +1367,41 @@ "200": { "description": "Typical success response", "examples": { -@@ -5599,21 +5659,20 @@ +@@ -5578,42 +5638,41 @@ + "application/x-www-form-urlencoded" + ], + "description": "List all approved workspace invite requests.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.inviteRequests.approved.list" + }, + "operationId": "admin_inviteRequests_approved_list", + "parameters": [ { - "description": "ID for the workspace where the invite requests were made.", +- "description": "ID for the workspace where the invite requests were made.", +- "in": "query", +- "name": "team_id", +- "type": "string" +- }, +- { + "description": "Value of the `next_cursor` field sent as part of the previous API response", "in": "query", - "name": "team_id", + "name": "cursor", "type": "string" }, { + "description": "The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive", + "in": "query", + "name": "limit", + "type": "integer" + }, + { ++ "description": "ID for the workspace where the invite requests were made.", ++ "in": "query", ++ "name": "team_id", ++ "type": "string" ++ }, ++ { "description": "Authentication token. Requires scope: `admin.invites:read`", "in": "header", "name": "token", @@ -1218,14 +1416,41 @@ "200": { "description": "Typical success response", "examples": { -@@ -5701,21 +5760,20 @@ +@@ -5680,42 +5739,41 @@ + "application/x-www-form-urlencoded" + ], + "description": "List all denied workspace invite requests.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.inviteRequests.denied.list" + }, + "operationId": "admin_inviteRequests_denied_list", + "parameters": [ { - "description": "ID for the workspace where the invite requests were made.", +- "description": "ID for the workspace where the invite requests were made.", +- "in": "query", +- "name": "team_id", +- "type": "string" +- }, +- { + "description": "Value of the `next_cursor` field sent as part of the previous api response", "in": "query", - "name": "team_id", + "name": "cursor", "type": "string" }, { + "description": "The number of results that will be returned by the API on each invocation. Must be between 1 - 1000 both inclusive", + "in": "query", + "name": "limit", + "type": "integer" + }, + { ++ "description": "ID for the workspace where the invite requests were made.", ++ "in": "query", ++ "name": "team_id", ++ "type": "string" ++ }, ++ { "description": "Authentication token. Requires scope: `admin.invites:read`", "in": "header", "name": "token", @@ -1240,11 +1465,32 @@ "200": { "description": "Typical success response", "examples": { -@@ -5798,21 +5856,20 @@ +@@ -5782,37 +5840,36 @@ + "application/x-www-form-urlencoded" + ], + "description": "Deny a workspace invite request.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.inviteRequests.deny" + }, + "operationId": "admin_inviteRequests_deny", + "parameters": [ { - "description": "ID for the workspace where the invite request was made.", +- "description": "ID for the workspace where the invite request was made.", ++ "description": "ID of the request to invite.", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "invite_request_id", ++ "required": true, + "type": "string" + }, + { +- "description": "ID of the request to invite.", ++ "description": "ID for the workspace where the invite request was made.", + "in": "formData", +- "name": "invite_request_id", +- "required": true, ++ "name": "team_id", "type": "string" }, { @@ -1262,14 +1508,41 @@ "200": { "description": "Typical success response", "examples": { -@@ -5900,21 +5957,20 @@ +@@ -5879,42 +5936,41 @@ + "application/x-www-form-urlencoded" + ], + "description": "List all pending workspace invite requests.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.inviteRequests.list" + }, + "operationId": "admin_inviteRequests_list", + "parameters": [ { - "description": "ID for the workspace where the invite requests were made.", +- "description": "ID for the workspace where the invite requests were made.", +- "in": "query", +- "name": "team_id", +- "type": "string" +- }, +- { + "description": "Value of the `next_cursor` field sent as part of the previous API response", "in": "query", - "name": "team_id", + "name": "cursor", "type": "string" }, { + "description": "The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive", + "in": "query", + "name": "limit", + "type": "integer" + }, + { ++ "description": "ID for the workspace where the invite requests were made.", ++ "in": "query", ++ "name": "team_id", ++ "type": "string" ++ }, ++ { "description": "Authentication token. Requires scope: `admin.invites:read`", "in": "header", "name": "token", @@ -1284,8 +1557,35 @@ "200": { "description": "Typical success response", "examples": { -@@ -6001,21 +6057,20 @@ +@@ -5980,42 +6036,41 @@ + "application/x-www-form-urlencoded" + ], + "description": "List all of the admins on a given workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.teams.admins.list" + }, + "operationId": "admin_teams_admins_list", + "parameters": [ { +- "description": "The maximum number of items to return.", +- "in": "query", +- "name": "limit", +- "type": "integer" +- }, +- { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", + "in": "query", + "name": "cursor", + "type": "string" + }, + { ++ "description": "The maximum number of items to return.", ++ "in": "query", ++ "name": "limit", ++ "type": "integer" ++ }, ++ { "in": "query", "name": "team_id", "required": true, @@ -1328,14 +1628,35 @@ "200": { "description": "Typical success response", "examples": { -@@ -6211,21 +6265,20 @@ +@@ -6196,36 +6250,35 @@ + "application/x-www-form-urlencoded" + ], + "description": "List all teams on an Enterprise organization", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.teams.list" + }, + "operationId": "admin_teams_list", + "parameters": [ { - "description": "The maximum number of items to return. Must be between 1 - 100 both inclusive.", +- "description": "The maximum number of items to return. Must be between 1 - 100 both inclusive.", +- "in": "query", +- "name": "limit", +- "type": "integer" +- }, +- { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", "in": "query", - "name": "limit", - "type": "integer" + "name": "cursor", + "type": "string" }, { ++ "description": "The maximum number of items to return. Must be between 1 - 100 both inclusive.", ++ "in": "query", ++ "name": "limit", ++ "type": "integer" ++ }, ++ { "description": "Authentication token. Requires scope: `admin.teams:read`", "in": "header", "name": "token", @@ -1350,14 +1671,35 @@ "200": { "description": "Typical success response", "examples": { -@@ -6324,21 +6377,20 @@ +@@ -6309,36 +6362,35 @@ + }, + "operationId": "admin_teams_owners_list", + "parameters": [ { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", "in": "query", - "name": "team_id", - "required": true, + "name": "cursor", "type": "string" }, { +- "in": "query", +- "name": "team_id", +- "required": true, +- "type": "string" +- }, +- { + "description": "The maximum number of items to return. Must be between 1 - 1000 both inclusive.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { ++ "in": "query", ++ "name": "team_id", ++ "required": true, ++ "type": "string" ++ }, ++ { "description": "Authentication token. Requires scope: `admin.teams:read`", "in": "query", "name": "token", @@ -1394,10 +1736,31 @@ "200": { "description": "Typical success response", "examples": { -@@ -6524,21 +6575,20 @@ - "description": "ID for the workspace to set the default channel for.", +@@ -6507,38 +6558,37 @@ + "application/x-www-form-urlencoded" + ], + "description": "Set the default channels of a workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.teams.settings.setDefaultChannels" + }, + "operationId": "admin_teams_settings_setDefaultChannels", + "parameters": [ + { +- "description": "ID for the workspace to set the default channel for.", ++ "description": "An array of channel IDs.", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "channel_ids", + "required": true, + "type": "string" + }, + { +- "description": "An array of channel IDs.", ++ "description": "ID for the workspace to set the default channel for.", + "in": "formData", +- "name": "channel_ids", ++ "name": "team_id", "required": true, "type": "string" }, @@ -1416,10 +1779,31 @@ "200": { "description": "Typical success response", "examples": { -@@ -6622,21 +6672,20 @@ - "description": "ID for the workspace to set the description for.", +@@ -6605,38 +6655,37 @@ + "application/x-www-form-urlencoded" + ], + "description": "Set the description of a given workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.teams.settings.setDescription" + }, + "operationId": "admin_teams_settings_setDescription", + "parameters": [ + { +- "description": "ID for the workspace to set the description for.", ++ "description": "The new description for the workspace.", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "description", + "required": true, + "type": "string" + }, + { +- "description": "The new description for the workspace.", ++ "description": "ID for the workspace to set the description for.", + "in": "formData", +- "name": "description", ++ "name": "team_id", "required": true, "type": "string" }, @@ -1438,10 +1822,31 @@ "200": { "description": "Typical success response", "examples": { -@@ -6720,21 +6769,20 @@ - "description": "The ID of the workspace to set discoverability on.", +@@ -6703,38 +6752,37 @@ + "application/x-www-form-urlencoded" + ], + "description": "An API method that allows admins to set the discoverability of a given workspace", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.teams.settings.setDiscoverability" + }, + "operationId": "admin_teams_settings_setDiscoverability", + "parameters": [ + { +- "description": "The ID of the workspace to set discoverability on.", ++ "description": "This workspace's discovery setting. It must be set to one of `open`, `invite_only`, `closed`, or `unlisted`.", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "discoverability", + "required": true, + "type": "string" + }, + { +- "description": "This workspace's discovery setting. It must be set to one of `open`, `invite_only`, `closed`, or `unlisted`.", ++ "description": "The ID of the workspace to set discoverability on.", + "in": "formData", +- "name": "discoverability", ++ "name": "team_id", "required": true, "type": "string" }, @@ -1482,10 +1887,31 @@ "200": { "description": "Typical success response", "examples": { -@@ -6915,21 +6962,20 @@ - "description": "ID for the workspace to set the name for.", +@@ -6898,38 +6945,37 @@ + "application/x-www-form-urlencoded" + ], + "description": "Set the name of a given workspace.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.teams.settings.setName" + }, + "operationId": "admin_teams_settings_setName", + "parameters": [ + { +- "description": "ID for the workspace to set the name for.", ++ "description": "The new name of the workspace.", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "name", + "required": true, + "type": "string" + }, + { +- "description": "The new name of the workspace.", ++ "description": "ID for the workspace to set the name for.", + "in": "formData", +- "name": "name", ++ "name": "team_id", "required": true, "type": "string" }, @@ -1636,14 +2062,43 @@ "200": { "description": "Typical success response", "examples": { -@@ -7709,21 +7749,20 @@ - "description": "The ID (`T1234`) of the workspace.", +@@ -7687,43 +7727,42 @@ + "application/x-www-form-urlencoded" + ], + "description": "List users on a workspace", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.users.list" + }, + "operationId": "admin_users_list", + "parameters": [ + { +- "description": "The ID (`T1234`) of the workspace.", +- "in": "query", +- "name": "team_id", +- "required": true, +- "type": "string" +- }, +- { + "description": "Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.", "in": "query", - "name": "team_id", - "required": true, + "name": "cursor", "type": "string" }, { + "description": "Limit for how many users to be retrieved per page", + "in": "query", + "name": "limit", + "type": "integer" + }, + { ++ "description": "The ID (`T1234`) of the workspace.", ++ "in": "query", ++ "name": "team_id", ++ "required": true, ++ "type": "string" ++ }, ++ { "description": "Authentication token. Requires scope: `admin.users:read`", "in": "header", "name": "token", @@ -1680,12 +2135,33 @@ "type": "string" } ], -@@ -7916,21 +7954,20 @@ - "description": "ID of the team that the session belongs to", +@@ -7900,37 +7938,36 @@ + "application/x-www-form-urlencoded" + ], + "description": "Invalidate a single session for a user by session_id", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/admin.users.session.invalidate" + }, + "operationId": "admin_users_session_invalidate", + "parameters": [ + { +- "description": "ID of the team that the session belongs to", "in": "formData", - "name": "team_id", +- "name": "team_id", ++ "name": "session_id", "required": true, - "type": "string" +- "type": "string" ++ "type": "integer" + }, + { ++ "description": "ID of the team that the session belongs to", + "in": "formData", +- "name": "session_id", ++ "name": "team_id", + "required": true, +- "type": "integer" ++ "type": "string" }, { "description": "Authentication token. Requires scope: `admin.users:write`", @@ -1860,7 +2336,28 @@ "required": [ "error", "ok" -@@ -8617,21 +8655,20 @@ +@@ -8599,39 +8637,38 @@ + ], + "description": "Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/apps.event.authorizations.list" + }, + "operationId": "apps_event_authorizations_list", + "parameters": [ + { + "in": "query", +- "name": "event_context", +- "required": true, ++ "name": "cursor", + "type": "string" + }, + { + "in": "query", +- "name": "cursor", ++ "name": "event_context", ++ "required": true, + "type": "string" }, { "in": "query", @@ -2080,7 +2577,23 @@ } ], "produces": [ -@@ -10363,21 +10391,20 @@ +@@ -10347,37 +10375,36 @@ + "application/x-www-form-urlencoded" + ], + "description": "Ends a Call.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/calls.end" + }, + "operationId": "calls_end", + "parameters": [ + { ++ "description": "Call duration in seconds", ++ "in": "formData", ++ "name": "duration", ++ "type": "integer" ++ }, ++ { "description": "`id` returned when registering the call using the [`calls.add`](/methods/calls.add) method.", "in": "formData", "name": "id", @@ -2088,6 +2601,12 @@ "type": "string" }, { +- "description": "Call duration in seconds", +- "in": "formData", +- "name": "duration", +- "type": "integer" +- }, +- { "description": "Authentication token. Requires scope: `calls:write`", "in": "header", "name": "token", @@ -2601,6 +3120,45 @@ "type": "string" } ], +@@ -12915,32 +12962,32 @@ + "application/x-www-form-urlencoded" + ], + "description": "Initiates a public or private channel-based conversation", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/conversations.create" + }, + "operationId": "conversations_create", + "parameters": [ + { +- "description": "Name of the public or private channel to create", +- "in": "formData", +- "name": "name", +- "type": "string" +- }, +- { + "description": "Create a private channel instead of a public one", + "in": "formData", + "name": "is_private", + "type": "boolean" + }, + { ++ "description": "Name of the public or private channel to create", ++ "in": "formData", ++ "name": "name", ++ "type": "string" ++ }, ++ { + "description": "Authentication token. Requires scope: `conversations:write`", + "in": "header", + "name": "token", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { @@ -13109,42 +13156,48 @@ "name": "channel", "type": "string" @@ -2927,7 +3485,391 @@ "200": { "description": "Typical success response", "examples": { -@@ -17126,27 +17204,27 @@ +@@ -16743,20 +16821,212 @@ + "files:write:user" + ] + } + ], + "tags": [ + "files", + "files.comments" + ] + } + }, ++ "/files.completeUploadExternal": { ++ "post": { ++ "consumes": [ ++ "application/json", ++ "application/x-www-form-urlencoded" ++ ], ++ "description": "Finishes an upload started with files.getUploadURLExternal", ++ "externalDocs": { ++ "description": "API method documentation", ++ "url": "https://api.slack.com/methods/files.completeUploadExternal" ++ }, ++ "operationId": "files_complete_upload_external", ++ "parameters": [ ++ { ++ "description": "A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored.", ++ "example": "[{\"type\": \"section\", \"text\": {\"type\": \"plain_text\", \"text\": \"Hello world\"}}]", ++ "in": "query", ++ "name": "blocks", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "Channel ID where the file will be shared. If not specified, the file will remain private.", ++ "example": "C0NF841BK", ++ "in": "query", ++ "name": "channel_id", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "Comma-separated list of channel IDs where the file will be shared.", ++ "example": "C0NF841BK,C2AW648GH", ++ "in": "query", ++ "name": "channels", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "An array of file objects, each containing the `id` of the file to be completed.", ++ "in": "query", ++ "name": "files", ++ "required": true, ++ "type": "string" ++ }, ++ { ++ "description": "The message text introducing the file in specified channels.", ++ "in": "query", ++ "name": "initial_comment", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. Also, make sure to provide only one channel when using `thread_ts`.", ++ "example": "1524523204.000192", ++ "in": "query", ++ "name": "thread_ts", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.", ++ "in": "formData", ++ "name": "token", ++ "type": "string" ++ } ++ ], ++ "produces": [ ++ "application/json" ++ ], ++ "responses": { ++ "200": { ++ "description": "Typical success response", ++ "examples": { ++ "application/json": { ++ "files": [ ++ { ++ "id": "F123ABC456", ++ "title": "slack-test" ++ } ++ ], ++ "ok": true ++ } ++ }, ++ "schema": { ++ "additionalProperties": false, ++ "description": "Schema for successful response files.completeUploadExternal method", ++ "properties": { ++ "files": { ++ "items": { ++ "properties": { ++ "id": { ++ "$ref": "#/definitions/defs_file_id" ++ }, ++ "title": { ++ "example": "slack-test", ++ "type": "string" ++ } ++ }, ++ "type": "object" ++ }, ++ "type": "array" ++ }, ++ "ok": { ++ "$ref": "#/definitions/defs_ok_true" ++ } ++ }, ++ "required": [ ++ "files", ++ "ok" ++ ], ++ "title": "files.completeUploadExternal schema", ++ "type": "object" ++ } ++ }, ++ "default": { ++ "description": "Typical error response", ++ "examples": { ++ "application/json": { ++ "error": "invalid_auth", ++ "ok": false ++ } ++ }, ++ "schema": { ++ "additionalProperties": false, ++ "description": "Schema for error response files.completeUploadExternal method", ++ "properties": { ++ "callstack": { ++ "description": "Note: PHP callstack is only visible in dev/qa", ++ "type": "string" ++ }, ++ "error": { ++ "enum": [ ++ "access_denied", ++ "accesslimited", ++ "account_inactive", ++ "channel_not_found", ++ "channels_limit_exceeded", ++ "deprecated_endpoint", ++ "ekm_access_denied", ++ "enterprise_is_restricted", ++ "fatal_error", ++ "file_not_found", ++ "file_update_failed", ++ "invalid_array_arg", ++ "invalid_auth", ++ "invalid_blocks", ++ "invalid_channel", ++ "invalid_charset", ++ "invalid_form_data", ++ "invalid_post_type", ++ "method_deprecated", ++ "missing_post_type", ++ "missing_scope", ++ "no_permission", ++ "not_allowed_token_type", ++ "not_authed", ++ "not_in_channel", ++ "posting_to_channel_denied", ++ "ratelimited", ++ "request_timeout", ++ "service_unavailable", ++ "team_access_not_granted", ++ "team_added_to_org", ++ "two_factor_setup_required" ++ ], ++ "type": "string" ++ }, ++ "ok": { ++ "$ref": "#/definitions/defs_ok_false" ++ } ++ }, ++ "required": [ ++ "error", ++ "ok" ++ ], ++ "title": "files.completeUploadExternal error schema", ++ "type": "object" ++ } ++ } ++ }, ++ "security": [ ++ { ++ "slackAuth": [ ++ "files:write:user" ++ ] ++ } ++ ], ++ "tags": [ ++ "files" ++ ] ++ } ++ }, + "/files.delete": { + "post": { + "consumes": [ + "application/json", + "application/x-www-form-urlencoded" + ], + "description": "Deletes a file.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/files.delete" +@@ -16859,20 +17129,170 @@ + "slackAuth": [ + "files:write:user" + ] + } + ], + "tags": [ + "files" + ] + } + }, ++ "/files.getUploadURLExternal": { ++ "post": { ++ "consumes": [ ++ "application/x-www-form-urlencoded" ++ ], ++ "description": "Gets a URL for an edge external file upload", ++ "externalDocs": { ++ "description": "API method documentation", ++ "url": "https://api.slack.com/methods/files.getUploadURLExternal" ++ }, ++ "operationId": "files_get_upload_url_external", ++ "parameters": [ ++ { ++ "description": "Description of image for screen-reader.", ++ "in": "query", ++ "name": "alt_txt", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "Name of the file being uploaded.", ++ "in": "query", ++ "name": "filename", ++ "required": true, ++ "type": "string" ++ }, ++ { ++ "description": "Size in bytes of the file being uploaded.", ++ "in": "query", ++ "name": "length", ++ "required": true, ++ "type": "integer" ++ }, ++ { ++ "description": "Syntax type of the snippet being uploaded.", ++ "in": "query", ++ "name": "snippet_type", ++ "required": false, ++ "type": "string" ++ }, ++ { ++ "description": "Authentication token. Requires scope: `files:write`", ++ "in": "formData", ++ "name": "token", ++ "type": "string" ++ } ++ ], ++ "produces": [ ++ "application/json" ++ ], ++ "responses": { ++ "200": { ++ "description": "Typical success response", ++ "examples": { ++ "application/json": { ++ "file_id": "F123ABC456", ++ "ok": true, ++ "upload_url": "https://files.slack.com/upload/v1/ABC123..." ++ } ++ }, ++ "schema": { ++ "additionalProperties": false, ++ "description": "Schema for successful response files.getUploadURLExternal method", ++ "properties": { ++ "file_id": { ++ "$ref": "#/definitions/defs_file_id" ++ }, ++ "ok": { ++ "$ref": "#/definitions/defs_ok_true" ++ }, ++ "upload_url": { ++ "description": "URL where the file should be uploaded.", ++ "example": "https://files.slack.com/upload/v1/ABC123...", ++ "pattern": "^https://files\\.slack\\.com/upload/v1/[A-Z0-9]+$", ++ "type": "string" ++ } ++ }, ++ "required": [ ++ "file_id", ++ "ok", ++ "upload_url" ++ ], ++ "title": "files.getUploadURLExternal schema", ++ "type": "object" ++ } ++ }, ++ "default": { ++ "description": "Typical error response", ++ "examples": { ++ "application/json": { ++ "error": "invalid_auth", ++ "ok": false ++ } ++ }, ++ "schema": { ++ "additionalProperties": false, ++ "description": "Schema for error response files.getUploadURLExternal method", ++ "properties": { ++ "callstack": { ++ "description": "Note: PHP callstack is only visible in dev/qa", ++ "type": "string" ++ }, ++ "error": { ++ "enum": [ ++ "account_inactive", ++ "cant_delete_file", ++ "file_deleted", ++ "file_not_found", ++ "invalid_arg_name", ++ "invalid_array_arg", ++ "invalid_auth", ++ "invalid_charset", ++ "invalid_form_data", ++ "invalid_json", ++ "invalid_post_type", ++ "json_not_object", ++ "missing_post_type", ++ "no_permission", ++ "not_authed", ++ "request_timeout", ++ "team_added_to_org", ++ "upgrade_required" ++ ], ++ "type": "string" ++ }, ++ "ok": { ++ "$ref": "#/definitions/defs_ok_false" ++ } ++ }, ++ "required": [ ++ "error", ++ "ok" ++ ], ++ "title": "files.getUploadURLExternal error schema", ++ "type": "object" ++ } ++ } ++ }, ++ "security": [ ++ { ++ "slackAuth": [ ++ "files:write:user" ++ ] ++ } ++ ], ++ "tags": [ ++ "files" ++ ] ++ } ++ }, + "/files.info": { + "get": { + "consumes": [ + "application/x-www-form-urlencoded" + ], + "description": "Gets information about a file.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/files.info" + }, +@@ -17126,27 +17546,27 @@ { "description": "Authentication token. Requires scope: `files:read`", "in": "query", @@ -2957,7 +3899,41 @@ { "description": "Filter files created by a single user.", "in": "query", -@@ -17594,27 +17672,27 @@ +@@ -17473,29 +17893,29 @@ + "application/x-www-form-urlencoded" + ], + "description": "Retrieve information about a remote file added to Slack", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/files.remote.info" + }, + "operationId": "files_remote_info", + "parameters": [ + { +- "description": "Specify a file by providing its ID.", ++ "description": "Creator defined GUID for the file.", + "in": "query", +- "name": "file", ++ "name": "external_id", + "type": "string" + }, + { +- "description": "Creator defined GUID for the file.", ++ "description": "Specify a file by providing its ID.", + "in": "query", +- "name": "external_id", ++ "name": "file", + "type": "string" + }, + { + "description": "Authentication token. Requires scope: `remote_files:read`", + "in": "query", + "name": "token", + "type": "string" + } + ], + "produces": [ +@@ -17594,27 +18014,27 @@ { "description": "Authentication token. Requires scope: `remote_files:read`", "in": "query", @@ -2987,7 +3963,75 @@ "description": "Typical success response", "examples": { "application/json": { -@@ -18234,21 +18312,21 @@ +@@ -17679,29 +18099,29 @@ + "application/x-www-form-urlencoded" + ], + "description": "Remove a remote file.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/files.remote.remove" + }, + "operationId": "files_remote_remove", + "parameters": [ + { +- "description": "Specify a file by providing its ID.", ++ "description": "Creator defined GUID for the file.", + "in": "formData", +- "name": "file", ++ "name": "external_id", + "type": "string" + }, + { +- "description": "Creator defined GUID for the file.", ++ "description": "Specify a file by providing its ID.", + "in": "formData", +- "name": "external_id", ++ "name": "file", + "type": "string" + }, + { + "description": "Authentication token. Requires scope: `remote_files:write`", + "in": "formData", + "name": "token", + "type": "string" + } + ], + "produces": [ +@@ -17779,29 +18199,29 @@ + }, + "operationId": "files_remote_share", + "parameters": [ + { + "description": "Comma-separated list of channel IDs where the file will be shared.", + "in": "query", + "name": "channels", + "type": "string" + }, + { +- "description": "Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required.", ++ "description": "The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required.", + "in": "query", +- "name": "file", ++ "name": "external_id", + "type": "string" + }, + { +- "description": "The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required.", ++ "description": "Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required.", + "in": "query", +- "name": "external_id", ++ "name": "file", + "type": "string" + }, + { + "description": "Authentication token. Requires scope: `remote_files:share`", + "in": "query", + "name": "token", + "type": "string" + } + ], + "produces": [ +@@ -18234,21 +18654,21 @@ } ], "tags": [ @@ -3010,7 +4054,7 @@ "parameters": [ { "description": "Comma-separated list of channel names or IDs where the file will be shared.", -@@ -18259,21 +18337,21 @@ +@@ -18259,21 +18679,21 @@ { "description": "File contents via a POST variable. If omitting this parameter, you must provide a `file`.", "in": "formData", @@ -3033,7 +4077,7 @@ { "description": "A [file type](/types/file#file_types) identifier.", "in": "formData", -@@ -18283,21 +18361,21 @@ +@@ -18283,21 +18703,21 @@ { "description": "The message text introducing the file in specified `channels`.", "in": "formData", @@ -3056,7 +4100,7 @@ { "description": "Authentication token. Requires scope: `files:write:user`", "in": "formData", -@@ -18478,21 +18556,20 @@ +@@ -18478,21 +18898,20 @@ { "description": "Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`.", "in": "query", @@ -3078,7 +4122,7 @@ "type": "string" } ], -@@ -18984,34 +19061,32 @@ +@@ -18984,34 +19403,32 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/pins.add" @@ -3113,7 +4157,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -19112,28 +19187,26 @@ +@@ -19112,28 +19529,26 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/pins.list" @@ -3142,7 +4186,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -19349,21 +19422,20 @@ +@@ -19349,21 +19764,20 @@ { "description": "Timestamp of the message to un-pin.", "in": "formData", @@ -3164,7 +4208,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -19485,21 +19557,20 @@ +@@ -19485,21 +19899,20 @@ "description": "Timestamp of the message to add reaction to.", "in": "formData", "name": "timestamp", @@ -3186,7 +4230,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -19629,21 +19700,20 @@ +@@ -19629,21 +20042,20 @@ { "description": "Timestamp of the message to get reactions for.", "in": "query", @@ -3208,7 +4252,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -19670,21 +19740,21 @@ +@@ -19670,21 +20082,21 @@ "timestamp": 1507850315, "title": "computer.gif", "user": "U2U85N1RV" @@ -3231,7 +4275,7 @@ "$ref": "#/definitions/objs_message" }, "ok": { -@@ -19859,21 +19929,20 @@ +@@ -19859,21 +20271,20 @@ }, { "in": "query", @@ -3253,7 +4297,7 @@ } ], "produces": [ -@@ -20173,21 +20242,20 @@ +@@ -20173,21 +20584,20 @@ { "description": "Timestamp of the message to remove reaction from.", "in": "formData", @@ -3275,7 +4319,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -20303,21 +20371,20 @@ +@@ -20303,21 +20713,20 @@ "description": "When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. \"in 15 minutes,\" or \"every Thursday\")", "in": "formData", "name": "time", @@ -3297,7 +4341,7 @@ } ], "produces": [ -@@ -20918,21 +20985,20 @@ +@@ -20918,21 +21327,20 @@ { "description": "Only deliver presence events when requested by subscription. See [presence subscriptions](/docs/presence-and-status#subscriptions).", "in": "query", @@ -3319,7 +4363,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -21116,21 +21182,20 @@ +@@ -21116,21 +21524,20 @@ { "description": "Change sort direction to ascending (`asc`) or descending (`desc`).", "in": "query", @@ -3341,7 +4385,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -21285,21 +21350,20 @@ +@@ -21285,21 +21692,20 @@ { "description": "Timestamp of the message to add star to.", "in": "formData", @@ -3363,7 +4407,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -21716,21 +21780,20 @@ +@@ -21716,21 +22122,20 @@ { "description": "Timestamp of the message to remove star from.", "in": "formData", @@ -3385,7 +4429,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -21849,21 +21912,20 @@ +@@ -21849,21 +22254,20 @@ }, { "in": "query", @@ -3407,7 +4451,7 @@ "200": { "description": "This response demonstrates pagination and two access log entries.", "examples": { -@@ -22064,21 +22126,20 @@ +@@ -22064,21 +22468,20 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/team.billableInfo" @@ -3429,7 +4473,7 @@ } ], "produces": [ -@@ -22169,21 +22230,20 @@ +@@ -22169,21 +22572,20 @@ { "description": "Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels", "in": "query", @@ -3451,7 +4495,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -22327,21 +22387,20 @@ +@@ -22327,21 +22729,20 @@ { "description": "Filter logs to this service. Defaults to all logs.", "in": "query", @@ -3473,7 +4517,7 @@ } ], "produces": [ -@@ -22502,21 +22561,20 @@ +@@ -22502,21 +22903,20 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/team.profile.get" @@ -3495,7 +4539,7 @@ } ], "produces": [ -@@ -22732,21 +22790,20 @@ +@@ -22732,21 +23132,20 @@ "description": "A name for the User Group. Must be unique among User Groups.", "in": "formData", "name": "name", @@ -3517,7 +4561,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -22856,21 +22913,20 @@ +@@ -22856,21 +23255,20 @@ { "description": "Include the number of users in the User Group.", "in": "formData", @@ -3539,7 +4583,7 @@ "type": "string" } ], -@@ -22987,21 +23043,20 @@ +@@ -22987,21 +23385,20 @@ { "description": "Include the number of users in the User Group.", "in": "formData", @@ -3561,7 +4605,7 @@ "type": "string" } ], -@@ -23127,24 +23182,29 @@ +@@ -23127,24 +23524,29 @@ "name": "include_disabled", "type": "boolean" }, @@ -3592,7 +4636,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -23347,21 +23407,20 @@ +@@ -23347,21 +23749,20 @@ { "description": "A name for the User Group. Must be unique among User Groups.", "in": "formData", @@ -3614,7 +4658,7 @@ "type": "string" } ], -@@ -23504,25 +23563,24 @@ +@@ -23504,25 +23905,24 @@ { "description": "Allow results that involve disabled User Groups.", "in": "query", @@ -3641,7 +4685,7 @@ "application/json" ], "responses": { -@@ -23644,21 +23702,20 @@ +@@ -23644,21 +24044,20 @@ { "description": "Include the number of users in the User Group.", "in": "formData", @@ -3663,7 +4707,7 @@ "type": "string" }, { -@@ -24036,21 +24093,20 @@ +@@ -24036,21 +24435,20 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/users.deletePhoto" @@ -3685,7 +4729,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -24147,21 +24203,20 @@ +@@ -24147,21 +24545,20 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/users.getPresence" @@ -3707,7 +4751,7 @@ } ], "produces": [ -@@ -24630,21 +24685,20 @@ +@@ -24630,21 +25027,20 @@ { "description": "Set this to `true` to receive the locale for this user. Defaults to `false`", "in": "query", @@ -3729,17 +4773,41 @@ } ], "produces": [ -@@ -24800,20 +24854,26 @@ - "name": "include_locale", - "type": "boolean" +@@ -24782,38 +25178,44 @@ + "application/x-www-form-urlencoded" + ], + "description": "Lists all users in a Slack team.", + "externalDocs": { + "description": "API method documentation", + "url": "https://api.slack.com/methods/users.list" + }, + "operationId": "users_list", + "parameters": [ + { +- "description": "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors.", +- "in": "query", +- "name": "limit", +- "type": "integer" +- }, +- { + "description": "Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first \"page\" of the collection. See [pagination](/docs/pagination) for more detail.", + "in": "query", + "name": "cursor", + "type": "string" }, { - "description": "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors.", + "description": "Set this to `true` to receive the locale for users. Defaults to `false`", "in": "query", - "name": "limit", - "type": "integer" + "name": "include_locale", + "type": "boolean" }, { ++ "description": "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors.", ++ "in": "query", ++ "name": "limit", ++ "type": "integer" ++ }, ++ { + "description": "Encoded team id to list users in, required if org token is used", + "in": "query", + "name": "team_id", @@ -3756,7 +4824,7 @@ "application/json" ], "responses": { -@@ -25011,28 +25071,26 @@ +@@ -25011,28 +25413,26 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/users.lookupByEmail" @@ -3785,7 +4853,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -25175,21 +25233,20 @@ +@@ -25175,21 +25575,20 @@ { "description": "Include labels for each ID in custom profile fields", "in": "query", @@ -3807,7 +4875,7 @@ } ], "produces": [ -@@ -25330,21 +25387,20 @@ +@@ -25330,21 +25729,20 @@ { "description": "Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.", "in": "formData", @@ -3829,7 +4897,7 @@ }, { "description": "Value to set a single key to. Usable only if `profile` is not passed.", -@@ -25491,21 +25547,20 @@ +@@ -25491,21 +25889,20 @@ "externalDocs": { "description": "API method documentation", "url": "https://api.slack.com/methods/users.setActive" @@ -3851,7 +4919,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -25625,21 +25680,20 @@ +@@ -25625,21 +26022,20 @@ { "description": "File contents via `multipart/form-data`.", "in": "formData", @@ -3873,7 +4941,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -25814,21 +25868,20 @@ +@@ -25814,21 +26210,20 @@ "description": "Either `auto` or `away`", "in": "formData", "name": "presence", @@ -3895,7 +4963,7 @@ "200": { "description": "Typical success response", "examples": { -@@ -25910,49 +25963,48 @@ +@@ -25910,49 +26305,48 @@ "users:write" ] } @@ -3948,7 +5016,7 @@ ], "responses": { "200": { -@@ -26053,55 +26105,54 @@ +@@ -26053,55 +26447,54 @@ "none" ] } @@ -4008,7 +5076,7 @@ ], "responses": { "200": { -@@ -26192,49 +26243,48 @@ +@@ -26192,49 +26585,48 @@ "none" ] } @@ -4061,7 +5129,7 @@ ], "responses": { "200": { -@@ -26341,60 +26391,59 @@ +@@ -26341,60 +26733,59 @@ "none" ] } @@ -4127,7 +5195,7 @@ "responses": { "200": { "description": "Typical success response includes the updated view payload.", -@@ -26496,48 +26545,47 @@ +@@ -26496,48 +26887,47 @@ "none" ] } @@ -4179,7 +5247,7 @@ ], "responses": { "200": { -@@ -26592,49 +26640,48 @@ +@@ -26592,49 +26982,48 @@ "workflow.steps:execute" ] } @@ -4232,7 +5300,7 @@ ], "responses": { "200": { -@@ -26689,66 +26736,65 @@ +@@ -26689,66 +27078,65 @@ "workflow.steps:execute" ] } diff --git a/resources/slack-openapi.json b/resources/slack-openapi.json index e457c94f..72c5dfb4 100644 --- a/resources/slack-openapi.json +++ b/resources/slack-openapi.json @@ -27438,4 +27438,4 @@ }, "swagger": "2.0", "tags": [] -} +} \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index f31fca22..6e4ff17b 100644 --- a/src/Client.php +++ b/src/Client.php @@ -13,11 +13,16 @@ namespace JoliCode\Slack; +use Http\Discovery\Psr17FactoryDiscovery; use JoliCode\Slack\Api\Client as ApiClient; +use JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponse200; +use JoliCode\Slack\Api\Model\FilesCompleteUploadExternalPostResponsedefault; use JoliCode\Slack\Api\Model\ObjsConversation; use JoliCode\Slack\Api\Model\ObjsMessage; use JoliCode\Slack\Api\Model\ObjsSubteam; use JoliCode\Slack\Api\Model\ObjsUser; +use Nyholm\Psr7\Stream; +use Psr\Http\Client\ClientExceptionInterface; /** * @method iterable iterateConversationsHistory(array $arguments = []) @@ -76,4 +81,108 @@ public function iterate(string $method, array $arguments): iterable $cursor = $response->getResponseMetadata() ? $response->getResponseMetadata()->getNextCursor() : ''; } while (!empty($cursor)); } + + /** + * Uploads one or more files to Slack using the external file upload flow. + * + * Each file must include a 'path' key. Optional keys per file: + * - 'title': Custom display name (defaults to file name) + * - 'alt_text': Description for screen readers + * - 'snippet_type': Syntax highlighting language (for code snippets) + * + * @param array $files Array of files to upload. Each file should be an associative array: + * [ + * 'path' => '/path/to/file.png', + * 'title' => 'My File', // optional + * 'alt_text' => 'Screen reader description', // optional + * 'snippet_type' => 'php', // optional + * ] + * @param string $channelId The Slack channel ID to upload files to (e.g., 'C12345678'). + * @param string|null $initialComment optional comment to add with the upload + * + * @throws \RuntimeException if upload or Slack API interaction fails + * @throws \JsonException + * @throws ClientExceptionInterface + * + * @example + * $this->filesUploadV2([ + * ['path' => '/tmp/image.png', 'title' => 'Bot Logo', 'alt_text' => 'Slack Bot Logo'], + * ['path' => '/tmp/script.js', 'snippet_type' => 'javascript'] + * ], 'C12345678', 'Here are the uploaded files:'); + */ + public function filesUploadV2( + array $files, + string $channelId, + ?string $initialComment = null, + ): FilesCompleteUploadExternalPostResponsedefault|FilesCompleteUploadExternalPostResponse200|null { + $filesPayload = []; + + foreach ($files as $file) { + $filePath = $file['path']; + $fileName = basename($filePath); + $title = $file['title'] ?? $fileName; + $altText = $file['alt_text'] ?? null; + $snippetType = $file['snippet_type'] ?? null; + + $fileStream = Stream::create(fopen($filePath, 'r')); + $fileSize = $fileStream->getSize(); + + // Step 1: Get upload URL from Slack + $queryParams = array_filter( + [ + 'filename' => $fileName, + 'length' => $fileSize, + 'alt_txt' => $altText, + 'snippet_type' => $snippetType, + ] + ); + + $uploadInfo = $this->filesGetUploadUrlExternal($queryParams); + $uploadUrl = $uploadInfo?->getUploadUrl(); + $fileId = $uploadInfo?->getFileId(); + + if (null === $uploadUrl || null === $fileId) { + throw new \RuntimeException("Slack did not return upload URL or file ID for {$fileName}"); + } + + // Step 2: Upload file data using cURL + $this->uploadToSlackUrl($uploadUrl, $filePath); + + // Step 3: Build file metadata + $filesPayload[] = [ + 'id' => $fileId, + 'title' => $title, + ]; + } + + // Step 4: Complete upload + return $this->filesCompleteUploadExternal( + array_filter( + [ + 'files' => json_encode($filesPayload, \JSON_THROW_ON_ERROR), + 'channel_id' => $channelId, + 'initial_comment' => $initialComment, + ] + ) + ); + } + + /** + * @throws ClientExceptionInterface + */ + private function uploadToSlackUrl(string $uploadUrl, string $filePath): void + { + $uriFactory = Psr17FactoryDiscovery::findUriFactory(); + $uri = $uriFactory->createUri($uploadUrl); + + $stream = $this->streamFactory->createStreamFromFile($filePath); + $request = $this->requestFactory->createRequest('POST', $uri); + $request = $request->withBody($stream); + + $response = $this->httpClient->sendRequest($request); + $responseStatusCode = $response->getStatusCode(); + if ($responseStatusCode >= 400) { + throw new \RuntimeException(\sprintf('Upload failed: %s - %s', $response->getStatusCode(), $response->getBody())); + } + } } diff --git a/src/Command/CheckerCommand.php b/src/Command/CheckerCommand.php index c7b6e80a..e13ecddb 100644 --- a/src/Command/CheckerCommand.php +++ b/src/Command/CheckerCommand.php @@ -26,11 +26,12 @@ class CheckerCommand extends Command protected function configure(): void { $this + ->setName(self::$defaultName) ->setDescription('Checks the patched file and displays a summary table.') ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $result = (new SchemaChecker())->check(__DIR__ . '/../../resources/slack-openapi-patched.json'); $rows = []; diff --git a/src/Command/GeneratePatchCommand.php b/src/Command/GeneratePatchCommand.php index 35cfc775..57410c3f 100644 --- a/src/Command/GeneratePatchCommand.php +++ b/src/Command/GeneratePatchCommand.php @@ -28,11 +28,12 @@ class GeneratePatchCommand extends Command protected function configure(): void { $this + ->setName(self::$defaultName) ->setDescription('Generates the patch by comparing Slack\'s official sorted spec to the currently patched one.') ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { // ensure the patched specification is alphabetically sorted $content = file_get_contents(__DIR__ . '/../../resources/slack-openapi-patched.json'); diff --git a/src/Command/UpdateSpecificationCommand.php b/src/Command/UpdateSpecificationCommand.php index a13dcdff..23302cdb 100644 --- a/src/Command/UpdateSpecificationCommand.php +++ b/src/Command/UpdateSpecificationCommand.php @@ -29,11 +29,12 @@ class UpdateSpecificationCommand extends Command protected function configure(): void { $this + ->setName(self::$defaultName) ->setDescription('Downloads a new version of the official Slack OpenAPI file, and applies our patches to it.') ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/HttpPlugin/AddSlackPathAndHostPlugin.php b/src/HttpPlugin/AddSlackPathAndHostPlugin.php index 6aa5a210..f0d405dc 100644 --- a/src/HttpPlugin/AddSlackPathAndHostPlugin.php +++ b/src/HttpPlugin/AddSlackPathAndHostPlugin.php @@ -44,7 +44,8 @@ public function __construct(UriInterface $uri) public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { - if ($this->uri->getHost() !== $request->getUri()->getHost()) { + if ($this->uri->getHost() !== $request->getUri()->getHost() + && 'files.slack.com' !== $request->getUri()->getHost()) { $uri = $request->getUri() ->withHost($this->uri->getHost()) ->withScheme($this->uri->getScheme()) diff --git a/tests/WritingTest.php b/tests/WritingTest.php index 5ebf41b8..39761ba9 100644 --- a/tests/WritingTest.php +++ b/tests/WritingTest.php @@ -14,6 +14,7 @@ namespace JoliCode\Slack\Tests; use JoliCode\Slack\Api\Model\ChatPostMessagePostResponse200; +use JoliCode\Slack\Api\Model\FilesGetUploadURLExternalPostResponse200; use JoliCode\Slack\Api\Model\FilesUploadPostResponse200; use Nyholm\Psr7\Stream; @@ -165,4 +166,112 @@ public function testItCanMarkConversation(): void self::assertTrue($markResponse->getOk()); } + + public function testItCanFileGetUploadUrlExternal(): void + { + $client = $this->createClient(); + $fileName = 'test-image.png'; + $filePath = __DIR__ . '/resources/' . $fileName; + $fileStream = Stream::create(fopen($filePath, 'r')); + $fileSize = $fileStream->getSize(); + + $response = $client->filesGetUploadUrlExternal( + [ + 'filename' => 'test-image.png', + 'length' => $fileSize, + ] + ); + + self::assertInstanceOf(FilesGetUploadURLExternalPostResponse200::class, $response); + self::assertTrue($response->getOk()); + self::assertNotEmpty($response->getUploadUrl()); + self::assertIsString($response->getUploadUrl()); + self::assertNotEmpty($response->getFileId()); + self::assertIsString($response->getFileId()); + + $uploadResponse = $client->filesUploadV2([ + ['path' => $filePath, 'title' => 'Test image', 'alt_text' => 'Test image'], + ], $_SERVER['SLACK_TEST_CHANNEL'], 'Uploaded with the 2025 API.'); + + self::assertTrue($uploadResponse->getOk()); + } + + public function testItCanFileCompleteUploadExternal(): void + { + $client = $this->createClient(); + $fileName = 'test-image.png'; + $filePath = __DIR__ . '/resources/' . $fileName; + $fileStream = Stream::create(fopen($filePath, 'r')); + $fileSize = $fileStream->getSize(); + + $response = $client->filesGetUploadUrlExternal( + [ + 'filename' => 'test-image.png', + 'length' => $fileSize, + ] + ); + + self::assertInstanceOf(FilesGetUploadURLExternalPostResponse200::class, $response); + self::assertTrue($response->getOk()); + self::assertNotEmpty($response->getUploadUrl()); + self::assertIsString($response->getUploadUrl()); + self::assertNotEmpty($response->getFileId()); + self::assertIsString($response->getFileId()); + + $uploadUrl = $response->getUploadUrl(); + $fileId = $response->getFileId(); + + // Step 2: Upload file data to the URL + $ch = curl_init($uploadUrl); + curl_setopt($ch, \CURLOPT_POST, true); + curl_setopt($ch, \CURLOPT_POSTFIELDS, $fileStream); + curl_setopt($ch, \CURLOPT_RETURNTRANSFER, true); + curl_exec($ch); + curl_close($ch); + + $completeResponse = $client->filesCompleteUploadExternal( + [ + 'files' => json_encode( + [ + [ + 'id' => $fileId, + 'title' => 'test image file', + ], + ]), + 'channel_id' => $_SERVER['SLACK_TEST_CHANNEL'], + 'initial_comment' => 'Testing file upload via Slack API with test-image.png', + ] + ); + + self::assertTrue($completeResponse->getOk()); + self::assertNotEmpty($completeResponse->getFiles()); + } + + public function testItCanUploadFilesViaFilesUploadV2(): void + { + $client = $this->createClient(); + + $filePath = __DIR__ . '/resources/test-image.png'; + + $response = $client->filesUploadV2( + [ + [ + 'path' => $filePath, + 'title' => 'Test Image', + 'alt_text' => 'Slack Bot Logo', + ], + [ + 'path' => $filePath, + 'title' => 'Test Image 2', + 'alt_text' => 'Slack Bot Logo 2', + ], + ], + $_SERVER['SLACK_TEST_CHANNEL'], + 'test initial comment' + ); + + self::assertTrue($response->getOk()); + self::assertNotEmpty($response->getFiles()); + self::assertCount(2, $response->getFiles()); + } }