// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.avs.models.SegmentStatusEnum;
import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif;
import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState;
import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** NSX Segment. */
@Fluent
public final class WorkloadNetworkSegmentInner extends ProxyResource {
    /*
     * The properties of a Workload Segment proxy resource.
     */
    @JsonProperty(value = "properties")
    private WorkloadNetworkSegmentProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of a Workload Segment proxy resource.
     *
     * @return the innerProperties value.
     */
    private WorkloadNetworkSegmentProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the displayName property: Display name of the segment.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: Display name of the segment.
     *
     * @param displayName the displayName value to set.
     * @return the WorkloadNetworkSegmentInner object itself.
     */
    public WorkloadNetworkSegmentInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkloadNetworkSegmentProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the connectedGateway property: Gateway which to connect segment to.
     *
     * @return the connectedGateway value.
     */
    public String connectedGateway() {
        return this.innerProperties() == null ? null : this.innerProperties().connectedGateway();
    }

    /**
     * Set the connectedGateway property: Gateway which to connect segment to.
     *
     * @param connectedGateway the connectedGateway value to set.
     * @return the WorkloadNetworkSegmentInner object itself.
     */
    public WorkloadNetworkSegmentInner withConnectedGateway(String connectedGateway) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkloadNetworkSegmentProperties();
        }
        this.innerProperties().withConnectedGateway(connectedGateway);
        return this;
    }

    /**
     * Get the subnet property: Subnet which to connect segment to.
     *
     * @return the subnet value.
     */
    public WorkloadNetworkSegmentSubnet subnet() {
        return this.innerProperties() == null ? null : this.innerProperties().subnet();
    }

    /**
     * Set the subnet property: Subnet which to connect segment to.
     *
     * @param subnet the subnet value to set.
     * @return the WorkloadNetworkSegmentInner object itself.
     */
    public WorkloadNetworkSegmentInner withSubnet(WorkloadNetworkSegmentSubnet subnet) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkloadNetworkSegmentProperties();
        }
        this.innerProperties().withSubnet(subnet);
        return this;
    }

    /**
     * Get the portVif property: Port Vif which segment is associated with.
     *
     * @return the portVif value.
     */
    public List<WorkloadNetworkSegmentPortVif> portVif() {
        return this.innerProperties() == null ? null : this.innerProperties().portVif();
    }

    /**
     * Get the status property: Segment status.
     *
     * @return the status value.
     */
    public SegmentStatusEnum status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Get the provisioningState property: The provisioning state.
     *
     * @return the provisioningState value.
     */
    public WorkloadNetworkSegmentProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

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

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

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