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

package com.azure.resourcemanager.delegatednetwork.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails;
import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState;
import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of delegated subnet. */
@Fluent
public final class DelegatedSubnetProperties {
    /*
     * Resource guid.
     */
    @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY)
    private String resourceGuid;

    /*
     * The current state of dnc delegated subnet resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private DelegatedSubnetState provisioningState;

    /*
     * subnet details
     */
    @JsonProperty(value = "subnetDetails")
    private SubnetDetails subnetDetails;

    /*
     * Properties of the controller.
     */
    @JsonProperty(value = "controllerDetails")
    private ControllerDetails controllerDetails;

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

    /**
     * Get the resourceGuid property: Resource guid.
     *
     * @return the resourceGuid value.
     */
    public String resourceGuid() {
        return this.resourceGuid;
    }

    /**
     * Get the provisioningState property: The current state of dnc delegated subnet resource.
     *
     * @return the provisioningState value.
     */
    public DelegatedSubnetState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the subnetDetails property: subnet details.
     *
     * @return the subnetDetails value.
     */
    public SubnetDetails subnetDetails() {
        return this.subnetDetails;
    }

    /**
     * Set the subnetDetails property: subnet details.
     *
     * @param subnetDetails the subnetDetails value to set.
     * @return the DelegatedSubnetProperties object itself.
     */
    public DelegatedSubnetProperties withSubnetDetails(SubnetDetails subnetDetails) {
        this.subnetDetails = subnetDetails;
        return this;
    }

    /**
     * Get the controllerDetails property: Properties of the controller.
     *
     * @return the controllerDetails value.
     */
    public ControllerDetails controllerDetails() {
        return this.controllerDetails;
    }

    /**
     * Set the controllerDetails property: Properties of the controller.
     *
     * @param controllerDetails the controllerDetails value to set.
     * @return the DelegatedSubnetProperties object itself.
     */
    public DelegatedSubnetProperties withControllerDetails(ControllerDetails controllerDetails) {
        this.controllerDetails = controllerDetails;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (subnetDetails() != null) {
            subnetDetails().validate();
        }
        if (controllerDetails() != null) {
            controllerDetails().validate();
        }
    }
}
