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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.customerinsights.models.ConnectorStates;
import com.azure.resourcemanager.customerinsights.models.ConnectorTypes;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** The connector resource format. */
@Fluent
public final class ConnectorResourceFormatInner extends ProxyResource {
    /*
     * Properties of connector.
     */
    @JsonProperty(value = "properties")
    private Connector innerProperties;

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

    /**
     * Get the innerProperties property: Properties of connector.
     *
     * @return the innerProperties value.
     */
    private Connector innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the connectorId property: ID of the connector.
     *
     * @return the connectorId value.
     */
    public Integer connectorId() {
        return this.innerProperties() == null ? null : this.innerProperties().connectorId();
    }

    /**
     * Get the connectorName property: Name of the connector.
     *
     * @return the connectorName value.
     */
    public String connectorName() {
        return this.innerProperties() == null ? null : this.innerProperties().connectorName();
    }

    /**
     * Set the connectorName property: Name of the connector.
     *
     * @param connectorName the connectorName value to set.
     * @return the ConnectorResourceFormatInner object itself.
     */
    public ConnectorResourceFormatInner withConnectorName(String connectorName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Connector();
        }
        this.innerProperties().withConnectorName(connectorName);
        return this;
    }

    /**
     * Get the connectorType property: Type of connector.
     *
     * @return the connectorType value.
     */
    public ConnectorTypes connectorType() {
        return this.innerProperties() == null ? null : this.innerProperties().connectorType();
    }

    /**
     * Set the connectorType property: Type of connector.
     *
     * @param connectorType the connectorType value to set.
     * @return the ConnectorResourceFormatInner object itself.
     */
    public ConnectorResourceFormatInner withConnectorType(ConnectorTypes connectorType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Connector();
        }
        this.innerProperties().withConnectorType(connectorType);
        return this;
    }

    /**
     * Get the displayName property: Display name of the connector.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: Display name of the connector.
     *
     * @param displayName the displayName value to set.
     * @return the ConnectorResourceFormatInner object itself.
     */
    public ConnectorResourceFormatInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Connector();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the description property: Description of the connector.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Description of the connector.
     *
     * @param description the description value to set.
     * @return the ConnectorResourceFormatInner object itself.
     */
    public ConnectorResourceFormatInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Connector();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the connectorProperties property: The connector properties.
     *
     * @return the connectorProperties value.
     */
    public Map<String, Object> connectorProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().connectorProperties();
    }

    /**
     * Set the connectorProperties property: The connector properties.
     *
     * @param connectorProperties the connectorProperties value to set.
     * @return the ConnectorResourceFormatInner object itself.
     */
    public ConnectorResourceFormatInner withConnectorProperties(Map<String, Object> connectorProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Connector();
        }
        this.innerProperties().withConnectorProperties(connectorProperties);
        return this;
    }

    /**
     * Get the created property: The created time.
     *
     * @return the created value.
     */
    public OffsetDateTime created() {
        return this.innerProperties() == null ? null : this.innerProperties().created();
    }

    /**
     * Get the lastModified property: The last modified time.
     *
     * @return the lastModified value.
     */
    public OffsetDateTime lastModified() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModified();
    }

    /**
     * Get the state property: State of connector.
     *
     * @return the state value.
     */
    public ConnectorStates state() {
        return this.innerProperties() == null ? null : this.innerProperties().state();
    }

    /**
     * Get the tenantId property: The hub name.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Get the isInternal property: If this is an internal connector.
     *
     * @return the isInternal value.
     */
    public Boolean isInternal() {
        return this.innerProperties() == null ? null : this.innerProperties().isInternal();
    }

    /**
     * Set the isInternal property: If this is an internal connector.
     *
     * @param isInternal the isInternal value to set.
     * @return the ConnectorResourceFormatInner object itself.
     */
    public ConnectorResourceFormatInner withIsInternal(Boolean isInternal) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Connector();
        }
        this.innerProperties().withIsInternal(isInternal);
        return this;
    }

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