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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Definition of create source control sync job properties. */
@Fluent
public final class SourceControlSyncJobCreateProperties {
    /*
     * The commit id of the source control sync job. If not syncing to a commitId, enter an empty string.
     */
    @JsonProperty(value = "commitId", required = true)
    private String commitId;

    /**
     * Get the commitId property: The commit id of the source control sync job. If not syncing to a commitId, enter an
     * empty string.
     *
     * @return the commitId value.
     */
    public String commitId() {
        return this.commitId;
    }

    /**
     * Set the commitId property: The commit id of the source control sync job. If not syncing to a commitId, enter an
     * empty string.
     *
     * @param commitId the commitId value to set.
     * @return the SourceControlSyncJobCreateProperties object itself.
     */
    public SourceControlSyncJobCreateProperties withCommitId(String commitId) {
        this.commitId = commitId;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (commitId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property commitId in model SourceControlSyncJobCreateProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(SourceControlSyncJobCreateProperties.class);
}
