import { Region } from '../../types/region' ; import { AccountDto , ActiveShardDto } from '../../types/riot/ACCOUNT-V1' ; import Controller from '../Controller' ; import { Regions } from '../Regions' ; export interface AccountV1 { description remark remark returns A promise containing the ACCOUNT-V1 API Response: ` AccountDto `
     *
     *  https getAccountByPuuid ( puuid ) : Promise < AccountDto > ; description remark remark returns A promise containing the ACCOUNT-V1 API Response: ` AccountDto `
     *
     *  https getAccountByRiotID ( gameName , tagLine ) : Promise < AccountDto > ; description remark remark returns A promise containing the ACCOUNT-V1 API Response: ` ActiveShardDto `
     *
     *  https getActiveShardByPuuid ( puuid ) : Promise < ActiveShardDto > ; } const regionToAccountRegion = ( region ) : Region => { switch ( region ) { case Regions . APAC : case Regions . KR : case Regions . ASIA : return Regions . ASIA ; case Regions . BR : case Regions . NA : case Regions . LATAM : case Regions . PBE1 : return Regions . AMERICAS ; case Regions . EU : case Regions . EUROPE : return Regions . EUROPE ; default : throw new Error ( 'Invalid Region' ) ; } } ; export class AccountV1 extends Controller { getAccountByPuuid ( puuid ) { puuid = encodeURIComponent ( puuid ) ; return this . accountRequest . get ( `/riot/account/v1/accounts/by-puuid/${ puuid }` ) as Promise < AccountDto > ; } getAccountByRiotID ( gameName , tagLine ) { gameName = encodeURIComponent ( gameName ) ; tagLine = encodeURIComponent ( tagLine ) ; return this . accountRequest . get ( `/riot/account/v1/accounts/by-riot-id/${ gameName }/${ tagLine }` ) as Promise < AccountDto > ; } getActiveShardByPuuid ( puuid ) { puuid = encodeURIComponent ( puuid ) ; return this . accountRequest . get ( `/riot/account/v1/active-shards/by-game/val/by-puuid/${ puuid }` ) as Promise < ActiveShardDto > ; } }