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

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

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

/** Apply Update request. */
@Fluent
public final class ApplyUpdateInner extends ProxyResource {
    /*
     * Properties of the apply update
     */
    @JsonProperty(value = "properties")
    private ApplyUpdateProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Properties of the apply update.
     *
     * @return the innerProperties value.
     */
    private ApplyUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

    /**
     * Set the status property: The status.
     *
     * @param status the status value to set.
     * @return the ApplyUpdateInner object itself.
     */
    public ApplyUpdateInner withStatus(UpdateStatus status) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplyUpdateProperties();
        }
        this.innerProperties().withStatus(status);
        return this;
    }

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

    /**
     * Set the resourceId property: The resourceId.
     *
     * @param resourceId the resourceId value to set.
     * @return the ApplyUpdateInner object itself.
     */
    public ApplyUpdateInner withResourceId(String resourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplyUpdateProperties();
        }
        this.innerProperties().withResourceId(resourceId);
        return this;
    }

    /**
     * Get the lastUpdateTime property: Last Update time.
     *
     * @return the lastUpdateTime value.
     */
    public OffsetDateTime lastUpdateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastUpdateTime();
    }

    /**
     * Set the lastUpdateTime property: Last Update time.
     *
     * @param lastUpdateTime the lastUpdateTime value to set.
     * @return the ApplyUpdateInner object itself.
     */
    public ApplyUpdateInner withLastUpdateTime(OffsetDateTime lastUpdateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplyUpdateProperties();
        }
        this.innerProperties().withLastUpdateTime(lastUpdateTime);
        return this;
    }

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