import * as location from "./location" ; import { ManagedServer } from "./server" ; export class Region implements location . CloudLocation { private static readonly LOCATION_MAP : { readonly [ cityId ] : location . GeoLocation ; } = { 'ams' : location . AMSTERDAM , 'blr' : location . BANGALORE , 'fra' : location . FRANKFURT , 'lon' : location . LONDON , 'nyc' : location . NEW_YORK_CITY , 'sfo' : location . SAN_FRANCISCO , 'sgp' : location . SINGAPORE , 'tor' : location . TORONTO , } ; constructor ( public readonly id ) { } get location ( ) : location . GeoLocation { return Region . LOCATION_MAP [ this . id . substr ( 0 , 3 ) . toLowerCase ( ) ] ; } } export interface RegionOption extends location . CloudLocationOption { readonly cloudLocation : Region ; } export enum Status { ACTIVE , EMAIL_UNVERIFIED , MISSING_BILLING_INFORMATION } export interface Account { getId ( ) : string ; getName ( ) : Promise < string > ; getStatus ( ) : Promise < Status > ; listServers ( fetchFromHost ? ) : Promise < ManagedServer [ ] > ; listLocations ( ) : Promise < Readonly < RegionOption [ ] > > ; createServer ( region , name ) : Promise < ManagedServer > ; }