Skip to content

Commit 8553d36

Browse files
committed
Readme: document endpoints to manage bundles and bundle packages
1 parent 2aa3caf commit 8553d36

File tree

1 file changed

+81
-1
lines changed

1 file changed

+81
-1
lines changed

README.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
* [Grant a customer access to a package or edit the limitations](#grant-a-customer-access-to-a-package-or-edit-the-limitations)
4040
* [Revoke access to a package from a customer](#revoke-access-to-a-package-from-a-customer)
4141
* [Regenerate a customer's Composer repository token](#regenerate-a-customers-composer-repository-token)
42+
* [Vendor Bundle](#vendor-bundle)
43+
* [List an organization's vendor bundles](#list-an-organizations-vendor-bundles)
44+
* [Show a vendor bundle](#show-a-vendor-bundle)
45+
* [Create a vendor bundle](#create-a-vendor-bundle)
46+
* [Edit a customer](#edit-a-customer-1)
47+
* [Delete a vendor bundle](#delete-a-vendor-bundle)
48+
* [List packages in a vendor bundle](#list-packages-in-a-vendor-bundle)
49+
* [Add one or more packages to a vendor bundle or edit their limitations](#add-one-or-more-packages-to-a-vendor-bundle-or-edit-their-limitations)
50+
* [Remove a package from a vendor bundle](#remove-a-package-from-a-vendor-bundle)
4251
* [Subrepository](#subrepository)
4352
* [List an organization's subrepositories](#list-an-organizations-subrepositories)
4453
* [Show a subrepository](#show-a-subrepository)
@@ -114,7 +123,7 @@
114123
* [Validate incoming webhook payloads](#validate-incoming-webhook-payloads)
115124
* [License](#license)
116125

117-
<!-- Added by: glaubinix, at: Tue 24 Jan 2023 14:03:21 GMT -->
126+
<!-- Added by: glaubinix, at: Thu 9 Feb 2023 15:12:39 GMT -->
118127

119128
<!--te-->
120129

@@ -414,6 +423,77 @@ $composerRepository = $client->customers()->regenerateToken($customerId, $confir
414423
```
415424
Returns the edited Composer repository.
416425

426+
### Vendor Bundle
427+
428+
#### List an organization's vendor bundles
429+
```php
430+
$vendorBundles = $client->vendorBundles()->all();
431+
```
432+
Returns an array of vendor bundles.
433+
434+
#### Show a vendor bundle
435+
```php
436+
$vendorBundleId = 42;
437+
$vendorBundle = $client->vendorBundles()->show($vendorBundleId);
438+
```
439+
Returns a single vendor bundle.
440+
441+
#### Create a vendor bundle
442+
```php
443+
$vendorBundle = $client->vendorBundles()->create('New bundle name');
444+
// or
445+
$vendorBundle = $client->vendorBundles()->create('New bundle name', 'dev', '^1.0', true, [123]);
446+
```
447+
Returns the vendor bundle.
448+
449+
#### Edit a customer
450+
```php
451+
$vendorBundleId = 42;
452+
$vendorBundleData = [
453+
'name' => 'Bundle name',
454+
'minimumAccessibleStability' => 'dev',
455+
'versionConstraint' => '^1.0',
456+
'assignAllPackages' => true,
457+
'synchronizationIds' => [123], // A list of synchronization ids for which new packages should automatically be added to the bundle.
458+
];
459+
$vendorBundle = $client->vendorBundles()->edit($vendorBundleId, $vendorBundleData);
460+
```
461+
Returns the vendor bundle.
462+
463+
#### Delete a vendor bundle
464+
```php
465+
$vendorBundleId = 42;
466+
$client->vendorBundles()->remove($vendorBundleId);
467+
```
468+
469+
#### List packages in a vendor bundle
470+
```php
471+
$vendorBundleId = 42;
472+
$packages = $client->vendorBundles()->packages()->listPackages($vendorBundleId);
473+
```
474+
Returns an array of vendor bundle packages.
475+
476+
#### Add one or more packages to a vendor bundle or edit their limitations
477+
```php
478+
$vendorBundleId = 42;
479+
$packages = [
480+
[
481+
'name' => 'acme-website/package',
482+
'versionConstraint' => '^1.0 | ^2.0', // optional version constraint to limit updates the customer receives
483+
'minimumAccessibleStability' => 'beta', // optional stability to restrict customers to specific package version stabilities like alpha, beta, or RC
484+
],
485+
];
486+
$packages = $client->vendorBundles()->packages()->addOrEditPackages($vendorBundleId, $packages);
487+
```
488+
Returns an array of all added or edited customer packages.
489+
490+
#### Remove a package from a vendor bundle
491+
```php
492+
$vendorBundleId = 42;
493+
$packageName = 'acme-website/package';
494+
$client->vendorBundles()->packages()->removePackage($vendorBundleId, $packageName);
495+
```
496+
417497
### Subrepository
418498

419499
#### List an organization's subrepositories

0 commit comments

Comments
 (0)