// 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.DelegatedSubnetResource;
import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState;
import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Represents an instance of a orchestrator. */
@Fluent
public final class DelegatedSubnetInner extends DelegatedSubnetResource {
    /*
     * Properties of the provision operation request.
     */
    @JsonProperty(value = "properties")
    private DelegatedSubnetProperties innerProperties;

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

    /**
     * Get the innerProperties property: Properties of the provision operation request.
     *
     * @return the innerProperties value.
     */
    private DelegatedSubnetProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public DelegatedSubnetInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DelegatedSubnetInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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

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

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

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

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

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

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