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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.automation.models.WorkerType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Definition of hybrid runbook worker. */
@Fluent
public final class HybridRunbookWorkerInner extends ProxyResource {
    /*
     * Gets or sets the hybrid worker group properties.
     */
    @JsonProperty(value = "properties")
    private HybridRunbookWorkerProperties innerProperties;

    /*
     * Resource system metadata.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /**
     * Get the innerProperties property: Gets or sets the hybrid worker group properties.
     *
     * @return the innerProperties value.
     */
    private HybridRunbookWorkerProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Resource system metadata.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the ip property: Gets or sets the assigned machine IP address.
     *
     * @return the ip value.
     */
    public String ip() {
        return this.innerProperties() == null ? null : this.innerProperties().ip();
    }

    /**
     * Set the ip property: Gets or sets the assigned machine IP address.
     *
     * @param ip the ip value to set.
     * @return the HybridRunbookWorkerInner object itself.
     */
    public HybridRunbookWorkerInner withIp(String ip) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridRunbookWorkerProperties();
        }
        this.innerProperties().withIp(ip);
        return this;
    }

    /**
     * Get the registeredDateTime property: Gets or sets the registration time of the worker machine.
     *
     * @return the registeredDateTime value.
     */
    public OffsetDateTime registeredDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().registeredDateTime();
    }

    /**
     * Set the registeredDateTime property: Gets or sets the registration time of the worker machine.
     *
     * @param registeredDateTime the registeredDateTime value to set.
     * @return the HybridRunbookWorkerInner object itself.
     */
    public HybridRunbookWorkerInner withRegisteredDateTime(OffsetDateTime registeredDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridRunbookWorkerProperties();
        }
        this.innerProperties().withRegisteredDateTime(registeredDateTime);
        return this;
    }

    /**
     * Get the lastSeenDateTime property: Last Heartbeat from the Worker.
     *
     * @return the lastSeenDateTime value.
     */
    public OffsetDateTime lastSeenDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastSeenDateTime();
    }

    /**
     * Set the lastSeenDateTime property: Last Heartbeat from the Worker.
     *
     * @param lastSeenDateTime the lastSeenDateTime value to set.
     * @return the HybridRunbookWorkerInner object itself.
     */
    public HybridRunbookWorkerInner withLastSeenDateTime(OffsetDateTime lastSeenDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridRunbookWorkerProperties();
        }
        this.innerProperties().withLastSeenDateTime(lastSeenDateTime);
        return this;
    }

    /**
     * Get the vmResourceId property: Azure Resource Manager Id for a virtual machine.
     *
     * @return the vmResourceId value.
     */
    public String vmResourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().vmResourceId();
    }

    /**
     * Set the vmResourceId property: Azure Resource Manager Id for a virtual machine.
     *
     * @param vmResourceId the vmResourceId value to set.
     * @return the HybridRunbookWorkerInner object itself.
     */
    public HybridRunbookWorkerInner withVmResourceId(String vmResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridRunbookWorkerProperties();
        }
        this.innerProperties().withVmResourceId(vmResourceId);
        return this;
    }

    /**
     * Get the workerType property: Type of the HybridWorker.
     *
     * @return the workerType value.
     */
    public WorkerType workerType() {
        return this.innerProperties() == null ? null : this.innerProperties().workerType();
    }

    /**
     * Set the workerType property: Type of the HybridWorker.
     *
     * @param workerType the workerType value to set.
     * @return the HybridRunbookWorkerInner object itself.
     */
    public HybridRunbookWorkerInner withWorkerType(WorkerType workerType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridRunbookWorkerProperties();
        }
        this.innerProperties().withWorkerType(workerType);
        return this;
    }

    /**
     * Get the workerName property: Name of the HybridWorker.
     *
     * @return the workerName value.
     */
    public String workerName() {
        return this.innerProperties() == null ? null : this.innerProperties().workerName();
    }

    /**
     * Set the workerName property: Name of the HybridWorker.
     *
     * @param workerName the workerName value to set.
     * @return the HybridRunbookWorkerInner object itself.
     */
    public HybridRunbookWorkerInner withWorkerName(String workerName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridRunbookWorkerProperties();
        }
        this.innerProperties().withWorkerName(workerName);
        return this;
    }

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