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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.security.models.CloudName;
import com.azure.resourcemanager.security.models.CloudOffering;
import com.azure.resourcemanager.security.models.EnvironmentData;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** The security connector resource. */
@Fluent
public final class SecurityConnectorInner extends Resource {
    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Security connector data
     */
    @JsonProperty(value = "properties")
    private SecurityConnectorProperties innerProperties;

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

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the innerProperties property: Security connector data.
     *
     * @return the innerProperties value.
     */
    private SecurityConnectorProperties innerProperties() {
        return this.innerProperties;
    }

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

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

    /**
     * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector,
     * project number in case of GCP connector).
     *
     * @return the hierarchyIdentifier value.
     */
    public String hierarchyIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifier();
    }

    /**
     * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector,
     * project number in case of GCP connector).
     *
     * @param hierarchyIdentifier the hierarchyIdentifier value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withHierarchyIdentifier(String hierarchyIdentifier) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withHierarchyIdentifier(hierarchyIdentifier);
        return this;
    }

    /**
     * Get the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable.
     * Trial period exists for 30 days after upgrading to payed offerings.
     *
     * @return the hierarchyIdentifierTrialEndDate value.
     */
    public OffsetDateTime hierarchyIdentifierTrialEndDate() {
        return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifierTrialEndDate();
    }

    /**
     * Get the environmentName property: The multi cloud resource's cloud name.
     *
     * @return the environmentName value.
     */
    public CloudName environmentName() {
        return this.innerProperties() == null ? null : this.innerProperties().environmentName();
    }

    /**
     * Set the environmentName property: The multi cloud resource's cloud name.
     *
     * @param environmentName the environmentName value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withEnvironmentName(CloudName environmentName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withEnvironmentName(environmentName);
        return this;
    }

    /**
     * Get the offerings property: A collection of offerings for the security connector.
     *
     * @return the offerings value.
     */
    public List<CloudOffering> offerings() {
        return this.innerProperties() == null ? null : this.innerProperties().offerings();
    }

    /**
     * Set the offerings property: A collection of offerings for the security connector.
     *
     * @param offerings the offerings value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withOfferings(List<CloudOffering> offerings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withOfferings(offerings);
        return this;
    }

    /**
     * Get the environmentData property: The security connector environment data.
     *
     * @return the environmentData value.
     */
    public EnvironmentData environmentData() {
        return this.innerProperties() == null ? null : this.innerProperties().environmentData();
    }

    /**
     * Set the environmentData property: The security connector environment data.
     *
     * @param environmentData the environmentData value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withEnvironmentData(EnvironmentData environmentData) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withEnvironmentData(environmentData);
        return this;
    }

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