ReviewOS

also looking at this

meemalabs/meema-client-php

initialize progress

#1
Merged glennmichael123 wants to merge initial-progress into main
17 files +581 -48
.editorconfigadded+18-0
Changes to .editorconfig
@@ -0,0 +1,18 @@
1; This file is for unifying the coding style for different editors and IDEs.
2; More information at https://editorconfig.org
3
4root = true
5
6[*]
7charset = utf-8
8indent_size = 4
9indent_style = space
10end_of_line = lf
11insert_final_newline = true
12trim_trailing_whitespace = true
13
14[*.md]
15trim_trailing_whitespace = false
16
17[*.yml]
18indent_size = 2
.gitattributesadded+11-0
Changes to .gitattributes
@@ -0,0 +1,11 @@
1# Path-based git attributes
2# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3
4# Ignore all test and documentation with "export-ignore".
5/.github export-ignore
6/.gitattributes export-ignore
7/.gitignore export-ignore
8/.styleci.yml export-ignore
9/.scrutinizer.yml export-ignore
10/tests export-ignore
11/.editorconfig export-ignore
.github/ISSUE_TEMPLATE/---bug-report.mdadded+59-0
Changes to .github/ISSUE_TEMPLATE/---bug-report.md
@@ -0,0 +1,59 @@
1---
2name: "\U0001F41B Bug Report"
3about: Report a general package issue.
4title: "[BUG]"
5labels: bug
6assignees: chris1904
7---
8
9<!--
10PLEASE READ: FILLING IN THE TEMPLATE IS REQUIRED!
11Issues that do not include enough information might not be picked up.
12Issues that have not been filled in using the issue template will be _closed_.
13
14Have you read laravel-media-recognition's contributing guidelines (https://github.com/meemalabs/laravel-media-recognition/blob/main/CONTRIBUTING.md)
15and Code Of Conduct (https://github.com/meemalabs/laravel-media-recognition/main/CODE_OF_CONDUCT.md)?
16
17By filing an Issue, you are expected to comply with it, including treating everyone with respect.
18
19Please prefix your issue with: [BUG]
20-->
21
22### Prerequisites
23
24<!--
25Put an X between the brackets if you have done the following:
26-->
27
28* [ ] Are you using Laravel 6 and above?
29* [ ] Able to reproduce the behavior outside of your code, the problem is isolated to laravel-media-recognition`
30* [ ] Checked that your issue isn't already filed.
31* [ ] Checked if no PR was submitted that fixes this problem.
32
33### Versions
34
35<!-- Please be as exact and complete as possible when providing version numbers -->
36
37* PHP version: <!-- put your FULL (including patch number) PHP version here -->
38* Laravel version: <!-- put your FULL (including patch number) Laravel version here -->
39* Package version: <!-- put FULL (including patch number) Laravel Text to Speech package version here -->
40
41### Description
42
43<!-- Describe the issue -->
44
45### Steps to Reproduce
46
47<!-- How can this issue be reproduced? Provide a reproduction repository to help us reproduce the issue easily. -->
48
49**Expected behavior:**
50
51<!-- What you expect to happen -->
52
53**Actual behavior:**
54
55<!-- What actually happens. Please include screenshots, stack traces and anything that can help us understand the issue. -->
56
57### Additional Information
58
59Any additional information, configuration or data that might be necessary to reproduce the issue.
.github/ISSUE_TEMPLATE/---ideas.mdadded+42-0
Changes to .github/ISSUE_TEMPLATE/---ideas.md
@@ -0,0 +1,42 @@
1---
2name: "\U0001F4A1 Ideas"
3about: "If you have a \U0001F525 idea or proposals."
4title: "[IDEA]"
5labels: enhancement
6assignees: chris1904
7---
8
9<!--
10
11PLEASE READ: FILLING IN THE TEMPLATE IS REQUIRED!
12Issues should require enough information.
13
14Have you read meema-client-php's
15contributing guidelines (https://github.com/meemalabs/meema-client-php/blob/main/CONTRIBUTING.md)
16and Code Of Conduct (https://github.com/meemalabs/meema-client-php/main/CODE_OF_CONDUCT.md)?
17By filing an idea, you are expected to comply with it, including treating everyone with respect.
18
19Please prefix your idea with: [IDEA].
20
21-->
22
23### Prerequisites
24
25### Versions
26
27<!-- Please be as exact and complete as possible when providing version numbers -->
28
29* PHP version: <!-- put your FULL PHP version here -->
30* Client version: <!-- put FULL meema-client-php package version here -->
31
32### Description
33
34<!-- Describe your proposal -->
35
36### Example
37
38<!-- Show an example of how this proposal will work. -->
39
40### Additional Information
41
42Any additional information, configuration or data that might be needed to understand the proposal.
.github/dependabot.ymladded+7-0
Changes to .github/dependabot.yml
@@ -0,0 +1,7 @@
1version: 2
2updates:
3- package-ecosystem: composer
4 directory: "/"
5 schedule:
6 interval: daily
7 open-pull-requests-limit: 10
.github/workflows/run-tests.ymladded+40-0
Changes to .github/workflows/run-tests.yml
@@ -0,0 +1,40 @@
1name: Run Tests
2
3on:
4 push:
5 pull_request:
6
7jobs:
8 run-tests:
9 runs-on: ubuntu-latest
10 strategy:
11 fail-fast: false
12 matrix:
13 php: [7.4, 8.0]
14 dependency-version: [prefer-lowest, prefer-stable]
15
16 name: P ${{ matrix.php }} - ${{ matrix.dependency-version }}
17
18 steps:
19 - name: Checkout code
20 uses: actions/checkout@v2
21
22 - name: Setup PHP
23 uses: shivammathur/setup-php@v2
24 with:
25 php-version: ${{ matrix.php }}
26 extensions: mbstring, curl
27
28 - name: Cache dependencies
29 uses: actions/cache@v1
30 with:
31 path: ~/.composer/cache/files
32 key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
33
34 - name: Install dependencies
35 run: |
36 composer require "orchestra/testbench:$" --no-interaction --no-update
37 composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
38
39 - name: Execute tests
40 run: vendor/bin/pest
.github/workflows/tag-release.ymladded+23-0
Changes to .github/workflows/tag-release.yml
@@ -0,0 +1,23 @@
1name: Tag Release
2
3on:
4 push:
5 tags:
6 - "*"
7
8jobs:
9 tag-release:
10 name: "Tagged Release"
11 runs-on: ubuntu-latest
12
13 steps:
14 - name: Checkout
15 uses: actions/checkout@v2
16 with:
17 fetch-depth: 0
18
19 - name: Create Release
20 uses: "marvinpinto/action-automatic-releases@latest"
21 with:
22 repo_token: "$"
23 prerelease: false
.gitignoremodified+2-1
Changes to .gitignore
@@ -1,1 +1,2 @@
1/vendor⧵
1/vendor
2.env
.scrutinizer.ymladded+41-0
Changes to .scrutinizer.yml
@@ -0,0 +1,41 @@
1filter:
2 paths: [src/*]
3 excluded_paths: [tests/*]
4checks:
5 php:
6 code_rating: true
7 remove_extra_empty_lines: true
8 remove_php_closing_tag: true
9 remove_trailing_whitespace: true
10 fix_use_statements:
11 remove_unused: true
12 preserve_multiple: false
13 preserve_blanklines: true
14 order_alphabetically: true
15 fix_php_opening_tag: true
16 fix_linefeed: true
17 fix_line_ending: true
18 fix_identation_4spaces: true
19 fix_doc_comments: true
20tools:
21 external_code_coverage:
22 timeout: 600
23 runs: 3
24 php_code_coverage: false
25 php_code_sniffer:
26 config:
27 standard: PSR2
28 filter:
29 paths: ['src']
30 php_loc:
31 enabled: true
32 excluded_dirs: [vendor, test]
33 php_cpd:
34 enabled: true
35 excluded_dirs: [vendor, test]
36build:
37 nodes:
38 analysis:
39 tests:
40 override:
41 - php-scrutinizer-run
.styleci.ymladded+4-0
Changes to .styleci.yml
@@ -0,0 +1,4 @@
1preset: laravel
2
3disabled:
4 - single_class_element_per_statement
CHANGELOG.mdadded+7-0
Changes to CHANGELOG.md
@@ -0,0 +1,7 @@
1# Changelog
2
3All notable changes to `meema-client-php` will be documented in this file.
4
5## 1.0.0 - 2021-xx-xx
6
7- initial release
CODE_OF_CONDUCT.mdadded+46-0
Changes to CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
1# Contributor Covenant Code of Conduct
2
3## Our Pledge
4
5In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
7## Our Standards
8
9Examples of behavior that contributes to creating a positive environment include:
10
11* Using welcoming and inclusive language
12* Being respectful of differing viewpoints and experiences
13* Gracefully accepting constructive criticism
14* Focusing on what is best for the community
15* Showing empathy towards other community members
16
17Examples of unacceptable behavior by participants include:
18
19* The use of sexualized language or imagery and unwelcome sexual attention or advances
20* Trolling, insulting/derogatory comments, and personal or political attacks
21* Public or private harassment
22* Publishing others' private information, such as a physical or electronic address, without explicit permission
23* Other conduct which could reasonably be considered inappropriate in a professional setting
24
25## Our Responsibilities
26
27Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
29Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
31## Scope
32
33This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
35## Enforcement
36
37Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at rigel20.kent@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
39Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
41## Attribution
42
43This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
45[homepage]: http://contributor-covenant.org
46[version]: http://contributor-covenant.org/version/1/4/
CONTRIBUTING.mdadded+55-0
Changes to CONTRIBUTING.md
@@ -0,0 +1,55 @@
1# Contributing
2
3Contributions are **welcome** and will be fully **credited**.
4
5Please read and understand the contribution guide before creating an issue or pull request.
6
7## Etiquette
8
9This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11extremely unfair for them to suffer abuse or anger for their hard work.
12
13Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14world that developers are civilized and selfless people.
15
16It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18
19## Viability
20
21When requesting or submitting new features, first consider whether it might be useful to others. Open
22source projects are used by many developers, who may have entirely different needs to your own. Think about
23whether or not your feature is likely to be used by other users of the project.
24
25## Procedure
26
27Before filing an issue:
28
29- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30- Check to make sure your feature suggestion isn't already present within the project.
31- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32- Check the pull requests tab to ensure that the feature isn't already in progress.
33
34Before submitting a pull request:
35
36- Check the codebase to ensure that your feature doesn't already exist.
37- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38
39## Requirements
40
41If the project maintainer has any additional requirements, you will find them listed here.
42
43- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
44
45- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
46
47- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48
49- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
50
51- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52
53- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
54
55**Happy coding**!
LICENSE.mdadded+21-0
Changes to LICENSE.md
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) Meema, Inc.
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE.
README.mdmodified+53-33
Changes to README.md
@@ -1,49 +1,69 @@
1# Coming Soon - Meema.io API
1<p align="center">
2 <a href="https://meema.io">
3 <img alt="Meema for PHP" src="https://raw.githubusercontent.com/meema/meemasearch-client-common/master/banners/php.png" >
4 </a>
25
3This package contains a [Flysystem](https://flysystem.thephpleague.com/) adapter for Meema. Under the hood, the Meema API is used.
6<h4 align="center">The most simple way to integrate <a href="https://meema.io" target="_blank">Meema</a> and your PHP project</h4>
47
5## Installation
8<p align="center">
9 <a href="https://scrutinizer-ci.com/g/meemalabs/meema-client-php/badges/quality-score.png?b=main"><img src="https://scrutinizer-ci.com/g/meemalabs/meema-client-php/badges/quality-score.png?b=main" alt="Scrutinizer" /></a>
10 <a href="https://packagist.org/packages/meema/meema-client-php"><img src="https://poser.pugx.org/meema/meema-client-php/d/total.svg" alt="Total Downloads"></a>
11 <a href="https://packagist.org/packages/meema/meema-client-php"><img src="https://poser.pugx.org/meema/meema-client-php/v/stable.svg" alt="Latest Version"></a>
12 <a href="https://packagist.org/packages/meema/meema-client-php"><img src="https://poser.pugx.org/meema/meema-client-php/license.svg" alt="License"></a>
13</p>
614
7You can install the package via composer:
15<p align="center">
16 <a href="https://www.meema.com/doc/api-client/getting-started/install/php/" target="_blank">Documentation</a> •
17 <a href="https://github.com/meema/laravel-meema" target="_blank">Laravel</a> •
18 <a href="http://stackoverflow.com/questions/tagged/meema" target="_blank">Stack Overflow</a> •
19 <a href="https://github.com/meema/meema-client-php/issues" target="_blank">Report a bug</a> •
20 <a href="https://meema.io/docs" target="_blank">FAQ</a> •
21 <a href="https://meema.io/support" target="_blank">Support</a>
22</p>
823
9``` bash
10composer require meemaio/meema-api
11```
12
13## Usage
24## 🐑 Features
1425
15The first thing you need to do is get an authorization token at Meema.io. A token can be generated in the [App Console](https://meema.io/) for any Meema API app.
26- Thin & minimal low-level HTTP client to interact with Meema's API
27- Supports php `^5.*`.
1628
17``` php
18use League\Flysystem\Filesystem;
19use Meema\Client;
20use Meema\FlysystemMeema\MeemaAdapter;
29## 💡 Usage
2130
22$client = new Client($authorizationToken);
31First, install Meema PHP API Client via the [composer](https://getcomposer.org/) package manager:
2332
24$adapter = new MeemaAdapter($client);
25
26$filesystem = new Filesystem($adapter);
33```bash
34composer require meema/meema-client-php
2735```
2836
29## Changelog
30
31Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
32
33## Testing
34
35``` bash
36composer test
37Then, wip
38
39```php
40$client->folders()->get([1, 2, 3]);
41$client->folders()->delete(1, 2, 3);
42$client->folders(1)->update(['name' = 'New Folder Name']);
43$client->folders([1, 2, 3])->media()->get();
44$client->tags()->get();
45$client->tags()->delete(1, 2, 3);
46$client->tags(1)->update(['name' = 'New Tag Name']);
47$client->tags([1, 2, 3])->media()->get();
48// need to the same for following resources
49$client->favorites()->get();
50$client->media()->get();
51$client->teams()->get();
52
53$client->media()->get();
54$client->media()->search($q);
55$client->media()->metadata()->get();
56
57$client->folders()->get();
58$client->folders()->search($q);
3759```
3860
39## Contributing
40
41Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
61For the full documentation, visit the **[Meema PHP API Client](https://meema.io/docs/)**.
4262
43## Security
63## ❓ Troubleshooting
4464
45If you discover any security related issues, please email chris@cion.agency instead of using the issue tracker.
65Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://meema.io/docs/) where you will find answers for the most common issues and gotchas with the client.
4666
47## License
67## 📄 License
4868
49The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
69Meema PHP API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).
src/Client.phpmodified+27-14
Changes to src/Client.php
@@ -2,7 +2,9 @@
22
33namespace Meema\MeemaApi;
44
5use Dotenv\Dotenv;
56use GuzzleHttp\Client as GuzzleClient;
7use Meema\MeemaApi\Models\Folder;
68
79class Client
810{
@@ -23,19 +25,30 @@ class Client
2325 */
2426 public function __construct($accessKey)
2527 {
28 $this->initializeEnv();
29
2630 $this->accessKey = $accessKey;
2731 $this->client = new GuzzleClient([
28 'base_uri' => 'http://127.0.0.1:8000/api/',
32 'base_uri' => $_ENV['BASE_URL'] ?? 'https://api.mee.ma',
2933 ]);
3034 }
src/Client.php:34
  1. harlekoySun Oct 25 2026 00:09:39 GMT+0000 (Coordinated Universal Time)

    @glennmichael123 can you set it to our prod API URL? Something like https://meema.io/api

    @Chris1904 what's our prod API URL by the way? is it https://meema.io/api or https://api.meema.io?

    @glennmichael123 Also lets add the phpdotenv package. So that you can set your local URL.

  2. chrisSun Oct 25 2026 00:09:39 GMT+0000 (Coordinated Universal Time)

    Our prod API URL will be: https://api.mee.ma

3135
36 /**
37 * Initialize env variables.
src/Client.php:37
  1. harlekoySun Oct 25 2026 00:09:39 GMT+0000 (Coordinated Universal Time)

    A third party package should always set a default url for there API lets use the prod url

  2. harlekoySun Oct 25 2026 00:09:39 GMT+0000 (Coordinated Universal Time)

    $_ENV['BASE_URL'] ?? 'url'

38 *
39 * @return void
40 */
41 public function initializeEnv(): void
42 {
43 $dotenv = Dotenv::createImmutable(dirname(__DIR__));
44 $dotenv->load();
45 }
46
3247 /**
3348 * Handle the API request.
3449 *
3550 * @param string $method
3651 * @param string $path
37 *
38 * @return array
3952 */
4053 public function request($method, $path, $data = null)
4154 {
@@ -45,7 +58,9 @@ class Client
4558 'Content-Type' => 'application/json',
4659 'Authorization' => "Bearer {$this->accessKey}",
4760 ],
48 ])->getBody()->getContents();
61 ])
62 ->getBody()
63 ->getContents();
4964
5065 return json_decode($content, true);
5166 }
@@ -61,24 +76,22 @@ class Client
6176 }
6277
6378 /**
64 * List folders.
79 * Get the access key.
6580 *
66 * @return array
81 * @return string
6782 */
68 public function listFolders()
83 public function getAccessKey(): string
6984 {
70 return $this->request('GET', 'folders');
85 return $this->accessKey;
7186 }
src/Client.php:86
  1. harlekoySun Oct 25 2026 00:09:39 GMT+0000 (Coordinated Universal Time)

    @glennmichael123 I think the ID is not needed here already right? If we will follow the convention $client->folders()->get(1)

7287
7388 /**
74 * Create folder.
75 *
76 * @param string $name
89 * Initialize the folder model.
7790 *
78 * @return array
91 * @return Meema\MeemaApi\Models\Folder
7992 */
80 public function createFolder($name)
93 public function folders(): Folder
8194 {
82 return $this->request('POST', 'folders', compact('name'));
95 return new Folder($this);
8396 }
8497}
src/Models/Folder.phpadded+125-0
Changes to src/Models/Folder.php
@@ -0,0 +1,125 @@
1<?php
2
3namespace Meema\MeemaApi\Models;
4
5use Meema\MeemaApi\Client;
6
7class Folder
8{
9 /**
10 * @var Meema\MeemaApi\Client
11 */
12 public $client;
13
14 /**
15 * @var int
16 */
17 public $id;
18
19 /**
20 * Construct Folder model.
21 *
22 * @param Meema\MeemaApi\Client $client
23 */
24 public function __construct(Client $client)
25 {
26 $this->client = $client;
27 }
28
29 /**
30 * List all folders.
31 *
32 * @return array
33 */
34 public function all(): array
35 {
36 return $this->client->request('GET', 'folders');
37 }
38
39 /**
40 * Get specific folders.
41 *
42 * @return array
43 */
44 public function get($id = null)
45 {
46 if (! $id) {
47 return $this->all();
48 }
49
50 $ids = is_array($id) ? $id : func_get_args();
51
52 return $this->client->request('GET', 'folders/show', ['folder_ids' => $ids]);
53 }
54
55 /**
56 * Create folder.
57 *
58 * @param string $name
59 *
60 * @return array
61 */
62 public function create($name): array
63 {
64 $name = is_array($name) ? $name : compact('name');
65
66 return $this->client->request('POST', "folders/{$this->client->getAccessKey()}", $name);
67 }
68
69 /**
70 * Update folder.
71 *
72 * @param int $id
73 * @param string $name
74 *
75 * @return array
76 */
77 public function update($id, $name): array
78 {
79 $name = is_array($name) ? $name : compact('name');
80
81 return $this->client->request('PATCH', "folders/{$id}", $name);
82 }
83
84 /**
85 * Delete a folder.
86 *
87 * @param int|array $id
88 *
89 * @return null
90 */
91 public function delete($id)
92 {
93 return $this->client->request('DELETE', "folders/{$id}");
94 }
95
96 /**
97 * Archive a folder.
98 *
99 * @return array
100 */
101 public function archive($id): array
102 {
103 return $this->client->request('POST', "folders/{$id}/archive");
104 }
105
106 /**
107 * Unarchive a folder.
108 *
109 * @return array
110 */
111 public function unarchive($id): array
112 {
113 return $this->client->request('POST', "folders/{$id}/unarchive");
114 }
115
116 /**
117 * Duplicate a folder.
118 *
119 * @return array
120 */
121 public function duplicate($id): array
122 {
123 return $this->client->request('POST', "folders/{$id}/duplicate");
124 }
125}