// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceExternalReference;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceGranularMarkingModel;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceKillChainPhase;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceParsedPattern;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Describes threat intelligence entity properties. */
@Fluent
public final class ThreatIntelligenceIndicatorProperties extends EntityCommonProperties {
    /*
     * List of tags
     */
    @JsonProperty(value = "threatIntelligenceTags")
    private List<String> threatIntelligenceTags;

    /*
     * Last updated time in UTC
     */
    @JsonProperty(value = "lastUpdatedTimeUtc")
    private String lastUpdatedTimeUtc;

    /*
     * Source of a threat intelligence entity
     */
    @JsonProperty(value = "source")
    private String source;

    /*
     * Display name of a threat intelligence entity
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * Description of a threat intelligence entity
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * Indicator types of threat intelligence entities
     */
    @JsonProperty(value = "indicatorTypes")
    private List<String> indicatorTypes;

    /*
     * Pattern of a threat intelligence entity
     */
    @JsonProperty(value = "pattern")
    private String pattern;

    /*
     * Pattern type of a threat intelligence entity
     */
    @JsonProperty(value = "patternType")
    private String patternType;

    /*
     * Pattern version of a threat intelligence entity
     */
    @JsonProperty(value = "patternVersion")
    private String patternVersion;

    /*
     * Kill chain phases
     */
    @JsonProperty(value = "killChainPhases")
    private List<ThreatIntelligenceKillChainPhase> killChainPhases;

    /*
     * Parsed patterns
     */
    @JsonProperty(value = "parsedPattern")
    private List<ThreatIntelligenceParsedPattern> parsedPattern;

    /*
     * External ID of threat intelligence entity
     */
    @JsonProperty(value = "externalId")
    private String externalId;

    /*
     * Created by reference of threat intelligence entity
     */
    @JsonProperty(value = "createdByRef")
    private String createdByRef;

    /*
     * Is threat intelligence entity defanged
     */
    @JsonProperty(value = "defanged")
    private Boolean defanged;

    /*
     * External last updated time in UTC
     */
    @JsonProperty(value = "externalLastUpdatedTimeUtc")
    private String externalLastUpdatedTimeUtc;

    /*
     * External References
     */
    @JsonProperty(value = "externalReferences")
    private List<ThreatIntelligenceExternalReference> externalReferences;

    /*
     * Granular Markings
     */
    @JsonProperty(value = "granularMarkings")
    private List<ThreatIntelligenceGranularMarkingModel> granularMarkings;

    /*
     * Labels  of threat intelligence entity
     */
    @JsonProperty(value = "labels")
    private List<String> labels;

    /*
     * Is threat intelligence entity revoked
     */
    @JsonProperty(value = "revoked")
    private Boolean revoked;

    /*
     * Confidence of threat intelligence entity
     */
    @JsonProperty(value = "confidence")
    private Integer confidence;

    /*
     * Threat intelligence entity object marking references
     */
    @JsonProperty(value = "objectMarkingRefs")
    private List<String> objectMarkingRefs;

    /*
     * Language of threat intelligence entity
     */
    @JsonProperty(value = "language")
    private String language;

    /*
     * Threat types
     */
    @JsonProperty(value = "threatTypes")
    private List<String> threatTypes;

    /*
     * Valid from
     */
    @JsonProperty(value = "validFrom")
    private String validFrom;

    /*
     * Valid until
     */
    @JsonProperty(value = "validUntil")
    private String validUntil;

    /*
     * Created by
     */
    @JsonProperty(value = "created")
    private String created;

    /*
     * Modified by
     */
    @JsonProperty(value = "modified")
    private String modified;

    /*
     * Extensions map
     */
    @JsonProperty(value = "extensions")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, Object> extensions;

    /**
     * Get the threatIntelligenceTags property: List of tags.
     *
     * @return the threatIntelligenceTags value.
     */
    public List<String> threatIntelligenceTags() {
        return this.threatIntelligenceTags;
    }

    /**
     * Set the threatIntelligenceTags property: List of tags.
     *
     * @param threatIntelligenceTags the threatIntelligenceTags value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withThreatIntelligenceTags(List<String> threatIntelligenceTags) {
        this.threatIntelligenceTags = threatIntelligenceTags;
        return this;
    }

    /**
     * Get the lastUpdatedTimeUtc property: Last updated time in UTC.
     *
     * @return the lastUpdatedTimeUtc value.
     */
    public String lastUpdatedTimeUtc() {
        return this.lastUpdatedTimeUtc;
    }

    /**
     * Set the lastUpdatedTimeUtc property: Last updated time in UTC.
     *
     * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withLastUpdatedTimeUtc(String lastUpdatedTimeUtc) {
        this.lastUpdatedTimeUtc = lastUpdatedTimeUtc;
        return this;
    }

    /**
     * Get the source property: Source of a threat intelligence entity.
     *
     * @return the source value.
     */
    public String source() {
        return this.source;
    }

    /**
     * Set the source property: Source of a threat intelligence entity.
     *
     * @param source the source value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withSource(String source) {
        this.source = source;
        return this;
    }

    /**
     * Get the displayName property: Display name of a threat intelligence entity.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: Display name of a threat intelligence entity.
     *
     * @param displayName the displayName value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the description property: Description of a threat intelligence entity.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: Description of a threat intelligence entity.
     *
     * @param description the description value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the indicatorTypes property: Indicator types of threat intelligence entities.
     *
     * @return the indicatorTypes value.
     */
    public List<String> indicatorTypes() {
        return this.indicatorTypes;
    }

    /**
     * Set the indicatorTypes property: Indicator types of threat intelligence entities.
     *
     * @param indicatorTypes the indicatorTypes value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withIndicatorTypes(List<String> indicatorTypes) {
        this.indicatorTypes = indicatorTypes;
        return this;
    }

    /**
     * Get the pattern property: Pattern of a threat intelligence entity.
     *
     * @return the pattern value.
     */
    public String pattern() {
        return this.pattern;
    }

    /**
     * Set the pattern property: Pattern of a threat intelligence entity.
     *
     * @param pattern the pattern value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withPattern(String pattern) {
        this.pattern = pattern;
        return this;
    }

    /**
     * Get the patternType property: Pattern type of a threat intelligence entity.
     *
     * @return the patternType value.
     */
    public String patternType() {
        return this.patternType;
    }

    /**
     * Set the patternType property: Pattern type of a threat intelligence entity.
     *
     * @param patternType the patternType value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withPatternType(String patternType) {
        this.patternType = patternType;
        return this;
    }

    /**
     * Get the patternVersion property: Pattern version of a threat intelligence entity.
     *
     * @return the patternVersion value.
     */
    public String patternVersion() {
        return this.patternVersion;
    }

    /**
     * Set the patternVersion property: Pattern version of a threat intelligence entity.
     *
     * @param patternVersion the patternVersion value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withPatternVersion(String patternVersion) {
        this.patternVersion = patternVersion;
        return this;
    }

    /**
     * Get the killChainPhases property: Kill chain phases.
     *
     * @return the killChainPhases value.
     */
    public List<ThreatIntelligenceKillChainPhase> killChainPhases() {
        return this.killChainPhases;
    }

    /**
     * Set the killChainPhases property: Kill chain phases.
     *
     * @param killChainPhases the killChainPhases value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withKillChainPhases(
        List<ThreatIntelligenceKillChainPhase> killChainPhases) {
        this.killChainPhases = killChainPhases;
        return this;
    }

    /**
     * Get the parsedPattern property: Parsed patterns.
     *
     * @return the parsedPattern value.
     */
    public List<ThreatIntelligenceParsedPattern> parsedPattern() {
        return this.parsedPattern;
    }

    /**
     * Set the parsedPattern property: Parsed patterns.
     *
     * @param parsedPattern the parsedPattern value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withParsedPattern(
        List<ThreatIntelligenceParsedPattern> parsedPattern) {
        this.parsedPattern = parsedPattern;
        return this;
    }

    /**
     * Get the externalId property: External ID of threat intelligence entity.
     *
     * @return the externalId value.
     */
    public String externalId() {
        return this.externalId;
    }

    /**
     * Set the externalId property: External ID of threat intelligence entity.
     *
     * @param externalId the externalId value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withExternalId(String externalId) {
        this.externalId = externalId;
        return this;
    }

    /**
     * Get the createdByRef property: Created by reference of threat intelligence entity.
     *
     * @return the createdByRef value.
     */
    public String createdByRef() {
        return this.createdByRef;
    }

    /**
     * Set the createdByRef property: Created by reference of threat intelligence entity.
     *
     * @param createdByRef the createdByRef value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withCreatedByRef(String createdByRef) {
        this.createdByRef = createdByRef;
        return this;
    }

    /**
     * Get the defanged property: Is threat intelligence entity defanged.
     *
     * @return the defanged value.
     */
    public Boolean defanged() {
        return this.defanged;
    }

    /**
     * Set the defanged property: Is threat intelligence entity defanged.
     *
     * @param defanged the defanged value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withDefanged(Boolean defanged) {
        this.defanged = defanged;
        return this;
    }

    /**
     * Get the externalLastUpdatedTimeUtc property: External last updated time in UTC.
     *
     * @return the externalLastUpdatedTimeUtc value.
     */
    public String externalLastUpdatedTimeUtc() {
        return this.externalLastUpdatedTimeUtc;
    }

    /**
     * Set the externalLastUpdatedTimeUtc property: External last updated time in UTC.
     *
     * @param externalLastUpdatedTimeUtc the externalLastUpdatedTimeUtc value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withExternalLastUpdatedTimeUtc(String externalLastUpdatedTimeUtc) {
        this.externalLastUpdatedTimeUtc = externalLastUpdatedTimeUtc;
        return this;
    }

    /**
     * Get the externalReferences property: External References.
     *
     * @return the externalReferences value.
     */
    public List<ThreatIntelligenceExternalReference> externalReferences() {
        return this.externalReferences;
    }

    /**
     * Set the externalReferences property: External References.
     *
     * @param externalReferences the externalReferences value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withExternalReferences(
        List<ThreatIntelligenceExternalReference> externalReferences) {
        this.externalReferences = externalReferences;
        return this;
    }

    /**
     * Get the granularMarkings property: Granular Markings.
     *
     * @return the granularMarkings value.
     */
    public List<ThreatIntelligenceGranularMarkingModel> granularMarkings() {
        return this.granularMarkings;
    }

    /**
     * Set the granularMarkings property: Granular Markings.
     *
     * @param granularMarkings the granularMarkings value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withGranularMarkings(
        List<ThreatIntelligenceGranularMarkingModel> granularMarkings) {
        this.granularMarkings = granularMarkings;
        return this;
    }

    /**
     * Get the labels property: Labels of threat intelligence entity.
     *
     * @return the labels value.
     */
    public List<String> labels() {
        return this.labels;
    }

    /**
     * Set the labels property: Labels of threat intelligence entity.
     *
     * @param labels the labels value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withLabels(List<String> labels) {
        this.labels = labels;
        return this;
    }

    /**
     * Get the revoked property: Is threat intelligence entity revoked.
     *
     * @return the revoked value.
     */
    public Boolean revoked() {
        return this.revoked;
    }

    /**
     * Set the revoked property: Is threat intelligence entity revoked.
     *
     * @param revoked the revoked value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withRevoked(Boolean revoked) {
        this.revoked = revoked;
        return this;
    }

    /**
     * Get the confidence property: Confidence of threat intelligence entity.
     *
     * @return the confidence value.
     */
    public Integer confidence() {
        return this.confidence;
    }

    /**
     * Set the confidence property: Confidence of threat intelligence entity.
     *
     * @param confidence the confidence value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withConfidence(Integer confidence) {
        this.confidence = confidence;
        return this;
    }

    /**
     * Get the objectMarkingRefs property: Threat intelligence entity object marking references.
     *
     * @return the objectMarkingRefs value.
     */
    public List<String> objectMarkingRefs() {
        return this.objectMarkingRefs;
    }

    /**
     * Set the objectMarkingRefs property: Threat intelligence entity object marking references.
     *
     * @param objectMarkingRefs the objectMarkingRefs value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withObjectMarkingRefs(List<String> objectMarkingRefs) {
        this.objectMarkingRefs = objectMarkingRefs;
        return this;
    }

    /**
     * Get the language property: Language of threat intelligence entity.
     *
     * @return the language value.
     */
    public String language() {
        return this.language;
    }

    /**
     * Set the language property: Language of threat intelligence entity.
     *
     * @param language the language value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withLanguage(String language) {
        this.language = language;
        return this;
    }

    /**
     * Get the threatTypes property: Threat types.
     *
     * @return the threatTypes value.
     */
    public List<String> threatTypes() {
        return this.threatTypes;
    }

    /**
     * Set the threatTypes property: Threat types.
     *
     * @param threatTypes the threatTypes value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withThreatTypes(List<String> threatTypes) {
        this.threatTypes = threatTypes;
        return this;
    }

    /**
     * Get the validFrom property: Valid from.
     *
     * @return the validFrom value.
     */
    public String validFrom() {
        return this.validFrom;
    }

    /**
     * Set the validFrom property: Valid from.
     *
     * @param validFrom the validFrom value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withValidFrom(String validFrom) {
        this.validFrom = validFrom;
        return this;
    }

    /**
     * Get the validUntil property: Valid until.
     *
     * @return the validUntil value.
     */
    public String validUntil() {
        return this.validUntil;
    }

    /**
     * Set the validUntil property: Valid until.
     *
     * @param validUntil the validUntil value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withValidUntil(String validUntil) {
        this.validUntil = validUntil;
        return this;
    }

    /**
     * Get the created property: Created by.
     *
     * @return the created value.
     */
    public String created() {
        return this.created;
    }

    /**
     * Set the created property: Created by.
     *
     * @param created the created value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withCreated(String created) {
        this.created = created;
        return this;
    }

    /**
     * Get the modified property: Modified by.
     *
     * @return the modified value.
     */
    public String modified() {
        return this.modified;
    }

    /**
     * Set the modified property: Modified by.
     *
     * @param modified the modified value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withModified(String modified) {
        this.modified = modified;
        return this;
    }

    /**
     * Get the extensions property: Extensions map.
     *
     * @return the extensions value.
     */
    public Map<String, Object> extensions() {
        return this.extensions;
    }

    /**
     * Set the extensions property: Extensions map.
     *
     * @param extensions the extensions value to set.
     * @return the ThreatIntelligenceIndicatorProperties object itself.
     */
    public ThreatIntelligenceIndicatorProperties withExtensions(Map<String, Object> extensions) {
        this.extensions = extensions;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (killChainPhases() != null) {
            killChainPhases().forEach(e -> e.validate());
        }
        if (parsedPattern() != null) {
            parsedPattern().forEach(e -> e.validate());
        }
        if (externalReferences() != null) {
            externalReferences().forEach(e -> e.validate());
        }
        if (granularMarkings() != null) {
            granularMarkings().forEach(e -> e.validate());
        }
    }
}
