| 1 |
<?php |
| 2 |
|
| 3 |
// File generated from our OpenAPI spec |
| 4 |
|
| 5 |
namespace Stripe\Apps; |
| 6 |
|
| 7 |
/** |
| 8 |
* Secret Store is an API that allows Stripe Apps developers to securely persist |
| 9 |
* secrets for use by UI Extensions and app backends. |
| 10 |
* |
| 11 |
* The primary resource in Secret Store is a <code>secret</code>. Other apps can't |
| 12 |
* view secrets created by an app. Additionally, secrets are scoped to provide |
| 13 |
* further permission control. |
| 14 |
* |
| 15 |
* All Dashboard users and the app backend share <code>account</code> scoped |
| 16 |
* secrets. Use the <code>account</code> scope for secrets that don't change |
| 17 |
* per-user, like a third-party API key. |
| 18 |
* |
| 19 |
* A <code>user</code> scoped secret is accessible by the app backend and one |
| 20 |
* specific Dashboard user. Use the <code>user</code> scope for per-user secrets |
| 21 |
* like per-user OAuth tokens, where different users might have different |
| 22 |
* permissions. |
| 23 |
* |
| 24 |
* Related guide: <a |
| 25 |
* href="https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects">Store |
| 26 |
* data between page reloads</a>. |
| 27 |
* |
| 28 |
* @property string $id Unique identifier for the object. |
| 29 |
* @property string $object String representing the object's type. Objects of the same type share the same value. |
| 30 |
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 31 |
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. |
| 32 |
* @property string $name A name for the secret that's unique within the scope. |
| 33 |
* @property null|string $payload The plaintext secret value to be stored. |
| 34 |
* @property \Stripe\StripeObject $scope |
| 35 |
*/ |
| 36 |
class Secret extends \Stripe\ApiResource |
| 37 |
{ |
| 38 |
const OBJECT_NAME = 'apps.secret'; |
| 39 |
|
| 40 |
use \Stripe\ApiOperations\All; |
| 41 |
use \Stripe\ApiOperations\Create; |
| 42 |
|
| 43 |
/** |
| 44 |
* @param null|array $params |
| 45 |
* @param null|array|string $opts |
| 46 |
* |
| 47 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 48 |
* |
| 49 |
* @return \Stripe\Apps\Secret the deleted secret |
| 50 |
*/ |
| 51 |
public static function deleteWhere($params = null, $opts = null) |
| 52 |
{ |
| 53 |
$url = static::classUrl() . '/delete'; |
| 54 |
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); |
| 55 |
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 56 |
$obj->setLastResponse($response); |
| 57 |
|
| 58 |
return $obj; |
| 59 |
} |
| 60 |
|
| 61 |
/** |
| 62 |
* @param null|array $params |
| 63 |
* @param null|array|string $opts |
| 64 |
* |
| 65 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 66 |
* |
| 67 |
* @return \Stripe\Apps\Secret the finded secret |
| 68 |
*/ |
| 69 |
public static function find($params = null, $opts = null) |
| 70 |
{ |
| 71 |
$url = static::classUrl() . '/find'; |
| 72 |
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); |
| 73 |
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 74 |
$obj->setLastResponse($response); |
| 75 |
|
| 76 |
return $obj; |
| 77 |
} |
| 78 |
} |
| 79 |
|