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

package com.azure.resourcemanager.securitydevops.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The AzureDevOpsConnectorProperties model. */
@Fluent
public final class AzureDevOpsConnectorProperties {
    /*
     * The provisioningState property.
     */
    @JsonProperty(value = "provisioningState")
    private ProvisioningState provisioningState;

    /*
     * The authorization property.
     */
    @JsonProperty(value = "authorization")
    private AuthorizationInfo authorization;

    /*
     * Gets or sets org onboarding information.
     */
    @JsonProperty(value = "orgs")
    private List<AzureDevOpsOrgMetadata> orgs;

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

    /**
     * Get the provisioningState property: The provisioningState property.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: The provisioningState property.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the AzureDevOpsConnectorProperties object itself.
     */
    public AzureDevOpsConnectorProperties withProvisioningState(ProvisioningState provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the authorization property: The authorization property.
     *
     * @return the authorization value.
     */
    public AuthorizationInfo authorization() {
        return this.authorization;
    }

    /**
     * Set the authorization property: The authorization property.
     *
     * @param authorization the authorization value to set.
     * @return the AzureDevOpsConnectorProperties object itself.
     */
    public AzureDevOpsConnectorProperties withAuthorization(AuthorizationInfo authorization) {
        this.authorization = authorization;
        return this;
    }

    /**
     * Get the orgs property: Gets or sets org onboarding information.
     *
     * @return the orgs value.
     */
    public List<AzureDevOpsOrgMetadata> orgs() {
        return this.orgs;
    }

    /**
     * Set the orgs property: Gets or sets org onboarding information.
     *
     * @param orgs the orgs value to set.
     * @return the AzureDevOpsConnectorProperties object itself.
     */
    public AzureDevOpsConnectorProperties withOrgs(List<AzureDevOpsOrgMetadata> orgs) {
        this.orgs = orgs;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (authorization() != null) {
            authorization().validate();
        }
        if (orgs() != null) {
            orgs().forEach(e -> e.validate());
        }
    }
}
