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

package com.azure.resourcemanager.logic.models;

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

/** The Api reference. */
@Fluent
public final class ApiReference extends ResourceReference {
    /*
     * The display name of the api.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * The description of the api.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * The icon uri of the api.
     */
    @JsonProperty(value = "iconUri")
    private String iconUri;

    /*
     * The swagger of the api.
     */
    @JsonProperty(value = "swagger")
    private Object swagger;

    /*
     * The brand color of the api.
     */
    @JsonProperty(value = "brandColor")
    private String brandColor;

    /*
     * The tier.
     */
    @JsonProperty(value = "category")
    private ApiTier category;

    /*
     * The integration service environment reference.
     */
    @JsonProperty(value = "integrationServiceEnvironment")
    private ResourceReference integrationServiceEnvironment;

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

    /**
     * Get the displayName property: The display name of the api.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: The display name of the api.
     *
     * @param displayName the displayName value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the description property: The description of the api.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: The description of the api.
     *
     * @param description the description value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the iconUri property: The icon uri of the api.
     *
     * @return the iconUri value.
     */
    public String iconUri() {
        return this.iconUri;
    }

    /**
     * Set the iconUri property: The icon uri of the api.
     *
     * @param iconUri the iconUri value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withIconUri(String iconUri) {
        this.iconUri = iconUri;
        return this;
    }

    /**
     * Get the swagger property: The swagger of the api.
     *
     * @return the swagger value.
     */
    public Object swagger() {
        return this.swagger;
    }

    /**
     * Set the swagger property: The swagger of the api.
     *
     * @param swagger the swagger value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withSwagger(Object swagger) {
        this.swagger = swagger;
        return this;
    }

    /**
     * Get the brandColor property: The brand color of the api.
     *
     * @return the brandColor value.
     */
    public String brandColor() {
        return this.brandColor;
    }

    /**
     * Set the brandColor property: The brand color of the api.
     *
     * @param brandColor the brandColor value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withBrandColor(String brandColor) {
        this.brandColor = brandColor;
        return this;
    }

    /**
     * Get the category property: The tier.
     *
     * @return the category value.
     */
    public ApiTier category() {
        return this.category;
    }

    /**
     * Set the category property: The tier.
     *
     * @param category the category value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withCategory(ApiTier category) {
        this.category = category;
        return this;
    }

    /**
     * Get the integrationServiceEnvironment property: The integration service environment reference.
     *
     * @return the integrationServiceEnvironment value.
     */
    public ResourceReference integrationServiceEnvironment() {
        return this.integrationServiceEnvironment;
    }

    /**
     * Set the integrationServiceEnvironment property: The integration service environment reference.
     *
     * @param integrationServiceEnvironment the integrationServiceEnvironment value to set.
     * @return the ApiReference object itself.
     */
    public ApiReference withIntegrationServiceEnvironment(ResourceReference integrationServiceEnvironment) {
        this.integrationServiceEnvironment = integrationServiceEnvironment;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ApiReference withId(String id) {
        super.withId(id);
        return this;
    }

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