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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner;
import com.azure.resourcemanager.securityinsights.fluent.models.IpEntityProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;
import java.util.Map;

/** Represents an ip entity. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("Ip")
@Fluent
public final class IpEntity extends EntityInner {
    /*
     * Ip entity properties
     */
    @JsonProperty(value = "properties")
    private IpEntityProperties innerProperties;

    /**
     * Get the innerProperties property: Ip entity properties.
     *
     * @return the innerProperties value.
     */
    private IpEntityProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the address property: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6).
     *
     * @return the address value.
     */
    public String address() {
        return this.innerProperties() == null ? null : this.innerProperties().address();
    }

    /**
     * Get the location property: The geo-location context attached to the ip entity.
     *
     * @return the location value.
     */
    public GeoLocation location() {
        return this.innerProperties() == null ? null : this.innerProperties().location();
    }

    /**
     * Get the threatIntelligence property: A list of TI contexts attached to the ip entity.
     *
     * @return the threatIntelligence value.
     */
    public List<ThreatIntelligence> threatIntelligence() {
        return this.innerProperties() == null ? null : this.innerProperties().threatIntelligence();
    }

    /**
     * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented
     * to the user.
     *
     * @return the additionalData value.
     */
    public Map<String, Object> additionalData() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalData();
    }

    /**
     * Get the friendlyName property: The graph item display name which is a short humanly readable description of the
     * graph item instance. This property is optional and might be system generated.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

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