Skip to content

Commit 9a10620

Browse files
Change "ts" from number to string as specification is wrong (#98)
1 parent d644b47 commit 9a10620

File tree

7 files changed

+54
-6
lines changed

7 files changed

+54
-6
lines changed

generated/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,7 @@ public function conversationsList(array $queryParameters = [], string $fetch = s
21482148
* @param array $formParameters {
21492149
*
21502150
* @var string $channel channel or conversation to set the read cursor for
2151-
* @var float $ts Unique identifier of message you want marked as most recently seen in this conversation.
2151+
* @var string $ts Unique identifier of message you want marked as most recently seen in this conversation.
21522152
* }
21532153
*
21542154
* @param array $headerParameters {

generated/Endpoint/ConversationsMark.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ConversationsMark extends \JoliCode\Slack\Api\Runtime\Client\BaseEndpoint
2323
* @param array $formParameters {
2424
*
2525
* @var string $channel channel or conversation to set the read cursor for
26-
* @var float $ts Unique identifier of message you want marked as most recently seen in this conversation.
26+
* @var string $ts Unique identifier of message you want marked as most recently seen in this conversation.
2727
* }
2828
*
2929
* @param array $headerParameters {
@@ -69,7 +69,7 @@ protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\
6969
$optionsResolver->setRequired([]);
7070
$optionsResolver->setDefaults([]);
7171
$optionsResolver->setAllowedTypes('channel', ['string']);
72-
$optionsResolver->setAllowedTypes('ts', ['float']);
72+
$optionsResolver->setAllowedTypes('ts', ['string']);
7373

7474
return $optionsResolver;
7575
}

resources/slack-openapi-patched.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12686,7 +12686,7 @@
1268612686
"description": "Unique identifier of message you want marked as most recently seen in this conversation.",
1268712687
"in": "formData",
1268812688
"name": "ts",
12689-
"type": "number"
12689+
"type": "string"
1269012690
}
1269112691
],
1269212692
"produces": [
@@ -16041,6 +16041,7 @@
1604116041
"error": {
1604216042
"enum": [
1604316043
"account_inactive",
16044+
"file_upload_size_restricted",
1604416045
"file_uploads_disabled",
1604516046
"file_uploads_except_images_disabled",
1604616047
"invalid_arg_name",

resources/slack-openapi-sorted.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16010,6 +16010,7 @@
1601016010
"error": {
1601116011
"enum": [
1601216012
"account_inactive",
16013+
"file_upload_size_restricted",
1601316014
"file_uploads_disabled",
1601416015
"file_uploads_except_images_disabled",
1601516016
"invalid_arg_name",

resources/slack-openapi-sorted.patch

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- resources/slack-openapi-sorted.json 2020-10-21 09:45:29.539363011 +0200
2-
+++ resources/slack-openapi-patched.json 2020-10-21 10:14:27.338439082 +0200
1+
--- resources/slack-openapi-sorted.json 2020-11-22 19:07:43.855900105 +0100
2+
+++ resources/slack-openapi-patched.json 2020-11-22 19:20:36.996043162 +0100
33
@@ -507,20 +507,21 @@
44
"type": "boolean"
55
},
@@ -2482,6 +2482,29 @@
24822482
"ok",
24832483
"pin_count"
24842484
],
2485+
@@ -12655,21 +12679,21 @@
2486+
{
2487+
"description": "Authentication token. Requires scope: `conversations:write`",
2488+
"in": "header",
2489+
"name": "token",
2490+
"type": "string"
2491+
},
2492+
{
2493+
"description": "Unique identifier of message you want marked as most recently seen in this conversation.",
2494+
"in": "formData",
2495+
"name": "ts",
2496+
- "type": "number"
2497+
+ "type": "string"
2498+
}
2499+
],
2500+
"produces": [
2501+
"application/json"
2502+
],
2503+
"responses": {
2504+
"200": {
2505+
"description": "Typical success response",
2506+
"schema": {
2507+
"additionalProperties": false,
24852508
@@ -13252,21 +13276,21 @@
24862509
{
24872510
"description": "Authentication token. Requires scope: `conversations:history`",

resources/slack-openapi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16558,6 +16558,7 @@
1655816558
"posting_to_general_channel_denied",
1655916559
"invalid_channel",
1656016560
"file_uploads_disabled",
16561+
"file_upload_size_restricted",
1656116562
"file_uploads_except_images_disabled",
1656216563
"storage_limit_reached",
1656316564
"not_authed",

tests/WritingTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,26 @@ public function testScheduleMessage()
124124

125125
$this->assertTrue($response->getOk());
126126
}
127+
128+
public function testItCanMarkConversation()
129+
{
130+
$client = ClientFactory::create($_SERVER['SLACK_TOKEN']);
131+
132+
$response = $client->chatPostMessage([
133+
'username' => 'User A',
134+
'channel' => $_SERVER['SLACK_TEST_CHANNEL'],
135+
'text' => 'Message to be mark as read',
136+
]);
137+
138+
self::assertInstanceOf(ChatPostMessagePostResponse200::class, $response);
139+
140+
$ts = $response->getTs();
141+
142+
$markResponse = $client->conversationsMark([
143+
'channel' => $_SERVER['SLACK_TEST_CHANNEL'],
144+
'ts' => $ts,
145+
]);
146+
147+
self::assertTrue($markResponse->getOk());
148+
}
127149
}

0 commit comments

Comments
 (0)