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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.devhub.models.Acr;
import com.azure.resourcemanager.devhub.models.AuthorizationStatus;
import com.azure.resourcemanager.devhub.models.DeploymentProperties;
import com.azure.resourcemanager.devhub.models.DockerfileGenerationMode;
import com.azure.resourcemanager.devhub.models.GenerationLanguage;
import com.azure.resourcemanager.devhub.models.GenerationManifestType;
import com.azure.resourcemanager.devhub.models.GitHubWorkflowProfileOidcCredentials;
import com.azure.resourcemanager.devhub.models.ManifestGenerationMode;
import com.azure.resourcemanager.devhub.models.PullRequestStatus;
import com.azure.resourcemanager.devhub.models.WorkflowRun;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/**
 * Workflow
 *
 * <p>Resource representation of a workflow.
 */
@Fluent
public final class WorkflowInner extends Resource {
    /*
     * Properties of a workflow.
     */
    @JsonProperty(value = "properties")
    private WorkflowProperties 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 WorkflowInner class. */
    public WorkflowInner() {
    }

    /**
     * Get the innerProperties property: Properties of a workflow.
     *
     * @return the innerProperties value.
     */
    private WorkflowProperties 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;
    }

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

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

    /**
     * Get the repositoryOwner property: The owner of the repository the workflow is associated with.
     *
     * <p>Repository Owner.
     *
     * @return the repositoryOwner value.
     */
    public String repositoryOwner() {
        return this.innerProperties() == null ? null : this.innerProperties().repositoryOwner();
    }

    /**
     * Set the repositoryOwner property: The owner of the repository the workflow is associated with.
     *
     * <p>Repository Owner.
     *
     * @param repositoryOwner the repositoryOwner value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withRepositoryOwner(String repositoryOwner) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withRepositoryOwner(repositoryOwner);
        return this;
    }

    /**
     * Get the repositoryName property: The name of the repository the workflow is associated with.
     *
     * <p>Repository Name.
     *
     * @return the repositoryName value.
     */
    public String repositoryName() {
        return this.innerProperties() == null ? null : this.innerProperties().repositoryName();
    }

    /**
     * Set the repositoryName property: The name of the repository the workflow is associated with.
     *
     * <p>Repository Name.
     *
     * @param repositoryName the repositoryName value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withRepositoryName(String repositoryName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withRepositoryName(repositoryName);
        return this;
    }

    /**
     * Get the branchName property: The name of the branch the workflow is associated with.
     *
     * <p>Repository Branch Name.
     *
     * @return the branchName value.
     */
    public String branchName() {
        return this.innerProperties() == null ? null : this.innerProperties().branchName();
    }

    /**
     * Set the branchName property: The name of the branch the workflow is associated with.
     *
     * <p>Repository Branch Name.
     *
     * @param branchName the branchName value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withBranchName(String branchName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withBranchName(branchName);
        return this;
    }

    /**
     * Get the dockerfile property: Path to Dockerfile within the repository.
     *
     * <p>Path to the Dockerfile within the repository.
     *
     * @return the dockerfile value.
     */
    public String dockerfile() {
        return this.innerProperties() == null ? null : this.innerProperties().dockerfile();
    }

    /**
     * Set the dockerfile property: Path to Dockerfile within the repository.
     *
     * <p>Path to the Dockerfile within the repository.
     *
     * @param dockerfile the dockerfile value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withDockerfile(String dockerfile) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withDockerfile(dockerfile);
        return this;
    }

    /**
     * Get the dockerBuildContext property: Path to Dockerfile Build Context within the repository.
     *
     * @return the dockerBuildContext value.
     */
    public String dockerBuildContext() {
        return this.innerProperties() == null ? null : this.innerProperties().dockerBuildContext();
    }

    /**
     * Set the dockerBuildContext property: Path to Dockerfile Build Context within the repository.
     *
     * @param dockerBuildContext the dockerBuildContext value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withDockerBuildContext(String dockerBuildContext) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withDockerBuildContext(dockerBuildContext);
        return this;
    }

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

    /**
     * Set the deploymentProperties property: The deploymentProperties property.
     *
     * @param deploymentProperties the deploymentProperties value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withDeploymentProperties(DeploymentProperties deploymentProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withDeploymentProperties(deploymentProperties);
        return this;
    }

    /**
     * Get the namespace property: The Kubernetes namespace the application is deployed to
     *
     * <p>Kubernetes namespace the application is deployed to.
     *
     * @return the namespace value.
     */
    public String namespace() {
        return this.innerProperties() == null ? null : this.innerProperties().namespace();
    }

    /**
     * Set the namespace property: The Kubernetes namespace the application is deployed to
     *
     * <p>Kubernetes namespace the application is deployed to.
     *
     * @param namespace the namespace value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withNamespace(String namespace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withNamespace(namespace);
        return this;
    }

    /**
     * Get the acr property: Information on the azure container registry.
     *
     * @return the acr value.
     */
    public Acr acr() {
        return this.innerProperties() == null ? null : this.innerProperties().acr();
    }

    /**
     * Set the acr property: Information on the azure container registry.
     *
     * @param acr the acr value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withAcr(Acr acr) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withAcr(acr);
        return this;
    }

    /**
     * Get the oidcCredentials property: The fields needed for OIDC with GitHub.
     *
     * @return the oidcCredentials value.
     */
    public GitHubWorkflowProfileOidcCredentials oidcCredentials() {
        return this.innerProperties() == null ? null : this.innerProperties().oidcCredentials();
    }

    /**
     * Set the oidcCredentials property: The fields needed for OIDC with GitHub.
     *
     * @param oidcCredentials the oidcCredentials value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withOidcCredentials(GitHubWorkflowProfileOidcCredentials oidcCredentials) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withOidcCredentials(oidcCredentials);
        return this;
    }

    /**
     * Get the aksResourceId property: The Azure Kubernetes Managed Cluster resource.
     *
     * <p>The Azure Kubernetes Cluster Resource the application will be deployed to.
     *
     * @return the aksResourceId value.
     */
    public String aksResourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().aksResourceId();
    }

    /**
     * Set the aksResourceId property: The Azure Kubernetes Managed Cluster resource.
     *
     * <p>The Azure Kubernetes Cluster Resource the application will be deployed to.
     *
     * @param aksResourceId the aksResourceId value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withAksResourceId(String aksResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withAksResourceId(aksResourceId);
        return this;
    }

    /**
     * Get the prUrl property: The URL to the Pull Request submitted against the users repository.
     *
     * @return the prUrl value.
     */
    public String prUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().prUrl();
    }

    /**
     * Get the pullNumber property: The number associated with the submitted pull request.
     *
     * @return the pullNumber value.
     */
    public Integer pullNumber() {
        return this.innerProperties() == null ? null : this.innerProperties().pullNumber();
    }

    /**
     * Get the prStatus property: The status of the Pull Request submitted against the users repository.
     *
     * @return the prStatus value.
     */
    public PullRequestStatus prStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().prStatus();
    }

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

    /**
     * Set the lastWorkflowRun property: The lastWorkflowRun property.
     *
     * @param lastWorkflowRun the lastWorkflowRun value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withLastWorkflowRun(WorkflowRun lastWorkflowRun) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withLastWorkflowRun(lastWorkflowRun);
        return this;
    }

    /**
     * Get the authStatus property: Determines the authorization status of requests.
     *
     * @return the authStatus value.
     */
    public AuthorizationStatus authStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().authStatus();
    }

    /**
     * Get the generationLanguage property: The programming language used.
     *
     * @return the generationLanguage value.
     */
    public GenerationLanguage generationLanguage() {
        return this.innerProperties() == null ? null : this.innerProperties().generationLanguage();
    }

    /**
     * Set the generationLanguage property: The programming language used.
     *
     * @param generationLanguage the generationLanguage value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withGenerationLanguage(GenerationLanguage generationLanguage) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withGenerationLanguage(generationLanguage);
        return this;
    }

    /**
     * Get the languageVersion property: The version of the language image used for execution in the generated
     * dockerfile.
     *
     * @return the languageVersion value.
     */
    public String languageVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().languageVersion();
    }

    /**
     * Set the languageVersion property: The version of the language image used for execution in the generated
     * dockerfile.
     *
     * @param languageVersion the languageVersion value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withLanguageVersion(String languageVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withLanguageVersion(languageVersion);
        return this;
    }

    /**
     * Get the builderVersion property: The version of the language image used for building the code in the generated
     * dockerfile.
     *
     * @return the builderVersion value.
     */
    public String builderVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().builderVersion();
    }

    /**
     * Set the builderVersion property: The version of the language image used for building the code in the generated
     * dockerfile.
     *
     * @param builderVersion the builderVersion value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withBuilderVersion(String builderVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withBuilderVersion(builderVersion);
        return this;
    }

    /**
     * Get the port property: The port the application is exposed on.
     *
     * @return the port value.
     */
    public String port() {
        return this.innerProperties() == null ? null : this.innerProperties().port();
    }

    /**
     * Set the port property: The port the application is exposed on.
     *
     * @param port the port value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withPort(String port) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withPort(port);
        return this;
    }

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

    /**
     * Set the appName property: The name of the app.
     *
     * @param appName the appName value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withAppName(String appName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withAppName(appName);
        return this;
    }

    /**
     * Get the dockerfileOutputDirectory property: The directory to output the generated Dockerfile to.
     *
     * @return the dockerfileOutputDirectory value.
     */
    public String dockerfileOutputDirectory() {
        return this.innerProperties() == null ? null : this.innerProperties().dockerfileOutputDirectory();
    }

    /**
     * Set the dockerfileOutputDirectory property: The directory to output the generated Dockerfile to.
     *
     * @param dockerfileOutputDirectory the dockerfileOutputDirectory value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withDockerfileOutputDirectory(String dockerfileOutputDirectory) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withDockerfileOutputDirectory(dockerfileOutputDirectory);
        return this;
    }

    /**
     * Get the manifestOutputDirectory property: The directory to output the generated manifests to.
     *
     * @return the manifestOutputDirectory value.
     */
    public String manifestOutputDirectory() {
        return this.innerProperties() == null ? null : this.innerProperties().manifestOutputDirectory();
    }

    /**
     * Set the manifestOutputDirectory property: The directory to output the generated manifests to.
     *
     * @param manifestOutputDirectory the manifestOutputDirectory value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withManifestOutputDirectory(String manifestOutputDirectory) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withManifestOutputDirectory(manifestOutputDirectory);
        return this;
    }

    /**
     * Get the dockerfileGenerationMode property: The mode of generation to be used for generating Dockerfiles.
     *
     * @return the dockerfileGenerationMode value.
     */
    public DockerfileGenerationMode dockerfileGenerationMode() {
        return this.innerProperties() == null ? null : this.innerProperties().dockerfileGenerationMode();
    }

    /**
     * Set the dockerfileGenerationMode property: The mode of generation to be used for generating Dockerfiles.
     *
     * @param dockerfileGenerationMode the dockerfileGenerationMode value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withDockerfileGenerationMode(DockerfileGenerationMode dockerfileGenerationMode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withDockerfileGenerationMode(dockerfileGenerationMode);
        return this;
    }

    /**
     * Get the manifestGenerationMode property: The mode of generation to be used for generating Manifest.
     *
     * @return the manifestGenerationMode value.
     */
    public ManifestGenerationMode manifestGenerationMode() {
        return this.innerProperties() == null ? null : this.innerProperties().manifestGenerationMode();
    }

    /**
     * Set the manifestGenerationMode property: The mode of generation to be used for generating Manifest.
     *
     * @param manifestGenerationMode the manifestGenerationMode value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withManifestGenerationMode(ManifestGenerationMode manifestGenerationMode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withManifestGenerationMode(manifestGenerationMode);
        return this;
    }

    /**
     * Get the manifestType property: Determines the type of manifests to be generated.
     *
     * @return the manifestType value.
     */
    public GenerationManifestType manifestType() {
        return this.innerProperties() == null ? null : this.innerProperties().manifestType();
    }

    /**
     * Set the manifestType property: Determines the type of manifests to be generated.
     *
     * @param manifestType the manifestType value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withManifestType(GenerationManifestType manifestType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withManifestType(manifestType);
        return this;
    }

    /**
     * Get the imageName property: The name of the image to be generated.
     *
     * @return the imageName value.
     */
    public String imageName() {
        return this.innerProperties() == null ? null : this.innerProperties().imageName();
    }

    /**
     * Set the imageName property: The name of the image to be generated.
     *
     * @param imageName the imageName value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withImageName(String imageName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withImageName(imageName);
        return this;
    }

    /**
     * Get the namespaceArtifactGenerationPropertiesNamespace property: The namespace to deploy the application to.
     *
     * @return the namespaceArtifactGenerationPropertiesNamespace value.
     */
    public String namespaceArtifactGenerationPropertiesNamespace() {
        return this.innerProperties() == null
            ? null
            : this.innerProperties().namespaceArtifactGenerationPropertiesNamespace();
    }

    /**
     * Set the namespaceArtifactGenerationPropertiesNamespace property: The namespace to deploy the application to.
     *
     * @param namespaceArtifactGenerationPropertiesNamespace the namespaceArtifactGenerationPropertiesNamespace value to
     *     set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withNamespaceArtifactGenerationPropertiesNamespace(
        String namespaceArtifactGenerationPropertiesNamespace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this
            .innerProperties()
            .withNamespaceArtifactGenerationPropertiesNamespace(namespaceArtifactGenerationPropertiesNamespace);
        return this;
    }

    /**
     * Get the imageTag property: The tag to apply to the generated image.
     *
     * @return the imageTag value.
     */
    public String imageTag() {
        return this.innerProperties() == null ? null : this.innerProperties().imageTag();
    }

    /**
     * Set the imageTag property: The tag to apply to the generated image.
     *
     * @param imageTag the imageTag value to set.
     * @return the WorkflowInner object itself.
     */
    public WorkflowInner withImageTag(String imageTag) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkflowProperties();
        }
        this.innerProperties().withImageTag(imageTag);
        return this;
    }

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