@@ -1620,6 +1620,21 @@ public function listExternalProducts(array $options = []): \Recurly\Pager
1620
1620
return new \Recurly \Pager ($ this , $ path , $ options );
1621
1621
}
1622
1622
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
+
1623
1638
/**
1624
1639
* Fetch an external product
1625
1640
*
@@ -1635,6 +1650,106 @@ public function getExternalProduct(string $external_product_id, array $options =
1635
1650
return $ this ->makeRequest ('GET ' , $ path , [], $ options );
1636
1651
}
1637
1652
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
+
1638
1753
/**
1639
1754
* List a site's external subscriptions
1640
1755
*
0 commit comments