// 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.AzureBlobDefinition;
import com.azure.resourcemanager.kubernetesconfiguration.models.BucketDefinition;
import com.azure.resourcemanager.kubernetesconfiguration.models.FluxComplianceState;
import com.azure.resourcemanager.kubernetesconfiguration.models.GitRepositoryDefinition;
import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationDefinition;
import com.azure.resourcemanager.kubernetesconfiguration.models.ObjectStatusDefinition;
import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningState;
import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeType;
import com.azure.resourcemanager.kubernetesconfiguration.models.SourceKindType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** The Flux Configuration object returned in Get &amp; Put response. */
@Fluent
public final class FluxConfigurationInner extends ProxyResource {
    /*
     * Properties to create a Flux Configuration resource
     */
    @JsonProperty(value = "properties")
    private FluxConfigurationProperties 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 FluxConfigurationInner class. */
    public FluxConfigurationInner() {
    }

    /**
     * Get the innerProperties property: Properties to create a Flux Configuration resource.
     *
     * @return the innerProperties value.
     */
    private FluxConfigurationProperties 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 scope property: Scope at which the operator will be installed.
     *
     * @return the scope value.
     */
    public ScopeType scope() {
        return this.innerProperties() == null ? null : this.innerProperties().scope();
    }

    /**
     * Set the scope property: Scope at which the operator will be installed.
     *
     * @param scope the scope value to set.
     * @return the FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withScope(ScopeType scope) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        this.innerProperties().withScope(scope);
        return this;
    }

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

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

    /**
     * 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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withSourceKind(SourceKindType sourceKind) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withSuspend(Boolean suspend) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        this.innerProperties().withSuspend(suspend);
        return this;
    }

    /**
     * Get the gitRepository property: Parameters to reconcile to the GitRepository source kind type.
     *
     * @return the gitRepository value.
     */
    public GitRepositoryDefinition 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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withGitRepository(GitRepositoryDefinition gitRepository) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        this.innerProperties().withGitRepository(gitRepository);
        return this;
    }

    /**
     * Get the bucket property: Parameters to reconcile to the Bucket source kind type.
     *
     * @return the bucket value.
     */
    public BucketDefinition 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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withBucket(BucketDefinition bucket) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        this.innerProperties().withBucket(bucket);
        return this;
    }

    /**
     * Get the azureBlob property: Parameters to reconcile to the AzureBlob source kind type.
     *
     * @return the azureBlob value.
     */
    public AzureBlobDefinition 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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withAzureBlob(AzureBlobDefinition azureBlob) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        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, KustomizationDefinition> 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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withKustomizations(Map<String, KustomizationDefinition> kustomizations) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        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 FluxConfigurationInner object itself.
     */
    public FluxConfigurationInner withConfigurationProtectedSettings(
        Map<String, String> configurationProtectedSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluxConfigurationProperties();
        }
        this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings);
        return this;
    }

    /**
     * Get the statuses property: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created
     * by the managed objects provisioned by the fluxConfiguration.
     *
     * @return the statuses value.
     */
    public List<ObjectStatusDefinition> statuses() {
        return this.innerProperties() == null ? null : this.innerProperties().statuses();
    }

    /**
     * Get the repositoryPublicKey property: Public Key associated with this fluxConfiguration (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 sourceSyncedCommitId property: Branch and/or SHA of the source commit synced with the cluster.
     *
     * @return the sourceSyncedCommitId value.
     */
    public String sourceSyncedCommitId() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceSyncedCommitId();
    }

    /**
     * Get the sourceUpdatedAt property: Datetime the fluxConfiguration synced its source on the cluster.
     *
     * @return the sourceUpdatedAt value.
     */
    public OffsetDateTime sourceUpdatedAt() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceUpdatedAt();
    }

    /**
     * Get the statusUpdatedAt property: Datetime the fluxConfiguration synced its status on the cluster with Azure.
     *
     * @return the statusUpdatedAt value.
     */
    public OffsetDateTime statusUpdatedAt() {
        return this.innerProperties() == null ? null : this.innerProperties().statusUpdatedAt();
    }

    /**
     * Get the complianceState property: Combined status of the Flux Kubernetes resources created by the
     * fluxConfiguration or created by the managed objects.
     *
     * @return the complianceState value.
     */
    public FluxComplianceState complianceState() {
        return this.innerProperties() == null ? null : this.innerProperties().complianceState();
    }

    /**
     * Get the provisioningState property: Status of the creation of the fluxConfiguration.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the errorMessage property: Error message returned to the user in the case of provisioning failure.
     *
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().errorMessage();
    }

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