event_name field on a meter.
* @property string $identifier A unique identifier for the event.
* @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
* @property \Stripe\StripeObject $payload The payload of the event. This contains the fields corresponding to a meter's customer_mapping.event_payload_key (default is stripe_customer_id) and value_settings.event_payload_key (default is value). Read more about the payload.
* @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
*/
class MeterEvent extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event';
/**
* Creates a billing meter event.
*
* @param null|array{event_name: string, expand?: string[], identifier?: string, payload: array, timestamp?: int} $params
* @param null|array|string $options
*
* @return MeterEvent the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
}