mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-06 20:47:45 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.535.1
This commit is contained in:
@@ -3,38 +3,182 @@
|
||||
*/
|
||||
package dev.plexapi.sdk.models.operations;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.core.JacksonException;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import java.io.IOException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>Wrapper class for an "open" enum. "Open" enums are those that are expected
|
||||
* to evolve (particularly with the addition of enum members over time). If an
|
||||
* open enum is used then the appearance of unexpected enum values (say in a
|
||||
* response from an updated an API) will not bring about a runtime error thus
|
||||
* ensuring that non-updated client versions can continue to work without error.
|
||||
*
|
||||
* <p>Note that instances are immutable and are singletons (an internal thread-safe
|
||||
* cache is maintained to ensure that). As a consequence instances created with the
|
||||
* same value will satisfy reference equality (via {@code ==}).
|
||||
*
|
||||
* <p>This class is intended to emulate an enum (in terms of common usage and with
|
||||
* reference equality) but with the ability to carry unknown values. Unfortunately
|
||||
* Java does not permit the use of an instance in a switch expression but you can
|
||||
* use the {@code asEnum()} method (after dealing with the `Optional` appropriately).
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* GetTokenDetailsAuthenticationStatus
|
||||
*
|
||||
* <p>String representation of subscriptionActive
|
||||
*/
|
||||
public enum GetTokenDetailsAuthenticationStatus {
|
||||
INACTIVE("Inactive"),
|
||||
ACTIVE("Active");
|
||||
@JsonDeserialize(using = GetTokenDetailsAuthenticationStatus._Deserializer.class)
|
||||
@JsonSerialize(using = GetTokenDetailsAuthenticationStatus._Serializer.class)
|
||||
public class GetTokenDetailsAuthenticationStatus {
|
||||
|
||||
public static final GetTokenDetailsAuthenticationStatus INACTIVE = new GetTokenDetailsAuthenticationStatus("Inactive");
|
||||
public static final GetTokenDetailsAuthenticationStatus ACTIVE = new GetTokenDetailsAuthenticationStatus("Active");
|
||||
|
||||
// This map will grow whenever a Color gets created with a new
|
||||
// unrecognized value (a potential memory leak if the user is not
|
||||
// careful). Keep this field lower case to avoid clashing with
|
||||
// generated member names which will always be upper cased (Java
|
||||
// convention)
|
||||
private static final Map<String, GetTokenDetailsAuthenticationStatus> values = createValuesMap();
|
||||
private static final Map<String, GetTokenDetailsAuthenticationStatusEnum> enums = createEnumsMap();
|
||||
|
||||
@JsonValue
|
||||
private final String value;
|
||||
|
||||
private GetTokenDetailsAuthenticationStatus(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a GetTokenDetailsAuthenticationStatus with the given value. For a specific value the
|
||||
* returned object will always be a singleton so reference equality
|
||||
* is satisfied when the values are the same.
|
||||
*
|
||||
* @param value value to be wrapped as GetTokenDetailsAuthenticationStatus
|
||||
*/
|
||||
public static GetTokenDetailsAuthenticationStatus of(String value) {
|
||||
synchronized (GetTokenDetailsAuthenticationStatus.class) {
|
||||
return values.computeIfAbsent(value, v -> new GetTokenDetailsAuthenticationStatus(v));
|
||||
}
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static Optional<GetTokenDetailsAuthenticationStatus> fromValue(String value) {
|
||||
for (GetTokenDetailsAuthenticationStatus o: GetTokenDetailsAuthenticationStatus.values()) {
|
||||
if (Objects.deepEquals(o.value, value)) {
|
||||
return Optional.of(o);
|
||||
}
|
||||
|
||||
public Optional<GetTokenDetailsAuthenticationStatusEnum> asEnum() {
|
||||
return Optional.ofNullable(enums.getOrDefault(value, null));
|
||||
}
|
||||
|
||||
public boolean isKnown() {
|
||||
return asEnum().isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
GetTokenDetailsAuthenticationStatus other = (GetTokenDetailsAuthenticationStatus) obj;
|
||||
return Objects.equals(value, other.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GetTokenDetailsAuthenticationStatus [value=" + value + "]";
|
||||
}
|
||||
|
||||
// return an array just like an enum
|
||||
public static GetTokenDetailsAuthenticationStatus[] values() {
|
||||
synchronized (GetTokenDetailsAuthenticationStatus.class) {
|
||||
return values.values().toArray(new GetTokenDetailsAuthenticationStatus[] {});
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<String, GetTokenDetailsAuthenticationStatus> createValuesMap() {
|
||||
Map<String, GetTokenDetailsAuthenticationStatus> map = new LinkedHashMap<>();
|
||||
map.put("Inactive", INACTIVE);
|
||||
map.put("Active", ACTIVE);
|
||||
return map;
|
||||
}
|
||||
|
||||
private static final Map<String, GetTokenDetailsAuthenticationStatusEnum> createEnumsMap() {
|
||||
Map<String, GetTokenDetailsAuthenticationStatusEnum> map = new HashMap<>();
|
||||
map.put("Inactive", GetTokenDetailsAuthenticationStatusEnum.INACTIVE);
|
||||
map.put("Active", GetTokenDetailsAuthenticationStatusEnum.ACTIVE);
|
||||
return map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static final class _Serializer extends StdSerializer<GetTokenDetailsAuthenticationStatus> {
|
||||
|
||||
protected _Serializer() {
|
||||
super(GetTokenDetailsAuthenticationStatus.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(GetTokenDetailsAuthenticationStatus value, JsonGenerator g, SerializerProvider provider)
|
||||
throws IOException, JsonProcessingException {
|
||||
g.writeObject(value.value);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static final class _Deserializer extends StdDeserializer<GetTokenDetailsAuthenticationStatus> {
|
||||
|
||||
protected _Deserializer() {
|
||||
super(GetTokenDetailsAuthenticationStatus.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GetTokenDetailsAuthenticationStatus deserialize(JsonParser p, DeserializationContext ctxt)
|
||||
throws IOException, JacksonException {
|
||||
String v = p.readValueAs(new TypeReference<String>() {});
|
||||
// use the factory method to ensure we get singletons
|
||||
return GetTokenDetailsAuthenticationStatus.of(v);
|
||||
}
|
||||
}
|
||||
|
||||
public enum GetTokenDetailsAuthenticationStatusEnum {
|
||||
|
||||
INACTIVE("Inactive"),
|
||||
ACTIVE("Active"),;
|
||||
|
||||
private final String value;
|
||||
|
||||
private GetTokenDetailsAuthenticationStatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user