All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openziti.edge.model.TerminatorClientDetail Maven / Gradle / Ivy

The newest version!
/*
 * Ziti Edge Client
 * OpenZiti Edge Client API
 *
 * The version of the OpenAPI document: 0.26.27
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package org.openziti.edge.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
import org.openziti.edge.ApiClient;

/** TerminatorClientDetail */
@JsonPropertyOrder({
    TerminatorClientDetail.JSON_PROPERTY_LINKS,
    TerminatorClientDetail.JSON_PROPERTY_CREATED_AT,
    TerminatorClientDetail.JSON_PROPERTY_ID,
    TerminatorClientDetail.JSON_PROPERTY_TAGS,
    TerminatorClientDetail.JSON_PROPERTY_UPDATED_AT,
    TerminatorClientDetail.JSON_PROPERTY_IDENTITY,
    TerminatorClientDetail.JSON_PROPERTY_ROUTER_ID,
    TerminatorClientDetail.JSON_PROPERTY_SERVICE,
    TerminatorClientDetail.JSON_PROPERTY_SERVICE_ID
})
@javax.annotation.Generated(
        value = "org.openapitools.codegen.languages.JavaClientCodegen",
        date = "2024-09-04T10:11:22.635226-04:00[America/New_York]",
        comments = "Generator version: 7.8.0")
public class TerminatorClientDetail {
    public static final String JSON_PROPERTY_LINKS = "_links";
    private Map links = new HashMap<>();

    public static final String JSON_PROPERTY_CREATED_AT = "createdAt";
    private OffsetDateTime createdAt;

    public static final String JSON_PROPERTY_ID = "id";
    private String id;

    public static final String JSON_PROPERTY_TAGS = "tags";
    private Tags tags;

    public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt";
    private OffsetDateTime updatedAt;

    public static final String JSON_PROPERTY_IDENTITY = "identity";
    private String identity;

    public static final String JSON_PROPERTY_ROUTER_ID = "routerId";
    private String routerId;

    public static final String JSON_PROPERTY_SERVICE = "service";
    private EntityRef service;

    public static final String JSON_PROPERTY_SERVICE_ID = "serviceId";
    private String serviceId;

    public TerminatorClientDetail() {}

    public TerminatorClientDetail links(Map links) {
        this.links = links;
        return this;
    }

    public TerminatorClientDetail putLinksItem(String key, Link linksItem) {
        if (this.links == null) {
            this.links = new HashMap<>();
        }
        this.links.put(key, linksItem);
        return this;
    }

    /**
     * A map of named links
     *
     * @return links
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public Map getLinks() {
        return links;
    }

    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setLinks(Map links) {
        this.links = links;
    }

    public TerminatorClientDetail createdAt(OffsetDateTime createdAt) {
        this.createdAt = createdAt;
        return this;
    }

    /**
     * Get createdAt
     *
     * @return createdAt
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_CREATED_AT)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public OffsetDateTime getCreatedAt() {
        return createdAt;
    }

    @JsonProperty(JSON_PROPERTY_CREATED_AT)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setCreatedAt(OffsetDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public TerminatorClientDetail id(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get id
     *
     * @return id
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getId() {
        return id;
    }

    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setId(String id) {
        this.id = id;
    }

    public TerminatorClientDetail tags(Tags tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get tags
     *
     * @return tags
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TAGS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Tags getTags() {
        return tags;
    }

    @JsonProperty(JSON_PROPERTY_TAGS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTags(Tags tags) {
        this.tags = tags;
    }

    public TerminatorClientDetail updatedAt(OffsetDateTime updatedAt) {
        this.updatedAt = updatedAt;
        return this;
    }

    /**
     * Get updatedAt
     *
     * @return updatedAt
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_UPDATED_AT)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public OffsetDateTime getUpdatedAt() {
        return updatedAt;
    }

    @JsonProperty(JSON_PROPERTY_UPDATED_AT)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setUpdatedAt(OffsetDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public TerminatorClientDetail identity(String identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get identity
     *
     * @return identity
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_IDENTITY)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getIdentity() {
        return identity;
    }

    @JsonProperty(JSON_PROPERTY_IDENTITY)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public TerminatorClientDetail routerId(String routerId) {
        this.routerId = routerId;
        return this;
    }

    /**
     * Get routerId
     *
     * @return routerId
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ROUTER_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getRouterId() {
        return routerId;
    }

    @JsonProperty(JSON_PROPERTY_ROUTER_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setRouterId(String routerId) {
        this.routerId = routerId;
    }

    public TerminatorClientDetail service(EntityRef service) {
        this.service = service;
        return this;
    }

    /**
     * Get service
     *
     * @return service
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_SERVICE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public EntityRef getService() {
        return service;
    }

    @JsonProperty(JSON_PROPERTY_SERVICE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setService(EntityRef service) {
        this.service = service;
    }

    public TerminatorClientDetail serviceId(String serviceId) {
        this.serviceId = serviceId;
        return this;
    }

    /**
     * Get serviceId
     *
     * @return serviceId
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_SERVICE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getServiceId() {
        return serviceId;
    }

    @JsonProperty(JSON_PROPERTY_SERVICE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    /** Return true if this terminatorClientDetail object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TerminatorClientDetail terminatorClientDetail = (TerminatorClientDetail) o;
        return Objects.equals(this.links, terminatorClientDetail.links)
                && Objects.equals(this.createdAt, terminatorClientDetail.createdAt)
                && Objects.equals(this.id, terminatorClientDetail.id)
                && Objects.equals(this.tags, terminatorClientDetail.tags)
                && Objects.equals(this.updatedAt, terminatorClientDetail.updatedAt)
                && Objects.equals(this.identity, terminatorClientDetail.identity)
                && Objects.equals(this.routerId, terminatorClientDetail.routerId)
                && Objects.equals(this.service, terminatorClientDetail.service)
                && Objects.equals(this.serviceId, terminatorClientDetail.serviceId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                links, createdAt, id, tags, updatedAt, identity, routerId, service, serviceId);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class TerminatorClientDetail {\n");
        sb.append("    links: ").append(toIndentedString(links)).append("\n");
        sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    tags: ").append(toIndentedString(tags)).append("\n");
        sb.append("    updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
        sb.append("    identity: ").append(toIndentedString(identity)).append("\n");
        sb.append("    routerId: ").append(toIndentedString(routerId)).append("\n");
        sb.append("    service: ").append(toIndentedString(service)).append("\n");
        sb.append("    serviceId: ").append(toIndentedString(serviceId)).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    ");
    }

    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
        return toUrlQueryString(null);
    }

    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
        String suffix = "";
        String containerSuffix = "";
        String containerPrefix = "";
        if (prefix == null) {
            // style=form, explode=true, e.g. /pet?name=cat&type=manx
            prefix = "";
        } else {
            // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
            prefix = prefix + "[";
            suffix = "]";
            containerSuffix = "]";
            containerPrefix = "[";
        }

        StringJoiner joiner = new StringJoiner("&");

        // add `_links` to the URL query string
        if (getLinks() != null) {
            for (String _key : getLinks().keySet()) {
                if (getLinks().get(_key) != null) {
                    joiner.add(
                            getLinks()
                                    .get(_key)
                                    .toUrlQueryString(
                                            String.format(
                                                    "%s_links%s%s",
                                                    prefix,
                                                    suffix,
                                                    "".equals(suffix)
                                                            ? ""
                                                            : String.format(
                                                                    "%s%d%s",
                                                                    containerPrefix,
                                                                    _key,
                                                                    containerSuffix))));
                }
            }
        }

        // add `createdAt` to the URL query string
        if (getCreatedAt() != null) {
            joiner.add(
                    String.format(
                            "%screatedAt%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            ApiClient.valueToString(getCreatedAt()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `id` to the URL query string
        if (getId() != null) {
            joiner.add(
                    String.format(
                            "%sid%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            ApiClient.valueToString(getId()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `tags` to the URL query string
        if (getTags() != null) {
            joiner.add(getTags().toUrlQueryString(prefix + "tags" + suffix));
        }

        // add `updatedAt` to the URL query string
        if (getUpdatedAt() != null) {
            joiner.add(
                    String.format(
                            "%supdatedAt%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            ApiClient.valueToString(getUpdatedAt()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `identity` to the URL query string
        if (getIdentity() != null) {
            joiner.add(
                    String.format(
                            "%sidentity%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            ApiClient.valueToString(getIdentity()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `routerId` to the URL query string
        if (getRouterId() != null) {
            joiner.add(
                    String.format(
                            "%srouterId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            ApiClient.valueToString(getRouterId()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `service` to the URL query string
        if (getService() != null) {
            joiner.add(getService().toUrlQueryString(prefix + "service" + suffix));
        }

        // add `serviceId` to the URL query string
        if (getServiceId() != null) {
            joiner.add(
                    String.format(
                            "%sserviceId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            ApiClient.valueToString(getServiceId()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy