// 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The api resource metadata. */
@Fluent
public final class ApiResourceMetadata {
    /*
     * The source.
     */
    @JsonProperty(value = "source")
    private String source;

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

    /*
     * The hide key.
     */
    @JsonProperty(value = "hideKey")
    private String hideKey;

    /*
     * The tags.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * The api type.
     */
    @JsonProperty(value = "ApiType")
    private ApiType apiType;

    /*
     * The WSDL service.
     */
    @JsonProperty(value = "wsdlService")
    private WsdlService wsdlService;

    /*
     * The WSDL import method.
     */
    @JsonProperty(value = "wsdlImportMethod")
    private WsdlImportMethod wsdlImportMethod;

    /*
     * The connection type.
     */
    @JsonProperty(value = "connectionType")
    private String connectionType;

    /*
     * The provisioning state.
     */
    @JsonProperty(value = "provisioningState")
    private WorkflowProvisioningState provisioningState;

    /*
     * The connector deployment parameters metadata.
     */
    @JsonProperty(value = "deploymentParameters")
    private ApiDeploymentParameterMetadataSet deploymentParameters;

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

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

    /**
     * Set the source property: The source.
     *
     * @param source the source value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withSource(String source) {
        this.source = source;
        return this;
    }

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

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

    /**
     * Get the hideKey property: The hide key.
     *
     * @return the hideKey value.
     */
    public String hideKey() {
        return this.hideKey;
    }

    /**
     * Set the hideKey property: The hide key.
     *
     * @param hideKey the hideKey value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withHideKey(String hideKey) {
        this.hideKey = hideKey;
        return this;
    }

    /**
     * Get the tags property: The tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The tags.
     *
     * @param tags the tags value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the apiType property: The api type.
     *
     * @return the apiType value.
     */
    public ApiType apiType() {
        return this.apiType;
    }

    /**
     * Set the apiType property: The api type.
     *
     * @param apiType the apiType value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withApiType(ApiType apiType) {
        this.apiType = apiType;
        return this;
    }

    /**
     * Get the wsdlService property: The WSDL service.
     *
     * @return the wsdlService value.
     */
    public WsdlService wsdlService() {
        return this.wsdlService;
    }

    /**
     * Set the wsdlService property: The WSDL service.
     *
     * @param wsdlService the wsdlService value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withWsdlService(WsdlService wsdlService) {
        this.wsdlService = wsdlService;
        return this;
    }

    /**
     * Get the wsdlImportMethod property: The WSDL import method.
     *
     * @return the wsdlImportMethod value.
     */
    public WsdlImportMethod wsdlImportMethod() {
        return this.wsdlImportMethod;
    }

    /**
     * Set the wsdlImportMethod property: The WSDL import method.
     *
     * @param wsdlImportMethod the wsdlImportMethod value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withWsdlImportMethod(WsdlImportMethod wsdlImportMethod) {
        this.wsdlImportMethod = wsdlImportMethod;
        return this;
    }

    /**
     * Get the connectionType property: The connection type.
     *
     * @return the connectionType value.
     */
    public String connectionType() {
        return this.connectionType;
    }

    /**
     * Set the connectionType property: The connection type.
     *
     * @param connectionType the connectionType value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withConnectionType(String connectionType) {
        this.connectionType = connectionType;
        return this;
    }

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

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

    /**
     * Get the deploymentParameters property: The connector deployment parameters metadata.
     *
     * @return the deploymentParameters value.
     */
    public ApiDeploymentParameterMetadataSet deploymentParameters() {
        return this.deploymentParameters;
    }

    /**
     * Set the deploymentParameters property: The connector deployment parameters metadata.
     *
     * @param deploymentParameters the deploymentParameters value to set.
     * @return the ApiResourceMetadata object itself.
     */
    public ApiResourceMetadata withDeploymentParameters(ApiDeploymentParameterMetadataSet deploymentParameters) {
        this.deploymentParameters = deploymentParameters;
        return this;
    }

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