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

package com.azure.resourcemanager.appcontainers.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Configuration properties that define the mutable settings of a Container App SourceControl. */
@Fluent
public final class GithubActionConfiguration {
    /*
     * Registry configurations.
     */
    @JsonProperty(value = "registryInfo")
    private RegistryInfo registryInfo;

    /*
     * AzureCredentials configurations.
     */
    @JsonProperty(value = "azureCredentials")
    private AzureCredentials azureCredentials;

    /*
     * Context path
     */
    @JsonProperty(value = "contextPath")
    private String contextPath;

    /*
     * One time Github PAT to configure github environment
     */
    @JsonProperty(value = "githubPersonalAccessToken")
    private String githubPersonalAccessToken;

    /*
     * Image name
     */
    @JsonProperty(value = "image")
    private String image;

    /*
     * Code or Image
     */
    @JsonProperty(value = "publishType")
    private String publishType;

    /*
     * Operation system
     */
    @JsonProperty(value = "os")
    private String os;

    /*
     * Runtime stack
     */
    @JsonProperty(value = "runtimeStack")
    private String runtimeStack;

    /*
     * Runtime version
     */
    @JsonProperty(value = "runtimeVersion")
    private String runtimeVersion;

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

    /**
     * Get the registryInfo property: Registry configurations.
     *
     * @return the registryInfo value.
     */
    public RegistryInfo registryInfo() {
        return this.registryInfo;
    }

    /**
     * Set the registryInfo property: Registry configurations.
     *
     * @param registryInfo the registryInfo value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withRegistryInfo(RegistryInfo registryInfo) {
        this.registryInfo = registryInfo;
        return this;
    }

    /**
     * Get the azureCredentials property: AzureCredentials configurations.
     *
     * @return the azureCredentials value.
     */
    public AzureCredentials azureCredentials() {
        return this.azureCredentials;
    }

    /**
     * Set the azureCredentials property: AzureCredentials configurations.
     *
     * @param azureCredentials the azureCredentials value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withAzureCredentials(AzureCredentials azureCredentials) {
        this.azureCredentials = azureCredentials;
        return this;
    }

    /**
     * Get the contextPath property: Context path.
     *
     * @return the contextPath value.
     */
    public String contextPath() {
        return this.contextPath;
    }

    /**
     * Set the contextPath property: Context path.
     *
     * @param contextPath the contextPath value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withContextPath(String contextPath) {
        this.contextPath = contextPath;
        return this;
    }

    /**
     * Get the githubPersonalAccessToken property: One time Github PAT to configure github environment.
     *
     * @return the githubPersonalAccessToken value.
     */
    public String githubPersonalAccessToken() {
        return this.githubPersonalAccessToken;
    }

    /**
     * Set the githubPersonalAccessToken property: One time Github PAT to configure github environment.
     *
     * @param githubPersonalAccessToken the githubPersonalAccessToken value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withGithubPersonalAccessToken(String githubPersonalAccessToken) {
        this.githubPersonalAccessToken = githubPersonalAccessToken;
        return this;
    }

    /**
     * Get the image property: Image name.
     *
     * @return the image value.
     */
    public String image() {
        return this.image;
    }

    /**
     * Set the image property: Image name.
     *
     * @param image the image value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withImage(String image) {
        this.image = image;
        return this;
    }

    /**
     * Get the publishType property: Code or Image.
     *
     * @return the publishType value.
     */
    public String publishType() {
        return this.publishType;
    }

    /**
     * Set the publishType property: Code or Image.
     *
     * @param publishType the publishType value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withPublishType(String publishType) {
        this.publishType = publishType;
        return this;
    }

    /**
     * Get the os property: Operation system.
     *
     * @return the os value.
     */
    public String os() {
        return this.os;
    }

    /**
     * Set the os property: Operation system.
     *
     * @param os the os value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withOs(String os) {
        this.os = os;
        return this;
    }

    /**
     * Get the runtimeStack property: Runtime stack.
     *
     * @return the runtimeStack value.
     */
    public String runtimeStack() {
        return this.runtimeStack;
    }

    /**
     * Set the runtimeStack property: Runtime stack.
     *
     * @param runtimeStack the runtimeStack value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withRuntimeStack(String runtimeStack) {
        this.runtimeStack = runtimeStack;
        return this;
    }

    /**
     * Get the runtimeVersion property: Runtime version.
     *
     * @return the runtimeVersion value.
     */
    public String runtimeVersion() {
        return this.runtimeVersion;
    }

    /**
     * Set the runtimeVersion property: Runtime version.
     *
     * @param runtimeVersion the runtimeVersion value to set.
     * @return the GithubActionConfiguration object itself.
     */
    public GithubActionConfiguration withRuntimeVersion(String runtimeVersion) {
        this.runtimeVersion = runtimeVersion;
        return this;
    }

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