-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathregions.ts
More file actions
57 lines (49 loc) · 1.47 KB
/
regions.ts
File metadata and controls
57 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import * as Shared from './shared';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class Regions extends APIResource {
/**
* To list all of the regions that are available, send a GET request to
* `/v2/regions`. The response will be a JSON object with a key called `regions`.
* The value of this will be an array of `region` objects, each of which will
* contain the standard region attributes.
*
* @example
* ```ts
* const regions = await client.regions.list();
* ```
*/
list(
query: RegionListParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<RegionListResponse> {
return this._client.get('/v2/regions', {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
}
export interface RegionListResponse {
/**
* Information about the response itself.
*/
meta: Shared.MetaProperties;
regions: Array<Shared.Region>;
links?: Shared.PageLinks;
}
export interface RegionListParams {
/**
* Which 'page' of paginated results to return.
*/
page?: number;
/**
* Number of items returned per page
*/
per_page?: number;
}
export declare namespace Regions {
export { type RegionListResponse as RegionListResponse, type RegionListParams as RegionListParams };
}