package no.stelar7.api.l4j8.basic.constants.api;

import java.util.*;
import java.util.stream.Stream;

public enum Platform
{
    /**
     * Unknown platform, used for bots in participant identities
     */
    UNKNOWN(""),
    /**
     * BR platform.
     */
    BR1("BR1"),
    /**
     * EUNE platform.
     */
    EUN1("EUN1"),
    /**
     * EUW platform.
     */
    EUW1("EUW1"),
    /**
     * JP platform.
     */
    JP1("JP1"),
    /**
     * KR platform.
     */
    KR("KR"),
    /**
     * LAN platform.
     */
    LA1("LA1"),
    /**
     * LAS platform.
     */
    LA2("LA2"),
    /**
     * NA platform.
     */
    NA1("NA1", "NA"),
    /**
     * OC platform.
     */
    OC1("OC1"),
    /**
     * TR platform.
     */
    TR1("TR1"),
    /**
     * RU platform.
     */
    RU("RU"),
    /**
     * PBE platform.
     */
    PBE1("PBE1");
    
    
    private String[] keys;
    
    Platform(String... s)
    {
        this.keys = s;
    }
    
    /**
     * Returns a Platform from the provided code
     *
     * @param code the lookup key
     * @return Platform from code
     */
    public static Optional<Platform> getFromCode(final String code)
    {
        return Stream.of(Platform.values()).filter(t -> Stream.of(t.keys).anyMatch(s -> s.equalsIgnoreCase(code))).findFirst();
    }
    
    
    /**
     * Used internaly in the api...
     *
     * @return the value
     */
    public String getValue()
    {
        return this.keys[0];
    }
    
    @Override
    public String toString()
    {
        return this.keys[0].toLowerCase(Locale.ENGLISH);
    }
}

@@ -246,16 +246,20 @@
     * BR
+AZIL
  platfor
@@ -309,11 +309,27 @@
  * E
-UNE
+urope Nordic & East
  pla
@@ -381,18 +381,26 @@
      * E
-UW
+urope West
  platfor
@@ -448,17 +448,20 @@
      * J
-P
+apan
  platfor
@@ -507,17 +507,20 @@
      * K
-R
+orea
  platfor
@@ -568,10 +568,26 @@
  * L
-AN
+atin America North
  pla
@@ -641,10 +641,26 @@
  * L
-AS
+atin America South
  pla
@@ -710,17 +710,28 @@
      * N
-A
+orth America
  platfor
@@ -783,17 +783,22 @@
      * O
-C
+ceania
  platfor
@@ -844,17 +844,21 @@
      * T
-R
+urkey
  platfor
@@ -904,17 +904,21 @@
      * R
-U
+ussia
  platfor
@@ -962,18 +962,38 @@
      * P
-BE
+ublic Beta Environment
  platfor
@@ -1021,16 +1021,374 @@
 (%22PBE1%22)
+,%0D%0A    /**%0D%0A     * Singapore platform%0D%0A     */%0D%0A    SG(%22SG%22),%0D%0A    /**%0D%0A     * Philippines platform%0D%0A     */%0D%0A    PH(%22PH%22),%0D%0A    /**%0D%0A     * Indonesia platform%0D%0A     */%0D%0A    ID1(%22ID1%22),%0D%0A    /**%0D%0A     * Vietnam platform%0D%0A     */%0D%0A    VN(%22VN%22),%0D%0A    /**%0D%0A     * Thailand platform%0D%0A     */%0D%0A    TH(%22TH%22),%0D%0A    /**%0D%0A     * Taiwan platform%0D%0A     */%0D%0A    TW(%22TW%22)
 ;%0D%0A    %0D

Add garena regions