IndexerExecutionStatus.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.

  7. package com.azure.search.documents.indexes.models;

  8. import com.fasterxml.jackson.annotation.JsonCreator;
  9. import com.fasterxml.jackson.annotation.JsonValue;

  10. /** Defines values for IndexerExecutionStatus. */
  11. public enum IndexerExecutionStatus {
  12.     /** Enum value transientFailure. */
  13.     TRANSIENT_FAILURE("transientFailure"),

  14.     /** Enum value success. */
  15.     SUCCESS("success"),

  16.     /** Enum value inProgress. */
  17.     IN_PROGRESS("inProgress"),

  18.     /** Enum value reset. */
  19.     RESET("reset");

  20.     /** The actual serialized value for a IndexerExecutionStatus instance. */
  21.     private final String value;

  22.     IndexerExecutionStatus(String value) {
  23.         this.value = value;
  24.     }

  25.     /**
  26.      * Parses a serialized value to a IndexerExecutionStatus instance.
  27.      *
  28.      * @param value the serialized value to parse.
  29.      * @return the parsed IndexerExecutionStatus object, or null if unable to parse.
  30.      */
  31.     @JsonCreator
  32.     public static IndexerExecutionStatus fromString(String value) {
  33.         IndexerExecutionStatus[] items = IndexerExecutionStatus.values();
  34.         for (IndexerExecutionStatus item : items) {
  35.             if (item.toString().equalsIgnoreCase(value)) {
  36.                 return item;
  37.             }
  38.         }
  39.         return null;
  40.     }

  41.     @JsonValue
  42.     @Override
  43.     public String toString() {
  44.         return this.value;
  45.     }
  46. }