Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 228 additions & 0 deletions src/main/java/com/adyen/model/management/ForceRebootDetails.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
/*
* Management API
*
* The version of the OpenAPI document: 3
*
*
* 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.adyen.model.management;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
import java.util.Arrays;
import java.util.logging.Logger;

/** ForceRebootDetails */
@JsonPropertyOrder({ForceRebootDetails.JSON_PROPERTY_TYPE})
public class ForceRebootDetails {
/**
* The type of terminal action. The value **ForceReboot** triggers an immediate reboot of the
* specified terminal(s).
*/
public enum TypeEnum {
FORCEREBOOT(String.valueOf("ForceReboot"));

private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName());

private String value;

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

@JsonValue
public String getValue() {
return value;
}

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

@JsonCreator
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
// handling unexpected value
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
return null;
}
}

public static final String JSON_PROPERTY_TYPE = "type";
private TypeEnum type;

/** Mark when the attribute has been explicitly set. */
private boolean isSetType = false;

/**
* Sets whether attributes with null values should be explicitly included in the JSON payload.
* Default is false.
*/
@JsonIgnore private boolean includeNullValues = false;

public ForceRebootDetails() {}

/**
* The type of terminal action. The value **ForceReboot** triggers an immediate reboot of the
* specified terminal(s).
*
* @param type The type of terminal action. The value **ForceReboot** triggers an immediate reboot
* of the specified terminal(s).
* @return the current {@code ForceRebootDetails} instance, allowing for method chaining
*/
public ForceRebootDetails type(TypeEnum type) {
this.type = type;
isSetType = true; // mark as set
return this;
}

/**
* The type of terminal action. The value **ForceReboot** triggers an immediate reboot of the
* specified terminal(s).
*
* @return type The type of terminal action. The value **ForceReboot** triggers an immediate
* reboot of the specified terminal(s).
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public TypeEnum getType() {
return type;
}

/**
* The type of terminal action. The value **ForceReboot** triggers an immediate reboot of the
* specified terminal(s).
*
* @param type The type of terminal action. The value **ForceReboot** triggers an immediate reboot
* of the specified terminal(s).
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setType(TypeEnum type) {
this.type = type;
isSetType = true; // mark as set
}

/**
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
*/
public ForceRebootDetails includeNullValues(boolean includeNullValues) {
this.includeNullValues = includeNullValues;
return this;
}

/** Returns whether null values are explicitly serialized in the JSON payload. */
public boolean isIncludeNullValues() {
return includeNullValues;
}

/**
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
*/
public void setIncludeNullValues(boolean includeNullValues) {
this.includeNullValues = includeNullValues;
}

/** Return true if this ForceRebootDetails object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ForceRebootDetails forceRebootDetails = (ForceRebootDetails) o;
return Objects.equals(this.type, forceRebootDetails.type)
&& Objects.equals(this.isSetType, forceRebootDetails.isSetType);
}

@Override
public int hashCode() {
return Objects.hash(type, isSetType);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ForceRebootDetails {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
@JsonInclude(JsonInclude.Include.ALWAYS)
@JsonAnyGetter
public Map<String, Object> getExplicitNulls() {
if (!this.includeNullValues) {
return Collections.emptyMap();
}

Map<String, Object> nulls = new HashMap<>();

if (isSetType) {
addIfNull(nulls, JSON_PROPERTY_TYPE, this.type);
}

return nulls;
}

// add to map when value is null
private void addIfNull(Map<String, Object> map, String key, Object value) {
if (value == null) {
map.put(key, null);
}
}

/**
* Create an instance of ForceRebootDetails given an JSON string
*
* @param jsonString JSON string
* @return An instance of ForceRebootDetails
* @throws JsonProcessingException if the JSON string is invalid with respect to
* ForceRebootDetails
*/
public static ForceRebootDetails fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, ForceRebootDetails.class);
}

/**
* Convert an instance of ForceRebootDetails to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
Loading