// File generated from our OpenAPI spec declare module 'stripe' { namespace Stripe { namespace TestHelpers { /** * A test clock enables deterministic control over objects in testmode. With a test clock, you can create * objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, * you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. */ interface TestClock { /** * Unique identifier for the object. */ id: string; /** * String representing the object's type. Objects of the same type share the same value. */ object: 'test_helpers.test_clock'; /** * Time at which the object was created. Measured in seconds since the Unix epoch. */ created: number; deleted?: void; /** * Time at which this clock is scheduled to auto delete. */ deletes_after: number; /** * Time at which all objects belonging to this clock are frozen. */ frozen_time: number; /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ livemode: boolean; /** * The custom name supplied at creation. */ name: string | null; /** * The status of the Test Clock. */ status: TestClock.Status; } namespace TestClock { type Status = 'advancing' | 'internal_failure' | 'ready'; } /** * The DeletedTestClock object. */ interface DeletedTestClock { /** * Unique identifier for the object. */ id: string; /** * String representing the object's type. Objects of the same type share the same value. */ object: 'test_helpers.test_clock'; /** * Always true for a deleted object */ deleted: true; } interface TestClockCreateParams { /** * The initial frozen time for this test clock. */ frozen_time: number; /** * Specifies which fields in the response should be expanded. */ expand?: Array; /** * The name for this test clock. */ name?: string; } interface TestClockRetrieveParams { /** * Specifies which fields in the response should be expanded. */ expand?: Array; } interface TestClockListParams extends PaginationParams { /** * Specifies which fields in the response should be expanded. */ expand?: Array; } interface TestClockDeleteParams {} interface TestClockAdvanceParams { /** * The time to advance the test clock. Must be after the test clock's current frozen time. Cannot be more than two intervals in the future from the shortest subscription in this test clock. If there are no subscriptions in this test clock, it cannot be more than two years in the future. */ frozen_time: number; /** * Specifies which fields in the response should be expanded. */ expand?: Array; } class TestClocksResource { /** * Creates a new test clock that can be attached to new customers and quotes. */ create( params: TestClockCreateParams, options?: RequestOptions ): Promise>; /** * Retrieves a test clock. */ retrieve( id: string, params?: TestClockRetrieveParams, options?: RequestOptions ): Promise>; retrieve( id: string, options?: RequestOptions ): Promise>; /** * Returns a list of your test clocks. */ list( params?: TestClockListParams, options?: RequestOptions ): ApiListPromise; list( options?: RequestOptions ): ApiListPromise; /** * Deletes a test clock. */ del( id: string, params?: TestClockDeleteParams, options?: RequestOptions ): Promise>; del( id: string, options?: RequestOptions ): Promise>; /** * Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. */ advance( id: string, params: TestClockAdvanceParams, options?: RequestOptions ): Promise>; } } } }