Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 997dad9

Browse files
committed
📝 document download function
1 parent ed841f7 commit 997dad9

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/vendor/
33
/.phpunit.result.cache
44
/composer.lock
5+
.DS_Store

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ null
9797

9898
---
9999

100+
#### `download` function
101+
102+
Download an attachment content.
103+
104+
```php
105+
$attachment = $client->attachments()->get(id: '1000');
106+
107+
$client->attachments()->download(url: $attachment['content']);
108+
```
109+
110+
<details>
111+
<summary>response example</summary>
112+
113+
```text
114+
{"a":"b"}\n
115+
```
116+
117+
</details>
118+
119+
---
120+
100121
### `Customers` Resource
101122

102123
#### `create` function

tests/Resources/Attachments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
it('can download an attachment content', function () {
2929
$client = mockClient(
3030
method: Method::GET,
31-
uri: 'https://www.example.com/jira/attachments/10000',
31+
uri: 'https://www.example.com/secure/attachment/4157499/index-1.json',
3232
response: downloadAttachment(),
3333
function: 'requestContent'
3434
);
3535

36-
$result = $client->attachments()->download(url: 'https://www.example.com/jira/attachments/10000');
36+
$result = $client->attachments()->download(url: 'https://www.example.com/secure/attachment/4157499/index-1.json');
3737

3838
expect($result)->toBe(downloadAttachment());
3939
});

0 commit comments

Comments
 (0)