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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.datamigration.models.ConnectionInfo;
import com.azure.resourcemanager.datamigration.models.DatabaseInfo;
import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState;
import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform;
import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** A project resource. */
@Fluent
public final class ProjectInner extends Resource {
    /*
     * Project properties
     */
    @JsonProperty(value = "properties")
    private ProjectProperties innerProperties;

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

    /**
     * Get the innerProperties property: Project properties.
     *
     * @return the innerProperties value.
     */
    private ProjectProperties innerProperties() {
        return this.innerProperties;
    }

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

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

    /**
     * Get the sourcePlatform property: Source platform for the project.
     *
     * @return the sourcePlatform value.
     */
    public ProjectSourcePlatform sourcePlatform() {
        return this.innerProperties() == null ? null : this.innerProperties().sourcePlatform();
    }

    /**
     * Set the sourcePlatform property: Source platform for the project.
     *
     * @param sourcePlatform the sourcePlatform value to set.
     * @return the ProjectInner object itself.
     */
    public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProjectProperties();
        }
        this.innerProperties().withSourcePlatform(sourcePlatform);
        return this;
    }

    /**
     * Get the targetPlatform property: Target platform for the project.
     *
     * @return the targetPlatform value.
     */
    public ProjectTargetPlatform targetPlatform() {
        return this.innerProperties() == null ? null : this.innerProperties().targetPlatform();
    }

    /**
     * Set the targetPlatform property: Target platform for the project.
     *
     * @param targetPlatform the targetPlatform value to set.
     * @return the ProjectInner object itself.
     */
    public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProjectProperties();
        }
        this.innerProperties().withTargetPlatform(targetPlatform);
        return this;
    }

    /**
     * Get the creationTime property: UTC Date and time when project was created.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.innerProperties() == null ? null : this.innerProperties().creationTime();
    }

    /**
     * Get the sourceConnectionInfo property: Information for connecting to source.
     *
     * @return the sourceConnectionInfo value.
     */
    public ConnectionInfo sourceConnectionInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceConnectionInfo();
    }

    /**
     * Set the sourceConnectionInfo property: Information for connecting to source.
     *
     * @param sourceConnectionInfo the sourceConnectionInfo value to set.
     * @return the ProjectInner object itself.
     */
    public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProjectProperties();
        }
        this.innerProperties().withSourceConnectionInfo(sourceConnectionInfo);
        return this;
    }

    /**
     * Get the targetConnectionInfo property: Information for connecting to target.
     *
     * @return the targetConnectionInfo value.
     */
    public ConnectionInfo targetConnectionInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().targetConnectionInfo();
    }

    /**
     * Set the targetConnectionInfo property: Information for connecting to target.
     *
     * @param targetConnectionInfo the targetConnectionInfo value to set.
     * @return the ProjectInner object itself.
     */
    public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProjectProperties();
        }
        this.innerProperties().withTargetConnectionInfo(targetConnectionInfo);
        return this;
    }

    /**
     * Get the databasesInfo property: List of DatabaseInfo.
     *
     * @return the databasesInfo value.
     */
    public List<DatabaseInfo> databasesInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().databasesInfo();
    }

    /**
     * Set the databasesInfo property: List of DatabaseInfo.
     *
     * @param databasesInfo the databasesInfo value to set.
     * @return the ProjectInner object itself.
     */
    public ProjectInner withDatabasesInfo(List<DatabaseInfo> databasesInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProjectProperties();
        }
        this.innerProperties().withDatabasesInfo(databasesInfo);
        return this;
    }

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

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