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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.kubernetesconfiguration.models.ComplianceStatus;
import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties;
import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType;
import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType;
import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningStateType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The SourceControl Configuration object returned in Get &amp; Put response. */
@Fluent
public final class SourceControlConfigurationInner extends ProxyResource {
    /*
     * Properties to create a Source Control Configuration resource
     */
    @JsonProperty(value = "properties")
    private SourceControlConfigurationProperties innerProperties;

    /*
     * Top level metadata
     * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Properties to create a Source Control Configuration resource.
     *
     * @return the innerProperties value.
     */
    private SourceControlConfigurationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Top level metadata
     * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the repositoryUrl property: Url of the SourceControl Repository.
     *
     * @return the repositoryUrl value.
     */
    public String repositoryUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().repositoryUrl();
    }

    /**
     * Set the repositoryUrl property: Url of the SourceControl Repository.
     *
     * @param repositoryUrl the repositoryUrl value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withRepositoryUrl(String repositoryUrl) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withRepositoryUrl(repositoryUrl);
        return this;
    }

    /**
     * Get the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower
     * case alphanumeric characters, hyphen and period only.
     *
     * @return the operatorNamespace value.
     */
    public String operatorNamespace() {
        return this.innerProperties() == null ? null : this.innerProperties().operatorNamespace();
    }

    /**
     * Set the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower
     * case alphanumeric characters, hyphen and period only.
     *
     * @param operatorNamespace the operatorNamespace value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withOperatorNamespace(String operatorNamespace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withOperatorNamespace(operatorNamespace);
        return this;
    }

    /**
     * Get the operatorInstanceName property: Instance name of the operator - identifying the specific configuration.
     *
     * @return the operatorInstanceName value.
     */
    public String operatorInstanceName() {
        return this.innerProperties() == null ? null : this.innerProperties().operatorInstanceName();
    }

    /**
     * Set the operatorInstanceName property: Instance name of the operator - identifying the specific configuration.
     *
     * @param operatorInstanceName the operatorInstanceName value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withOperatorInstanceName(String operatorInstanceName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withOperatorInstanceName(operatorInstanceName);
        return this;
    }

    /**
     * Get the operatorType property: Type of the operator.
     *
     * @return the operatorType value.
     */
    public OperatorType operatorType() {
        return this.innerProperties() == null ? null : this.innerProperties().operatorType();
    }

    /**
     * Set the operatorType property: Type of the operator.
     *
     * @param operatorType the operatorType value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withOperatorType(OperatorType operatorType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withOperatorType(operatorType);
        return this;
    }

    /**
     * Get the operatorParams property: Any Parameters for the Operator instance in string format.
     *
     * @return the operatorParams value.
     */
    public String operatorParams() {
        return this.innerProperties() == null ? null : this.innerProperties().operatorParams();
    }

    /**
     * Set the operatorParams property: Any Parameters for the Operator instance in string format.
     *
     * @param operatorParams the operatorParams value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withOperatorParams(String operatorParams) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withOperatorParams(operatorParams);
        return this;
    }

    /**
     * Get the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the
     * configuration.
     *
     * @return the configurationProtectedSettings value.
     */
    public Map<String, String> configurationProtectedSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().configurationProtectedSettings();
    }

    /**
     * Set the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the
     * configuration.
     *
     * @param configurationProtectedSettings the configurationProtectedSettings value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withConfigurationProtectedSettings(
        Map<String, String> configurationProtectedSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings);
        return this;
    }

    /**
     * Get the operatorScope property: Scope at which the operator will be installed.
     *
     * @return the operatorScope value.
     */
    public OperatorScopeType operatorScope() {
        return this.innerProperties() == null ? null : this.innerProperties().operatorScope();
    }

    /**
     * Set the operatorScope property: Scope at which the operator will be installed.
     *
     * @param operatorScope the operatorScope value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withOperatorScope(OperatorScopeType operatorScope) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withOperatorScope(operatorScope);
        return this;
    }

    /**
     * Get the repositoryPublicKey property: Public Key associated with this SourceControl configuration (either
     * generated within the cluster or provided by the user).
     *
     * @return the repositoryPublicKey value.
     */
    public String repositoryPublicKey() {
        return this.innerProperties() == null ? null : this.innerProperties().repositoryPublicKey();
    }

    /**
     * Get the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required
     * to access private Git instances.
     *
     * @return the sshKnownHostsContents value.
     */
    public String sshKnownHostsContents() {
        return this.innerProperties() == null ? null : this.innerProperties().sshKnownHostsContents();
    }

    /**
     * Set the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required
     * to access private Git instances.
     *
     * @param sshKnownHostsContents the sshKnownHostsContents value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withSshKnownHostsContents(String sshKnownHostsContents) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withSshKnownHostsContents(sshKnownHostsContents);
        return this;
    }

    /**
     * Get the enableHelmOperator property: Option to enable Helm Operator for this git configuration.
     *
     * @return the enableHelmOperator value.
     */
    public Boolean enableHelmOperator() {
        return this.innerProperties() == null ? null : this.innerProperties().enableHelmOperator();
    }

    /**
     * Set the enableHelmOperator property: Option to enable Helm Operator for this git configuration.
     *
     * @param enableHelmOperator the enableHelmOperator value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withEnableHelmOperator(Boolean enableHelmOperator) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withEnableHelmOperator(enableHelmOperator);
        return this;
    }

    /**
     * Get the helmOperatorProperties property: Properties for Helm operator.
     *
     * @return the helmOperatorProperties value.
     */
    public HelmOperatorProperties helmOperatorProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().helmOperatorProperties();
    }

    /**
     * Set the helmOperatorProperties property: Properties for Helm operator.
     *
     * @param helmOperatorProperties the helmOperatorProperties value to set.
     * @return the SourceControlConfigurationInner object itself.
     */
    public SourceControlConfigurationInner withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlConfigurationProperties();
        }
        this.innerProperties().withHelmOperatorProperties(helmOperatorProperties);
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the resource provider.
     *
     * @return the provisioningState value.
     */
    public ProvisioningStateType provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the complianceStatus property: Compliance Status of the Configuration.
     *
     * @return the complianceStatus value.
     */
    public ComplianceStatus complianceStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().complianceStatus();
    }

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