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

package com.azure.resourcemanager.securityinsights.models;

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

/** Resources created in user's repository for the source-control. */
@Fluent
public final class RepositoryResourceInfo {
    /*
     * The webhook object created for the source-control.
     */
    @JsonProperty(value = "webhook")
    private Webhook webhook;

    /*
     * Resources created in GitHub for this source-control.
     */
    @JsonProperty(value = "gitHubResourceInfo")
    private GitHubResourceInfo gitHubResourceInfo;

    /*
     * Resources created in Azure DevOps for this source-control.
     */
    @JsonProperty(value = "azureDevOpsResourceInfo")
    private AzureDevOpsResourceInfo azureDevOpsResourceInfo;

    /**
     * Get the webhook property: The webhook object created for the source-control.
     *
     * @return the webhook value.
     */
    public Webhook webhook() {
        return this.webhook;
    }

    /**
     * Set the webhook property: The webhook object created for the source-control.
     *
     * @param webhook the webhook value to set.
     * @return the RepositoryResourceInfo object itself.
     */
    public RepositoryResourceInfo withWebhook(Webhook webhook) {
        this.webhook = webhook;
        return this;
    }

    /**
     * Get the gitHubResourceInfo property: Resources created in GitHub for this source-control.
     *
     * @return the gitHubResourceInfo value.
     */
    public GitHubResourceInfo gitHubResourceInfo() {
        return this.gitHubResourceInfo;
    }

    /**
     * Set the gitHubResourceInfo property: Resources created in GitHub for this source-control.
     *
     * @param gitHubResourceInfo the gitHubResourceInfo value to set.
     * @return the RepositoryResourceInfo object itself.
     */
    public RepositoryResourceInfo withGitHubResourceInfo(GitHubResourceInfo gitHubResourceInfo) {
        this.gitHubResourceInfo = gitHubResourceInfo;
        return this;
    }

    /**
     * Get the azureDevOpsResourceInfo property: Resources created in Azure DevOps for this source-control.
     *
     * @return the azureDevOpsResourceInfo value.
     */
    public AzureDevOpsResourceInfo azureDevOpsResourceInfo() {
        return this.azureDevOpsResourceInfo;
    }

    /**
     * Set the azureDevOpsResourceInfo property: Resources created in Azure DevOps for this source-control.
     *
     * @param azureDevOpsResourceInfo the azureDevOpsResourceInfo value to set.
     * @return the RepositoryResourceInfo object itself.
     */
    public RepositoryResourceInfo withAzureDevOpsResourceInfo(AzureDevOpsResourceInfo azureDevOpsResourceInfo) {
        this.azureDevOpsResourceInfo = azureDevOpsResourceInfo;
        return this;
    }

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