Skip to content

Commit 86628e2

Browse files
Merge pull request #766 from recurly/v3-v2021-02-25-1684878505
Generated Latest Changes for v2021-02-25 (External Products & References)
2 parents c47b0b7 + c33a1bf commit 86628e2

File tree

3 files changed

+522
-0
lines changed

3 files changed

+522
-0
lines changed

lib/recurly/client.php

+115
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,21 @@ public function listExternalProducts(array $options = []): \Recurly\Pager
16201620
return new \Recurly\Pager($this, $path, $options);
16211621
}
16221622

1623+
/**
1624+
* Create an external product
1625+
*
1626+
* @param array $body The body of the request.
1627+
* @param array $options Associative array of optional parameters
1628+
*
1629+
* @return \Recurly\Resources\ExternalProduct Returns the external product
1630+
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_external_product
1631+
*/
1632+
public function createExternalProduct(array $body, array $options = []): \Recurly\Resources\ExternalProduct
1633+
{
1634+
$path = $this->interpolatePath("/external_products", []);
1635+
return $this->makeRequest('POST', $path, $body, $options);
1636+
}
1637+
16231638
/**
16241639
* Fetch an external product
16251640
*
@@ -1635,6 +1650,106 @@ public function getExternalProduct(string $external_product_id, array $options =
16351650
return $this->makeRequest('GET', $path, [], $options);
16361651
}
16371652

1653+
/**
1654+
* Update an external product
1655+
*
1656+
* @param string $external_product_id External product id
1657+
* @param array $body The body of the request.
1658+
* @param array $options Associative array of optional parameters
1659+
*
1660+
* @return \Recurly\Resources\ExternalProduct Settings for an external product.
1661+
* @link https://developers.recurly.com/api/v2021-02-25#operation/update_external_product
1662+
*/
1663+
public function updateExternalProduct(string $external_product_id, array $body, array $options = []): \Recurly\Resources\ExternalProduct
1664+
{
1665+
$path = $this->interpolatePath("/external_products/{external_product_id}", ['external_product_id' => $external_product_id]);
1666+
return $this->makeRequest('PUT', $path, $body, $options);
1667+
}
1668+
1669+
/**
1670+
* Deactivate an external product
1671+
*
1672+
* @param string $external_product_id External product id
1673+
* @param array $options Associative array of optional parameters
1674+
*
1675+
* @return \Recurly\Resources\ExternalProduct Deactivated external product.
1676+
* @link https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_products
1677+
*/
1678+
public function deactivateExternalProducts(string $external_product_id, array $options = []): \Recurly\Resources\ExternalProduct
1679+
{
1680+
$path = $this->interpolatePath("/external_products/{external_product_id}", ['external_product_id' => $external_product_id]);
1681+
return $this->makeRequest('DELETE', $path, [], $options);
1682+
}
1683+
1684+
/**
1685+
* List the external product references for an external product
1686+
*
1687+
* @param string $external_product_id External product id
1688+
* @param array $options Associative array of optional parameters
1689+
*
1690+
* Supported optional query string parameters:
1691+
*
1692+
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
1693+
* order. In descending order updated records will move behind the cursor and could
1694+
* prevent some records from being returned.
1695+
*
1696+
* @return \Recurly\Pager A list of the the external product references for an external product.
1697+
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_external_product_external_product_references
1698+
*/
1699+
public function listExternalProductExternalProductReferences(string $external_product_id, array $options = []): \Recurly\Pager
1700+
{
1701+
$path = $this->interpolatePath("/external_products/{external_product_id}/external_product_references", ['external_product_id' => $external_product_id]);
1702+
return new \Recurly\Pager($this, $path, $options);
1703+
}
1704+
1705+
/**
1706+
* Create an external product reference on an external product
1707+
*
1708+
* @param string $external_product_id External product id
1709+
* @param array $body The body of the request.
1710+
* @param array $options Associative array of optional parameters
1711+
*
1712+
* @return \Recurly\Resources\ExternalProductReferenceMini Details for the external product reference.
1713+
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_external_product_external_product_reference
1714+
*/
1715+
public function createExternalProductExternalProductReference(string $external_product_id, array $body, array $options = []): \Recurly\Resources\ExternalProductReferenceMini
1716+
{
1717+
$path = $this->interpolatePath("/external_products/{external_product_id}/external_product_references", ['external_product_id' => $external_product_id]);
1718+
return $this->makeRequest('POST', $path, $body, $options);
1719+
}
1720+
1721+
/**
1722+
* Fetch an external product reference
1723+
*
1724+
* @param string $external_product_id External product id
1725+
* @param string $external_product_reference_id External product reference ID, e.g. `d39iun2fw1v4`.
1726+
* @param array $options Associative array of optional parameters
1727+
*
1728+
* @return \Recurly\Resources\ExternalProductReferenceMini Details for an external product reference.
1729+
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_external_product_external_product_reference
1730+
*/
1731+
public function getExternalProductExternalProductReference(string $external_product_id, string $external_product_reference_id, array $options = []): \Recurly\Resources\ExternalProductReferenceMini
1732+
{
1733+
$path = $this->interpolatePath("/external_products/{external_product_id}/external_product_references/{external_product_reference_id}", ['external_product_id' => $external_product_id, 'external_product_reference_id' => $external_product_reference_id]);
1734+
return $this->makeRequest('GET', $path, [], $options);
1735+
}
1736+
1737+
/**
1738+
* Deactivate an external product reference
1739+
*
1740+
* @param string $external_product_id External product id
1741+
* @param string $external_product_reference_id External product reference ID, e.g. `d39iun2fw1v4`.
1742+
* @param array $options Associative array of optional parameters
1743+
*
1744+
* @return \Recurly\Resources\ExternalProductReferenceMini Details for an external product reference.
1745+
* @link https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_product_external_product_reference
1746+
*/
1747+
public function deactivateExternalProductExternalProductReference(string $external_product_id, string $external_product_reference_id, array $options = []): \Recurly\Resources\ExternalProductReferenceMini
1748+
{
1749+
$path = $this->interpolatePath("/external_products/{external_product_id}/external_product_references/{external_product_reference_id}", ['external_product_id' => $external_product_id, 'external_product_reference_id' => $external_product_reference_id]);
1750+
return $this->makeRequest('DELETE', $path, [], $options);
1751+
}
1752+
16381753
/**
16391754
* List a site's external subscriptions
16401755
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?php
2+
/**
3+
* This file is automatically created by Recurly's OpenAPI generation process
4+
* and thus any edits you make by hand will be lost. If you wish to make a
5+
* change to this file, please create a Github issue explaining the changes you
6+
* need and we will usher them to the appropriate places.
7+
*/
8+
namespace Recurly\Resources;
9+
10+
use Recurly\RecurlyResource;
11+
12+
// phpcs:disable
13+
class ExternalProductReferenceCollection extends RecurlyResource
14+
{
15+
private $_data;
16+
private $_has_more;
17+
private $_next;
18+
private $_object;
19+
20+
protected static $array_hints = [
21+
'setData' => '\Recurly\Resources\ExternalProductReferenceMini',
22+
];
23+
24+
25+
/**
26+
* Getter method for the data attribute.
27+
*
28+
*
29+
* @return array
30+
*/
31+
public function getData(): array
32+
{
33+
return $this->_data ?? [] ;
34+
}
35+
36+
/**
37+
* Setter method for the data attribute.
38+
*
39+
* @param array $data
40+
*
41+
* @return void
42+
*/
43+
public function setData(array $data): void
44+
{
45+
$this->_data = $data;
46+
}
47+
48+
/**
49+
* Getter method for the has_more attribute.
50+
* Indicates there are more results on subsequent pages.
51+
*
52+
* @return ?bool
53+
*/
54+
public function getHasMore(): ?bool
55+
{
56+
return $this->_has_more;
57+
}
58+
59+
/**
60+
* Setter method for the has_more attribute.
61+
*
62+
* @param bool $has_more
63+
*
64+
* @return void
65+
*/
66+
public function setHasMore(bool $has_more): void
67+
{
68+
$this->_has_more = $has_more;
69+
}
70+
71+
/**
72+
* Getter method for the next attribute.
73+
* Path to subsequent page of results.
74+
*
75+
* @return ?string
76+
*/
77+
public function getNext(): ?string
78+
{
79+
return $this->_next;
80+
}
81+
82+
/**
83+
* Setter method for the next attribute.
84+
*
85+
* @param string $next
86+
*
87+
* @return void
88+
*/
89+
public function setNext(string $next): void
90+
{
91+
$this->_next = $next;
92+
}
93+
94+
/**
95+
* Getter method for the object attribute.
96+
* Will always be List.
97+
*
98+
* @return ?string
99+
*/
100+
public function getObject(): ?string
101+
{
102+
return $this->_object;
103+
}
104+
105+
/**
106+
* Setter method for the object attribute.
107+
*
108+
* @param string $object
109+
*
110+
* @return void
111+
*/
112+
public function setObject(string $object): void
113+
{
114+
$this->_object = $object;
115+
}
116+
}

0 commit comments

Comments
 (0)