// 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.resourcemanager.automation.models.RunAsCredentialAssociationProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The hybrid runbook worker group properties. */
@Fluent
public final class HybridRunbookWorkerGroupCreateOrUpdateProperties {
    /*
     * Sets the credential of a worker group.
     */
    @JsonProperty(value = "credential")
    private RunAsCredentialAssociationProperty credential;

    /**
     * Get the credential property: Sets the credential of a worker group.
     *
     * @return the credential value.
     */
    public RunAsCredentialAssociationProperty credential() {
        return this.credential;
    }

    /**
     * Set the credential property: Sets the credential of a worker group.
     *
     * @param credential the credential value to set.
     * @return the HybridRunbookWorkerGroupCreateOrUpdateProperties object itself.
     */
    public HybridRunbookWorkerGroupCreateOrUpdateProperties withCredential(
        RunAsCredentialAssociationProperty credential) {
        this.credential = credential;
        return this;
    }

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