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

com.infobip.model.CallsUrlSecurityConfig Maven / Gradle / Ivy

/*
 * This class is auto generated from the Infobip OpenAPI specification
 * through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR),
 * powered by the OpenAPI Generator (https://openapi-generator.tech).
 *
 * Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide
 * or contact us @ [email protected].
 */

package com.infobip.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.util.Objects;

/**
 * Webhook security config.
 */
@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.EXISTING_PROPERTY,
        property = "type",
        visible = true)
@JsonSubTypes({
    @JsonSubTypes.Type(value = CallsBasicUrlSecurityConfig.class, name = "BASIC"),
    @JsonSubTypes.Type(value = CallsHmacUrlSecurityConfig.class, name = "HMAC"),
})
public abstract class CallsUrlSecurityConfig {

    protected final CallsUrlSecurityConfigType type;

    /**
     * Constructs a new {@link CallsUrlSecurityConfig} instance.
     */
    public CallsUrlSecurityConfig(String type) {
        this.type = CallsUrlSecurityConfigType.fromValue(type);
    }

    /**
     * Returns type.
     *
     * @return type
     */
    @JsonProperty("type")
    public CallsUrlSecurityConfigType getType() {
        return type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CallsUrlSecurityConfig callsUrlSecurityConfig = (CallsUrlSecurityConfig) o;
        return Objects.equals(this.type, callsUrlSecurityConfig.type);
    }

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

    @Override
    public String toString() {
        String newLine = System.lineSeparator();
        return new StringBuilder()
                .append("class CallsUrlSecurityConfig {")
                .append(newLine)
                .append("    type: ")
                .append(toIndentedString(type))
                .append(newLine)
                .append("}")
                .toString();
    }

    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        String lineSeparator = System.lineSeparator();
        String lineSeparatorFollowedByIndentation = lineSeparator + "    ";
        return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy