// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.FluxConfigurationPatchProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The Flux Configuration Patch Request object. */
@Fluent
public final class FluxConfigurationPatch {
    /*
     * Updatable properties of an Flux Configuration Patch Request
     */
    @JsonProperty(value = "properties")
    private FluxConfigurationPatchProperties innerProperties;

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

    /**
     * Get the innerProperties property: Updatable properties of an Flux Configuration Patch Request.
     *
     * @return the innerProperties value.
     */
    private FluxConfigurationPatchProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the sourceKind property: Source Kind to pull the configuration data from.
     *
     * @return the sourceKind value.
     */
    public SourceKindType sourceKind() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceKind();
    }

    /**
     * Set the sourceKind property: Source Kind to pull the configuration data from.
     *
     * @param sourceKind the sourceKind value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withSourceKind(SourceKindType sourceKind) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withSourceKind(sourceKind);
        return this;
    }

    /**
     * Get the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and
     * sources.
     *
     * @return the suspend value.
     */
    public Boolean suspend() {
        return this.innerProperties() == null ? null : this.innerProperties().suspend();
    }

    /**
     * Set the suspend property: Whether this configuration should suspend its reconciliation of its kustomizations and
     * sources.
     *
     * @param suspend the suspend value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withSuspend(Boolean suspend) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withSuspend(suspend);
        return this;
    }

    /**
     * Get the gitRepository property: Parameters to reconcile to the GitRepository source kind type.
     *
     * @return the gitRepository value.
     */
    public GitRepositoryPatchDefinition gitRepository() {
        return this.innerProperties() == null ? null : this.innerProperties().gitRepository();
    }

    /**
     * Set the gitRepository property: Parameters to reconcile to the GitRepository source kind type.
     *
     * @param gitRepository the gitRepository value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withGitRepository(GitRepositoryPatchDefinition gitRepository) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withGitRepository(gitRepository);
        return this;
    }

    /**
     * Get the bucket property: Parameters to reconcile to the Bucket source kind type.
     *
     * @return the bucket value.
     */
    public BucketPatchDefinition bucket() {
        return this.innerProperties() == null ? null : this.innerProperties().bucket();
    }

    /**
     * Set the bucket property: Parameters to reconcile to the Bucket source kind type.
     *
     * @param bucket the bucket value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withBucket(BucketPatchDefinition bucket) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withBucket(bucket);
        return this;
    }

    /**
     * Get the azureBlob property: Parameters to reconcile to the AzureBlob source kind type.
     *
     * @return the azureBlob value.
     */
    public AzureBlobPatchDefinition azureBlob() {
        return this.innerProperties() == null ? null : this.innerProperties().azureBlob();
    }

    /**
     * Set the azureBlob property: Parameters to reconcile to the AzureBlob source kind type.
     *
     * @param azureBlob the azureBlob value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withAzureBlob(AzureBlobPatchDefinition azureBlob) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withAzureBlob(azureBlob);
        return this;
    }

    /**
     * Get the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type
     * on the cluster.
     *
     * @return the kustomizations value.
     */
    public Map<String, KustomizationPatchDefinition> kustomizations() {
        return this.innerProperties() == null ? null : this.innerProperties().kustomizations();
    }

    /**
     * Set the kustomizations property: Array of kustomizations used to reconcile the artifact pulled by the source type
     * on the cluster.
     *
     * @param kustomizations the kustomizations value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withKustomizations(Map<String, KustomizationPatchDefinition> kustomizations) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withKustomizations(kustomizations);
        return this;
    }

    /**
     * Get the configurationProtectedSettings property: Key-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: Key-value pairs of protected configuration settings for the
     * configuration.
     *
     * @param configurationProtectedSettings the configurationProtectedSettings value to set.
     * @return the FluxConfigurationPatch object itself.
     */
    public FluxConfigurationPatch withConfigurationProtectedSettings(
        Map<String, String> configurationProtectedSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationPatchProperties();
        }
        this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings);
        return this;
    }

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