Skip to content

Commit

Permalink
Update generated code for v419
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Jul 14, 2023
1 parent 08cca01 commit 04986e6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
37 changes: 19 additions & 18 deletions lib/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,6 @@ class Quote extends ApiResource
const STATUS_DRAFT = 'draft';
const STATUS_OPEN = 'open';

/**
* @param callable $readBodyChunkCallable
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function pdf($readBodyChunkCallable, $params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (null === $opts->apiBase) {
$opts->apiBase = Stripe::$apiUploadBase;
}

$url = $this->instanceUrl() . '/pdf';
$this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts);
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down Expand Up @@ -167,4 +149,23 @@ public static function allLineItems($id, $params = null, $opts = null)

return $obj;
}

/**
* @param callable $readBodyChunkCallable
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return void
*/
public function pdf($readBodyChunkCallable, $params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (!isset($opts->apiBase)) {
$opts->apiBase = Stripe::$apiUploadBase;
}
$url = $this->instanceUrl() . '/pdf';
$this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts);
}
}
33 changes: 18 additions & 15 deletions lib/Service/QuoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,29 @@ public function finalizeQuote($id, $params = null, $opts = null)
}

/**
* Retrieves the quote with the given ID.
* 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\Quote
* @return mixed
*/
public function retrieve($id, $params = null, $opts = null)
public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/quotes/%s', $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);
}

/**
* A quote models prices and services for a customer.
* Retrieves the quote with the given ID.
*
* @param string $id
* @param null|array $params
Expand All @@ -151,27 +157,24 @@ public function retrieve($id, $params = null, $opts = null)
*
* @return \Stripe\Quote
*/
public function update($id, $params = null, $opts = null)
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
}

/**
* Download the PDF for a finalized quote.
* A quote models prices and services for a customer.
*
* @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\Quote
*/
public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
public function update($id, $params = null, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
if (!isset($opts->apiBase)) {
$opts->apiBase = $this->getClient()->getFilesBase();
}
$this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts);
return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
}
}

0 comments on commit 04986e6

Please sign in to comment.