/*
 * The Plaid API
 * The Plaid REST API. Please see https://plaid.com/docs/api for more details.
 *
 * The version of the OpenAPI document: 2020-09-14_1.680.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.plaid.client.model;

import java.util.Objects;
import java.util.Arrays;
import io.swagger.annotations.ApiModel;
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;

/**
 * The method used to populate Auth data for the Item. This field is only populated for Items that have had Auth numbers data set on at least one of its accounts, and will be &#x60;null&#x60; otherwise. For info about the various flows, see our [Auth coverage documentation](https://plaid.com/docs/auth/coverage/).  &#x60;INSTANT_AUTH&#x60;: The Item&#39;s Auth data was provided directly by the user&#39;s institution connection.  &#x60;INSTANT_MATCH&#x60;: The Item&#39;s Auth data was provided via the Instant Match fallback flow.  &#x60;AUTOMATED_MICRODEPOSITS&#x60;: The Item&#39;s Auth data was provided via the Automated Micro-deposits flow.  &#x60;SAME_DAY_MICRODEPOSITS&#x60;: The Item&#39;s Auth data was provided via the Same Day Micro-deposits flow.  &#x60;INSTANT_MICRODEPOSITS&#x60;: The Item&#39;s Auth data was provided via the Instant Micro-deposits flow.  &#x60;DATABASE_MATCH&#x60;: The Item&#39;s Auth data was provided via the Database Match flow.  &#x60;DATABASE_INSIGHTS&#x60;: The Item&#39;s Auth data was provided via the Database Insights flow.  &#x60;TRANSFER_MIGRATED&#x60;: The Item&#39;s Auth data was provided via [&#x60;/transfer/migrate_account&#x60;](https://plaid.com/docs/api/products/transfer/account-linking/#migrate-account-into-transfers).  &#x60;INVESTMENTS_FALLBACK&#x60;: The Item&#39;s Auth data for Investments Move was provided via a [fallback flow](https://plaid.com/docs/investments-move/#fallback-flows).
 */
@JsonAdapter(ItemAuthMethod.Adapter.class)
public enum ItemAuthMethod {
  
  INSTANT_AUTH("INSTANT_AUTH"),
  
  INSTANT_MATCH("INSTANT_MATCH"),
  
  AUTOMATED_MICRODEPOSITS("AUTOMATED_MICRODEPOSITS"),
  
  SAME_DAY_MICRODEPOSITS("SAME_DAY_MICRODEPOSITS"),
  
  INSTANT_MICRODEPOSITS("INSTANT_MICRODEPOSITS"),
  
  DATABASE_MATCH("DATABASE_MATCH"),
  
  DATABASE_INSIGHTS("DATABASE_INSIGHTS"),
  
  TRANSFER_MIGRATED("TRANSFER_MIGRATED"),
  
  INVESTMENTS_FALLBACK("INVESTMENTS_FALLBACK"),
  
  NULL("null"),

  // This is returned when an enum is returned from the API that doesn't exist in the OpenAPI file.
  // Try upgrading your client-library version.
  ENUM_UNKNOWN("ENUM_UNKNOWN");

  private String value;

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

  public String getValue() {
    return value;
  }

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

  public static ItemAuthMethod fromValue(String value) {
    for (ItemAuthMethod b : ItemAuthMethod.values()) {
      if (b.value.equals(value)) {
        return b;
      }
    }
    return null;  }

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

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

