View Javadoc
1   /*
2    * OpenFGA
3    * A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.
4    *
5    * The version of the OpenAPI document: 1.x
6    * Contact: community@openfga.dev
7    *
8    * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9    * https://openapi-generator.tech
10   * Do not edit the class manually.
11   */
12  
13  
14  package org.apache.syncope.ext.openfga.client.model;
15  
16  import java.net.URLEncoder;
17  import java.nio.charset.StandardCharsets;
18  import java.util.StringJoiner;
19  import java.util.Objects;
20  import java.util.Map;
21  import java.util.HashMap;
22  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
23  
24  
25  import com.fasterxml.jackson.annotation.JsonCreator;
26  import com.fasterxml.jackson.annotation.JsonValue;
27  
28  /**
29   * Gets or Sets InternalErrorCode
30   */
31  public enum InternalErrorCode {
32    
33    NO_INTERNAL_ERROR("no_internal_error"),
34    
35    INTERNAL_ERROR("internal_error"),
36    
37    DEADLINE_EXCEEDED("deadline_exceeded"),
38    
39    ALREADY_EXISTS("already_exists"),
40    
41    RESOURCE_EXHAUSTED("resource_exhausted"),
42    
43    FAILED_PRECONDITION("failed_precondition"),
44    
45    ABORTED("aborted"),
46    
47    OUT_OF_RANGE("out_of_range"),
48    
49    UNAVAILABLE("unavailable"),
50    
51    DATA_LOSS("data_loss");
52  
53    private String value;
54  
55    InternalErrorCode(String value) {
56      this.value = value;
57    }
58  
59    @JsonValue
60    public String getValue() {
61      return value;
62    }
63  
64    @Override
65    public String toString() {
66      return String.valueOf(value);
67    }
68  
69    @JsonCreator
70    public static InternalErrorCode fromValue(String value) {
71      for (InternalErrorCode b : InternalErrorCode.values()) {
72        if (b.value.equals(value)) {
73          return b;
74        }
75      }
76      throw new IllegalArgumentException("Unexpected value '" + value + "'");
77    }
78  
79    /**
80     * Convert the instance into URL query string.
81     *
82     * @param prefix prefix of the query string
83     * @return URL query string
84     */
85    public String toUrlQueryString(String prefix) {
86      if (prefix == null) {
87        prefix = "";
88      }
89  
90      return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString());
91    }
92  
93  }
94