// 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.resourcemanager.automation.models.ActivityOutputType;
import com.azure.resourcemanager.automation.models.ActivityParameterSet;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Definition of the activity. */
@Fluent
public final class ActivityInner {
    /*
     * Gets or sets the id of the resource.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Gets the name of the activity.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Gets or sets the properties of the activity.
     */
    @JsonProperty(value = "properties")
    private ActivityProperties innerProperties;

    /**
     * Get the id property: Gets or sets the id of the resource.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Gets or sets the id of the resource.
     *
     * @param id the id value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the name property: Gets the name of the activity.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the innerProperties property: Gets or sets the properties of the activity.
     *
     * @return the innerProperties value.
     */
    private ActivityProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the definition property: Gets or sets the user name of the activity.
     *
     * @return the definition value.
     */
    public String definition() {
        return this.innerProperties() == null ? null : this.innerProperties().definition();
    }

    /**
     * Set the definition property: Gets or sets the user name of the activity.
     *
     * @param definition the definition value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withDefinition(String definition) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityProperties();
        }
        this.innerProperties().withDefinition(definition);
        return this;
    }

    /**
     * Get the parameterSets property: Gets or sets the parameter sets of the activity.
     *
     * @return the parameterSets value.
     */
    public List<ActivityParameterSet> parameterSets() {
        return this.innerProperties() == null ? null : this.innerProperties().parameterSets();
    }

    /**
     * Set the parameterSets property: Gets or sets the parameter sets of the activity.
     *
     * @param parameterSets the parameterSets value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withParameterSets(List<ActivityParameterSet> parameterSets) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityProperties();
        }
        this.innerProperties().withParameterSets(parameterSets);
        return this;
    }

    /**
     * Get the outputTypes property: Gets or sets the output types of the activity.
     *
     * @return the outputTypes value.
     */
    public List<ActivityOutputType> outputTypes() {
        return this.innerProperties() == null ? null : this.innerProperties().outputTypes();
    }

    /**
     * Set the outputTypes property: Gets or sets the output types of the activity.
     *
     * @param outputTypes the outputTypes value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withOutputTypes(List<ActivityOutputType> outputTypes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityProperties();
        }
        this.innerProperties().withOutputTypes(outputTypes);
        return this;
    }

    /**
     * Get the creationTime property: Gets or sets the creation time.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.innerProperties() == null ? null : this.innerProperties().creationTime();
    }

    /**
     * Set the creationTime property: Gets or sets the creation time.
     *
     * @param creationTime the creationTime value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withCreationTime(OffsetDateTime creationTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityProperties();
        }
        this.innerProperties().withCreationTime(creationTime);
        return this;
    }

    /**
     * Get the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
    }

    /**
     * Set the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityProperties();
        }
        this.innerProperties().withLastModifiedTime(lastModifiedTime);
        return this;
    }

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

    /**
     * Set the description property: Gets or sets the description.
     *
     * @param description the description value to set.
     * @return the ActivityInner object itself.
     */
    public ActivityInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

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