// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.avs.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "dhcpType",
    defaultImpl = WorkloadNetworkDhcpEntity.class)
@JsonTypeName("WorkloadNetworkDhcpEntity")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "SERVER", value = WorkloadNetworkDhcpServer.class),
    @JsonSubTypes.Type(name = "RELAY", value = WorkloadNetworkDhcpRelay.class)
})
@Fluent
public class WorkloadNetworkDhcpEntity {
    /*
     * Display name of the DHCP entity.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * NSX Segments consuming DHCP.
     */
    @JsonProperty(value = "segments", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> segments;

    /*
     * The provisioning state
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private WorkloadNetworkDhcpProvisioningState provisioningState;

    /*
     * NSX revision number.
     */
    @JsonProperty(value = "revision")
    private Long revision;

    /** Creates an instance of WorkloadNetworkDhcpEntity class. */
    public WorkloadNetworkDhcpEntity() {
    }

    /**
     * Get the displayName property: Display name of the DHCP entity.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: Display name of the DHCP entity.
     *
     * @param displayName the displayName value to set.
     * @return the WorkloadNetworkDhcpEntity object itself.
     */
    public WorkloadNetworkDhcpEntity withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the segments property: NSX Segments consuming DHCP.
     *
     * @return the segments value.
     */
    public List<String> segments() {
        return this.segments;
    }

    /**
     * Get the provisioningState property: The provisioning state.
     *
     * @return the provisioningState value.
     */
    public WorkloadNetworkDhcpProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the revision property: NSX revision number.
     *
     * @return the revision value.
     */
    public Long revision() {
        return this.revision;
    }

    /**
     * Set the revision property: NSX revision number.
     *
     * @param revision the revision value to set.
     * @return the WorkloadNetworkDhcpEntity object itself.
     */
    public WorkloadNetworkDhcpEntity withRevision(Long revision) {
        this.revision = revision;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
