java/src/main/java/com/konfigthis/newscatcherapi/client/model/Lang.java
/*
 * NewsCatcher News API V2
 * NewsCatcher is a data-as-a-service startup that has one main goal: to build the largest database of structured news articles published online. In other words, we're like Google for the news part of the web, which you can access as a source of data.  Some useful links: - [How NewsCatcher Works](https://docs.newscatcherapi.com/knowledge-base/how-newscatcher-works) - [GitHub for the Python SDK](https://github.com/NewscatcherAPI/newscatcherapi-sdk-python) 
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: kenaa@example.com
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.newscatcherapi.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.annotations.SerializedName;

import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

/**
 * Gets or Sets lang
 */
@JsonAdapter(Lang.Adapter.class)
public enum Lang {
  
  AF("af"),
  
  AR("ar"),
  
  BG("bg"),
  
  BN("bn"),
  
  CA("ca"),
  
  CN("cn"),
  
  CS("cs"),
  
  CY("cy"),
  
  DA("da"),
  
  DE("de"),
  
  EL("el"),
  
  EN("en"),
  
  ES("es"),
  
  ET("et"),
  
  FA("fa"),
  
  FI("fi"),
  
  FR("fr"),
  
  GU("gu"),
  
  HE("he"),
  
  HI("hi"),
  
  HR("hr"),
  
  HU("hu"),
  
  ID("id"),
  
  IT("it"),
  
  JA("ja"),
  
  KN("kn"),
  
  KO("ko"),
  
  LT("lt"),
  
  LV("lv"),
  
  MK("mk"),
  
  ML("ml"),
  
  MR("mr"),
  
  NE("ne"),
  
  NL("nl"),
  
  FALSE("false"),
  
  PA("pa"),
  
  PL("pl"),
  
  PT("pt"),
  
  RO("ro"),
  
  RU("ru"),
  
  SK("sk"),
  
  SL("sl"),
  
  SO("so"),
  
  SQ("sq"),
  
  SV("sv"),
  
  SW("sw"),
  
  TA("ta"),
  
  TE("te"),
  
  TH("th"),
  
  TL("tl"),
  
  TR("tr"),
  
  TW("tw"),
  
  UK("uk"),
  
  UR("ur"),
  
  VI("vi");

  private String value;

  Lang(String value) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }

  @Override
  public String toString() {
    return String.valueOf(value);
  }

  public static Lang fromValue(String value) {
    for (Lang b : Lang.values()) {
      if (b.value.equals(value)) {
        return b;
      }
    }
    throw new IllegalArgumentException("Unexpected value '" + value + "'");
  }

  public static class Adapter extends TypeAdapter<Lang> {
    @Override
    public void write(final JsonWriter jsonWriter, final Lang enumeration) throws IOException {
      jsonWriter.value(enumeration.getValue());
    }

    @Override
    public Lang read(final JsonReader jsonReader) throws IOException {
      String value = jsonReader.nextString();
      return Lang.fromValue(value);
    }
  }
}

