Skip to content

Commit

Permalink
Update generated code for v423
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Jul 18, 2023
1 parent 1a26bd6 commit 16d8cd9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v422
v423
90 changes: 45 additions & 45 deletions lib/Service/QuoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,57 +93,56 @@ public function allLines($id, $params = null, $opts = null)
}

/**
* Cancels the quote.
* Preview the invoice line items that would be generated by accepting the quote.
*
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Quote
* @return \Stripe\Collection<\Stripe\InvoiceLineItem>
*/
public function cancel($id, $params = null, $opts = null)
public function allPreviewInvoiceLines($parentId, $id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts);
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices/%s/lines', $parentId, $id), $params, $opts);
}

/**
* A quote models prices and services for a customer. Default options for
* <code>header</code>, <code>description</code>, <code>footer</code>, and
* <code>expires_at</code> can be set in the dashboard via the <a
* href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
* Preview the invoices that would be generated by accepting the quote.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Quote
* @return \Stripe\Collection<\Stripe\Invoice>
*/
public function create($params = null, $opts = null)
public function allPreviewInvoices($id, $params = null, $opts = null)
{
return $this->request('post', '/v1/quotes', $params, $opts);
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices', $id), $params, $opts);
}

/**
* Converts a stale quote to draft.
* Preview the schedules that would be generated by accepting the quote.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Quote
* @return \Stripe\Collection<\Stripe\SubscriptionSchedule>
*/
public function draftQuote($id, $params = null, $opts = null)
public function allPreviewSubscriptionSchedules($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_draft', $id), $params, $opts);
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_subscription_schedules', $id), $params, $opts);
}

/**
* Finalizes the quote.
* Cancels the quote.
*
* @param string $id
* @param null|array $params
Expand All @@ -153,96 +152,97 @@ public function draftQuote($id, $params = null, $opts = null)
*
* @return \Stripe\Quote
*/
public function finalizeQuote($id, $params = null, $opts = null)
public function cancel($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts);
return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts);
}

/**
* Converts a draft or open quote to stale.
* A quote models prices and services for a customer. Default options for
* <code>header</code>, <code>description</code>, <code>footer</code>, and
* <code>expires_at</code> can be set in the dashboard via the <a
* href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Quote
*/
public function markStaleQuote($id, $params = null, $opts = null)
public function create($params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_stale', $id), $params, $opts);
return $this->request('post', '/v1/quotes', $params, $opts);
}

/**
* Download the PDF for a finalized quote.
* Converts a stale quote to draft.
*
* @param string $id
* @param callable $readBodyChunkCallable
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return mixed
* @return \Stripe\Quote
*/
public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
public function draftQuote($id, $params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (!isset($opts->apiBase)) {
$opts->apiBase = $this->getClient()->getFilesBase();
}

return $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts);
return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_draft', $id), $params, $opts);
}

/**
* Preview the invoice line items that would be generated by accepting the quote.
* Finalizes the quote.
*
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\InvoiceLineItem>
* @return \Stripe\Quote
*/
public function previewInvoiceLines($parentId, $id, $params = null, $opts = null)
public function finalizeQuote($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices/%s/lines', $parentId, $id), $params, $opts);
return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts);
}

/**
* Preview the invoices that would be generated by accepting the quote.
* Converts a draft or open quote to stale.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Invoice>
* @return \Stripe\Quote
*/
public function previewInvoices($id, $params = null, $opts = null)
public function markStaleQuote($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices', $id), $params, $opts);
return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_stale', $id), $params, $opts);
}

/**
* Preview the schedules that would be generated by accepting the quote.
* Download the PDF for a finalized quote.
*
* @param string $id
* @param callable $readBodyChunkCallable
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\SubscriptionSchedule>
* @return mixed
*/
public function previewSubscriptionSchedules($id, $params = null, $opts = null)
public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_subscription_schedules', $id), $params, $opts);
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (!isset($opts->apiBase)) {
$opts->apiBase = $this->getClient()->getFilesBase();
}

return $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4036,13 +4036,13 @@ public function testListLineItemsCalculation()
static::assertInstanceOf(\Stripe\Tax\CalculationLineItem::class, $result->data[0]);
}

public function testPreviewInvoiceLinesQuote()
public function testListPreviewInvoiceLinesQuote()
{
$this->expectsRequest(
'get',
'/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines'
);
$result = $this->client->quotes->previewInvoiceLines(
$result = $this->client->quotes->allPreviewInvoiceLines(
'qt_xyz',
'in_xyz',
[]
Expand Down

0 comments on commit 16d8cd9

Please sign in to comment.