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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.devtestlabs.models.IdentityProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** A container for a managed identity to execute DevTest lab services. */
@Fluent
public final class ServiceRunnerInner extends Resource {
    /*
     * The identity of the resource.
     */
    @JsonProperty(value = "identity")
    private IdentityProperties identity;

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

    /**
     * Get the identity property: The identity of the resource.
     *
     * @return the identity value.
     */
    public IdentityProperties identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The identity of the resource.
     *
     * @param identity the identity value to set.
     * @return the ServiceRunnerInner object itself.
     */
    public ServiceRunnerInner withIdentity(IdentityProperties identity) {
        this.identity = identity;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceRunnerInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceRunnerInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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