require 'date'
require 'microsoft_kiota_abstractions'
require_relative '../microsoft_graph'
require_relative './models'

module MicrosoftGraph
    module Models
        class SecurityVulnerability < MicrosoftGraph::Models::Entity
            include MicrosoftKiotaAbstractions::Parsable
            ## 
            # Indicates whether this vulnerability has any known exploits associated to known bad actors.
            @active_exploits_observed
            ## 
            # Articles related to this vulnerability.
            @articles
            ## 
            # Community-defined common weakness enumerations (CWE).
            @common_weakness_enumeration_ids
            ## 
            # Components related to this vulnerability article.
            @components
            ## 
            # The date and time when this vulnerability article was first created.
            @created_date_time
            ## 
            # The cvss2Summary property
            @cvss2_summary
            ## 
            # The cvss3Summary property
            @cvss3_summary
            ## 
            # The description property
            @description
            ## 
            # Known exploits for this vulnerability.
            @exploits
            ## 
            # Indicates whether this vulnerability has exploits in public sources (such as Packetstorm or Exploit-DB) online.
            @exploits_available
            ## 
            # Indicates whether chatter about this vulnerability has been discovered online.
            @has_chatter
            ## 
            # The date and time when this vulnerability article was most recently updated.
            @last_modified_date_time
            ## 
            # A unique algorithm that reflects the priority of a vulnerability based on the CVSS score, exploits, chatter, and linkage to malware. This property also evaluates the recency of these components so users can understand which vulnerability should be remediated first.
            @priority_score
            ## 
            # The date and time when this vulnerability article was published.
            @published_date_time
            ## 
            # Reference links where further information can be learned about this vulnerability.
            @references
            ## 
            # Any known remediation steps.
            @remediation
            ## 
            # The severity property
            @severity
            ## 
            ## Gets the activeExploitsObserved property value. Indicates whether this vulnerability has any known exploits associated to known bad actors.
            ## @return a boolean
            ## 
            def active_exploits_observed
                return @active_exploits_observed
            end
            ## 
            ## Sets the activeExploitsObserved property value. Indicates whether this vulnerability has any known exploits associated to known bad actors.
            ## @param value Value to set for the activeExploitsObserved property.
            ## @return a void
            ## 
            def active_exploits_observed=(value)
                @active_exploits_observed = value
            end
            ## 
            ## Gets the articles property value. Articles related to this vulnerability.
            ## @return a security_article
            ## 
            def articles
                return @articles
            end
            ## 
            ## Sets the articles property value. Articles related to this vulnerability.
            ## @param value Value to set for the articles property.
            ## @return a void
            ## 
            def articles=(value)
                @articles = value
            end
            ## 
            ## Gets the commonWeaknessEnumerationIds property value. Community-defined common weakness enumerations (CWE).
            ## @return a string
            ## 
            def common_weakness_enumeration_ids
                return @common_weakness_enumeration_ids
            end
            ## 
            ## Sets the commonWeaknessEnumerationIds property value. Community-defined common weakness enumerations (CWE).
            ## @param value Value to set for the commonWeaknessEnumerationIds property.
            ## @return a void
            ## 
            def common_weakness_enumeration_ids=(value)
                @common_weakness_enumeration_ids = value
            end
            ## 
            ## Gets the components property value. Components related to this vulnerability article.
            ## @return a security_vulnerability_component
            ## 
            def components
                return @components
            end
            ## 
            ## Sets the components property value. Components related to this vulnerability article.
            ## @param value Value to set for the components property.
            ## @return a void
            ## 
            def components=(value)
                @components = value
            end
            ## 
            ## Instantiates a new securityVulnerability and sets the default values.
            ## @return a void
            ## 
            def initialize()
                super
            end
            ## 
            ## Gets the createdDateTime property value. The date and time when this vulnerability article was first created.
            ## @return a date_time
            ## 
            def created_date_time
                return @created_date_time
            end
            ## 
            ## Sets the createdDateTime property value. The date and time when this vulnerability article was first created.
            ## @param value Value to set for the createdDateTime property.
            ## @return a void
            ## 
            def created_date_time=(value)
                @created_date_time = value
            end
            ## 
            ## Creates a new instance of the appropriate class based on discriminator value
            ## @param parse_node The parse node to use to read the discriminator value and create the object
            ## @return a security_vulnerability
            ## 
            def self.create_from_discriminator_value(parse_node)
                raise StandardError, 'parse_node cannot be null' if parse_node.nil?
                return SecurityVulnerability.new
            end
            ## 
            ## Gets the cvss2Summary property value. The cvss2Summary property
            ## @return a security_cvss_summary
            ## 
            def cvss2_summary
                return @cvss2_summary
            end
            ## 
            ## Sets the cvss2Summary property value. The cvss2Summary property
            ## @param value Value to set for the cvss2Summary property.
            ## @return a void
            ## 
            def cvss2_summary=(value)
                @cvss2_summary = value
            end
            ## 
            ## Gets the cvss3Summary property value. The cvss3Summary property
            ## @return a security_cvss_summary
            ## 
            def cvss3_summary
                return @cvss3_summary
            end
            ## 
            ## Sets the cvss3Summary property value. The cvss3Summary property
            ## @param value Value to set for the cvss3Summary property.
            ## @return a void
            ## 
            def cvss3_summary=(value)
                @cvss3_summary = value
            end
            ## 
            ## Gets the description property value. The description property
            ## @return a security_formatted_content
            ## 
            def description
                return @description
            end
            ## 
            ## Sets the description property value. The description property
            ## @param value Value to set for the description property.
            ## @return a void
            ## 
            def description=(value)
                @description = value
            end
            ## 
            ## Gets the exploits property value. Known exploits for this vulnerability.
            ## @return a security_hyperlink
            ## 
            def exploits
                return @exploits
            end
            ## 
            ## Sets the exploits property value. Known exploits for this vulnerability.
            ## @param value Value to set for the exploits property.
            ## @return a void
            ## 
            def exploits=(value)
                @exploits = value
            end
            ## 
            ## Gets the exploitsAvailable property value. Indicates whether this vulnerability has exploits in public sources (such as Packetstorm or Exploit-DB) online.
            ## @return a boolean
            ## 
            def exploits_available
                return @exploits_available
            end
            ## 
            ## Sets the exploitsAvailable property value. Indicates whether this vulnerability has exploits in public sources (such as Packetstorm or Exploit-DB) online.
            ## @param value Value to set for the exploitsAvailable property.
            ## @return a void
            ## 
            def exploits_available=(value)
                @exploits_available = value
            end
            ## 
            ## The deserialization information for the current model
            ## @return a i_dictionary
            ## 
            def get_field_deserializers()
                return super.merge({
                    "activeExploitsObserved" => lambda {|n| @active_exploits_observed = n.get_boolean_value() },
                    "articles" => lambda {|n| @articles = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityArticle.create_from_discriminator_value(pn) }) },
                    "commonWeaknessEnumerationIds" => lambda {|n| @common_weakness_enumeration_ids = n.get_collection_of_primitive_values(String) },
                    "components" => lambda {|n| @components = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityVulnerabilityComponent.create_from_discriminator_value(pn) }) },
                    "createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
                    "cvss2Summary" => lambda {|n| @cvss2_summary = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityCvssSummary.create_from_discriminator_value(pn) }) },
                    "cvss3Summary" => lambda {|n| @cvss3_summary = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityCvssSummary.create_from_discriminator_value(pn) }) },
                    "description" => lambda {|n| @description = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },
                    "exploits" => lambda {|n| @exploits = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityHyperlink.create_from_discriminator_value(pn) }) },
                    "exploitsAvailable" => lambda {|n| @exploits_available = n.get_boolean_value() },
                    "hasChatter" => lambda {|n| @has_chatter = n.get_boolean_value() },
                    "lastModifiedDateTime" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },
                    "priorityScore" => lambda {|n| @priority_score = n.get_number_value() },
                    "publishedDateTime" => lambda {|n| @published_date_time = n.get_date_time_value() },
                    "references" => lambda {|n| @references = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityHyperlink.create_from_discriminator_value(pn) }) },
                    "remediation" => lambda {|n| @remediation = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },
                    "severity" => lambda {|n| @severity = n.get_enum_value(MicrosoftGraph::Models::SecurityVulnerabilitySeverity) },
                })
            end
            ## 
            ## Gets the hasChatter property value. Indicates whether chatter about this vulnerability has been discovered online.
            ## @return a boolean
            ## 
            def has_chatter
                return @has_chatter
            end
            ## 
            ## Sets the hasChatter property value. Indicates whether chatter about this vulnerability has been discovered online.
            ## @param value Value to set for the hasChatter property.
            ## @return a void
            ## 
            def has_chatter=(value)
                @has_chatter = value
            end
            ## 
            ## Gets the lastModifiedDateTime property value. The date and time when this vulnerability article was most recently updated.
            ## @return a date_time
            ## 
            def last_modified_date_time
                return @last_modified_date_time
            end
            ## 
            ## Sets the lastModifiedDateTime property value. The date and time when this vulnerability article was most recently updated.
            ## @param value Value to set for the lastModifiedDateTime property.
            ## @return a void
            ## 
            def last_modified_date_time=(value)
                @last_modified_date_time = value
            end
            ## 
            ## Gets the priorityScore property value. A unique algorithm that reflects the priority of a vulnerability based on the CVSS score, exploits, chatter, and linkage to malware. This property also evaluates the recency of these components so users can understand which vulnerability should be remediated first.
            ## @return a integer
            ## 
            def priority_score
                return @priority_score
            end
            ## 
            ## Sets the priorityScore property value. A unique algorithm that reflects the priority of a vulnerability based on the CVSS score, exploits, chatter, and linkage to malware. This property also evaluates the recency of these components so users can understand which vulnerability should be remediated first.
            ## @param value Value to set for the priorityScore property.
            ## @return a void
            ## 
            def priority_score=(value)
                @priority_score = value
            end
            ## 
            ## Gets the publishedDateTime property value. The date and time when this vulnerability article was published.
            ## @return a date_time
            ## 
            def published_date_time
                return @published_date_time
            end
            ## 
            ## Sets the publishedDateTime property value. The date and time when this vulnerability article was published.
            ## @param value Value to set for the publishedDateTime property.
            ## @return a void
            ## 
            def published_date_time=(value)
                @published_date_time = value
            end
            ## 
            ## Gets the references property value. Reference links where further information can be learned about this vulnerability.
            ## @return a security_hyperlink
            ## 
            def references
                return @references
            end
            ## 
            ## Sets the references property value. Reference links where further information can be learned about this vulnerability.
            ## @param value Value to set for the references property.
            ## @return a void
            ## 
            def references=(value)
                @references = value
            end
            ## 
            ## Gets the remediation property value. Any known remediation steps.
            ## @return a security_formatted_content
            ## 
            def remediation
                return @remediation
            end
            ## 
            ## Sets the remediation property value. Any known remediation steps.
            ## @param value Value to set for the remediation property.
            ## @return a void
            ## 
            def remediation=(value)
                @remediation = value
            end
            ## 
            ## Serializes information the current object
            ## @param writer Serialization writer to use to serialize this model
            ## @return a void
            ## 
            def serialize(writer)
                raise StandardError, 'writer cannot be null' if writer.nil?
                super
                writer.write_boolean_value("activeExploitsObserved", @active_exploits_observed)
                writer.write_collection_of_object_values("articles", @articles)
                writer.write_collection_of_primitive_values("commonWeaknessEnumerationIds", @common_weakness_enumeration_ids)
                writer.write_collection_of_object_values("components", @components)
                writer.write_date_time_value("createdDateTime", @created_date_time)
                writer.write_object_value("cvss2Summary", @cvss2_summary)
                writer.write_object_value("cvss3Summary", @cvss3_summary)
                writer.write_object_value("description", @description)
                writer.write_collection_of_object_values("exploits", @exploits)
                writer.write_boolean_value("exploitsAvailable", @exploits_available)
                writer.write_boolean_value("hasChatter", @has_chatter)
                writer.write_date_time_value("lastModifiedDateTime", @last_modified_date_time)
                writer.write_number_value("priorityScore", @priority_score)
                writer.write_date_time_value("publishedDateTime", @published_date_time)
                writer.write_collection_of_object_values("references", @references)
                writer.write_object_value("remediation", @remediation)
                writer.write_enum_value("severity", @severity)
            end
            ## 
            ## Gets the severity property value. The severity property
            ## @return a security_vulnerability_severity
            ## 
            def severity
                return @severity
            end
            ## 
            ## Sets the severity property value. The severity property
            ## @param value Value to set for the severity property.
            ## @return a void
            ## 
            def severity=(value)
                @severity = value
            end
        end
    end
end
