"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright 2021 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import google.protobuf.struct_pb2
import google.protobuf.timestamp_pb2
import sys
import typing

if sys.version_info >= (3, 10):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing.final
class Commit(google.protobuf.message.Message):
    """Commit reference.

    In some rare cases, this may refer to a small range of commits rather than an
    exact commit (to accomodate for automated systems). In such cases, the
    semantics are as follows:

    - If this is referring to a commit which introduces a vulnerability, then
    *any* commits in the range is assumed to cause the vulnerability.

    - If this is referring to a commit which fixes a vulnerability, then *all*
    commits in the range is assumed to cause the vulnerability.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _RepoType:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _RepoTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Commit._RepoType.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        UNSPECIFIED: Commit._RepoType.ValueType  # 0
        GIT: Commit._RepoType.ValueType  # 1

    class RepoType(_RepoType, metaclass=_RepoTypeEnumTypeWrapper):
        """The repository type."""

    UNSPECIFIED: Commit.RepoType.ValueType  # 0
    GIT: Commit.RepoType.ValueType  # 1

    REPO_TYPE_FIELD_NUMBER: builtins.int
    REPO_URL_FIELD_NUMBER: builtins.int
    COMMIT_FIELD_NUMBER: builtins.int
    repo_type: global___Commit.RepoType.ValueType
    """Required. The type of the repo."""
    repo_url: builtins.str
    """Required. The publicly accessible URL of the repo that can be directly
    passed to clone commands.
    """
    commit: builtins.str
    """Required. The commit identifier (e.g. git SHA). In some cases where the
    exact commit fails to be determined by automation, this may be a small
    range in the form "A:B" which means the commit range from A (exclusive) to
    B (inclusive).
    """
    def __init__(
        self,
        *,
        repo_type: global___Commit.RepoType.ValueType = ...,
        repo_url: builtins.str = ...,
        commit: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["commit", b"commit", "repo_type", b"repo_type", "repo_url", b"repo_url"]) -> None: ...

global___Commit = Commit

@typing.final
class Package(google.protobuf.message.Message):
    """Package information and version."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    NAME_FIELD_NUMBER: builtins.int
    ECOSYSTEM_FIELD_NUMBER: builtins.int
    PURL_FIELD_NUMBER: builtins.int
    name: builtins.str
    """Required. Name of the package. Should match the name used in the package
    ecosystem (e.g. the npm package name). For C/C++ projects integrated in
    OSS-Fuzz, this is the name used for the integration.
    """
    ecosystem: builtins.str
    """Required. The ecosystem for this package. 
    For the complete list of valid ecosystem names, see
    <https://ossf.github.io/osv-schema/#affectedpackage-field>.
    """
    purl: builtins.str
    """Optional. The package URL for this package."""
    def __init__(
        self,
        *,
        name: builtins.str = ...,
        ecosystem: builtins.str = ...,
        purl: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["ecosystem", b"ecosystem", "name", b"name", "purl", b"purl"]) -> None: ...

global___Package = Package

@typing.final
class Event(google.protobuf.message.Message):
    """Version events."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    INTRODUCED_FIELD_NUMBER: builtins.int
    FIXED_FIELD_NUMBER: builtins.int
    LIMIT_FIELD_NUMBER: builtins.int
    LAST_AFFECTED_FIELD_NUMBER: builtins.int
    introduced: builtins.str
    """The earliest version/commit where this vulnerability
    was introduced in.
    """
    fixed: builtins.str
    """The version/commit that this vulnerability was fixed in."""
    limit: builtins.str
    """The limit to apply to the range."""
    last_affected: builtins.str
    """The last affected version."""
    def __init__(
        self,
        *,
        introduced: builtins.str = ...,
        fixed: builtins.str = ...,
        limit: builtins.str = ...,
        last_affected: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["fixed", b"fixed", "introduced", b"introduced", "last_affected", b"last_affected", "limit", b"limit"]) -> None: ...

global___Event = Event

@typing.final
class Range(google.protobuf.message.Message):
    """Affected ranges."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _Type:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Range._Type.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        UNSPECIFIED: Range._Type.ValueType  # 0
        GIT: Range._Type.ValueType  # 1
        SEMVER: Range._Type.ValueType  # 2
        ECOSYSTEM: Range._Type.ValueType  # 3

    class Type(_Type, metaclass=_TypeEnumTypeWrapper):
        """Type of the version information."""

    UNSPECIFIED: Range.Type.ValueType  # 0
    GIT: Range.Type.ValueType  # 1
    SEMVER: Range.Type.ValueType  # 2
    ECOSYSTEM: Range.Type.ValueType  # 3

    TYPE_FIELD_NUMBER: builtins.int
    REPO_FIELD_NUMBER: builtins.int
    EVENTS_FIELD_NUMBER: builtins.int
    type: global___Range.Type.ValueType
    """Required. The type of version information."""
    repo: builtins.str
    """Required if type is GIT. The publicly accessible URL of the repo that can
    be directly passed to clone commands.
    """
    @property
    def events(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Event]:
        """Required. Version event information."""

    def __init__(
        self,
        *,
        type: global___Range.Type.ValueType = ...,
        repo: builtins.str = ...,
        events: collections.abc.Iterable[global___Event] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["events", b"events", "repo", b"repo", "type", b"type"]) -> None: ...

global___Range = Range

@typing.final
class Affected(google.protobuf.message.Message):
    """Affected versions and commits."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    PACKAGE_FIELD_NUMBER: builtins.int
    RANGES_FIELD_NUMBER: builtins.int
    VERSIONS_FIELD_NUMBER: builtins.int
    ECOSYSTEM_SPECIFIC_FIELD_NUMBER: builtins.int
    DATABASE_SPECIFIC_FIELD_NUMBER: builtins.int
    SEVERITY_FIELD_NUMBER: builtins.int
    @property
    def package(self) -> global___Package:
        """Optional. Package information."""

    @property
    def ranges(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Range]:
        """Required. Range information."""

    @property
    def versions(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Optional. List of affected versions."""

    @property
    def ecosystem_specific(self) -> google.protobuf.struct_pb2.Struct:
        """Optional. JSON object holding additional information about the
        vulnerability as defined by the ecosystem for which the record applies.
        """

    @property
    def database_specific(self) -> google.protobuf.struct_pb2.Struct:
        """Optional. JSON object holding additional information about the
        vulnerability as defined by the database for which the record applies.
        """

    @property
    def severity(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Severity]:
        """Optional. Severity of the vulnerability for this package."""

    def __init__(
        self,
        *,
        package: global___Package | None = ...,
        ranges: collections.abc.Iterable[global___Range] | None = ...,
        versions: collections.abc.Iterable[builtins.str] | None = ...,
        ecosystem_specific: google.protobuf.struct_pb2.Struct | None = ...,
        database_specific: google.protobuf.struct_pb2.Struct | None = ...,
        severity: collections.abc.Iterable[global___Severity] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["database_specific", b"database_specific", "ecosystem_specific", b"ecosystem_specific", "package", b"package"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["database_specific", b"database_specific", "ecosystem_specific", b"ecosystem_specific", "package", b"package", "ranges", b"ranges", "severity", b"severity", "versions", b"versions"]) -> None: ...

global___Affected = Affected

@typing.final
class Severity(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _Type:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Severity._Type.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        UNSPECIFIED: Severity._Type.ValueType  # 0
        CVSS_V3: Severity._Type.ValueType  # 1
        CVSS_V2: Severity._Type.ValueType  # 2
        CVSS_V4: Severity._Type.ValueType  # 3
        Ubuntu: Severity._Type.ValueType  # 4

    class Type(_Type, metaclass=_TypeEnumTypeWrapper):
        """Type of the severity."""

    UNSPECIFIED: Severity.Type.ValueType  # 0
    CVSS_V3: Severity.Type.ValueType  # 1
    CVSS_V2: Severity.Type.ValueType  # 2
    CVSS_V4: Severity.Type.ValueType  # 3
    Ubuntu: Severity.Type.ValueType  # 4

    TYPE_FIELD_NUMBER: builtins.int
    SCORE_FIELD_NUMBER: builtins.int
    type: global___Severity.Type.ValueType
    """The type of this severity entry."""
    score: builtins.str
    """The quantitative score."""
    def __init__(
        self,
        *,
        type: global___Severity.Type.ValueType = ...,
        score: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["score", b"score", "type", b"type"]) -> None: ...

global___Severity = Severity

@typing.final
class Credit(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _Type:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Credit._Type.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        UNSPECIFIED: Credit._Type.ValueType  # 0
        OTHER: Credit._Type.ValueType  # 1
        FINDER: Credit._Type.ValueType  # 2
        REPORTER: Credit._Type.ValueType  # 3
        ANALYST: Credit._Type.ValueType  # 4
        COORDINATOR: Credit._Type.ValueType  # 5
        REMEDIATION_DEVELOPER: Credit._Type.ValueType  # 6
        REMEDIATION_REVIEWER: Credit._Type.ValueType  # 7
        REMEDIATION_VERIFIER: Credit._Type.ValueType  # 8
        TOOL: Credit._Type.ValueType  # 9
        SPONSOR: Credit._Type.ValueType  # 10

    class Type(_Type, metaclass=_TypeEnumTypeWrapper): ...
    UNSPECIFIED: Credit.Type.ValueType  # 0
    OTHER: Credit.Type.ValueType  # 1
    FINDER: Credit.Type.ValueType  # 2
    REPORTER: Credit.Type.ValueType  # 3
    ANALYST: Credit.Type.ValueType  # 4
    COORDINATOR: Credit.Type.ValueType  # 5
    REMEDIATION_DEVELOPER: Credit.Type.ValueType  # 6
    REMEDIATION_REVIEWER: Credit.Type.ValueType  # 7
    REMEDIATION_VERIFIER: Credit.Type.ValueType  # 8
    TOOL: Credit.Type.ValueType  # 9
    SPONSOR: Credit.Type.ValueType  # 10

    NAME_FIELD_NUMBER: builtins.int
    CONTACT_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    name: builtins.str
    """The name to give credit to."""
    type: global___Credit.Type.ValueType
    """Optional. The type or role of the individual or entity being credited."""
    @property
    def contact(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Contact methods (URLs)."""

    def __init__(
        self,
        *,
        name: builtins.str = ...,
        contact: collections.abc.Iterable[builtins.str] | None = ...,
        type: global___Credit.Type.ValueType = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["contact", b"contact", "name", b"name", "type", b"type"]) -> None: ...

global___Credit = Credit

@typing.final
class Reference(google.protobuf.message.Message):
    """Reference URL."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _Type:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Reference._Type.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        NONE: Reference._Type.ValueType  # 0
        """Next ID = 12."""
        ADVISORY: Reference._Type.ValueType  # 2
        ARTICLE: Reference._Type.ValueType  # 6
        DETECTION: Reference._Type.ValueType  # 9
        DISCUSSION: Reference._Type.ValueType  # 8
        EVIDENCE: Reference._Type.ValueType  # 7
        FIX: Reference._Type.ValueType  # 4
        GIT: Reference._Type.ValueType  # 11
        INTRODUCED: Reference._Type.ValueType  # 10
        PACKAGE: Reference._Type.ValueType  # 5
        REPORT: Reference._Type.ValueType  # 3
        WEB: Reference._Type.ValueType  # 1

    class Type(_Type, metaclass=_TypeEnumTypeWrapper): ...
    NONE: Reference.Type.ValueType  # 0
    """Next ID = 12."""
    ADVISORY: Reference.Type.ValueType  # 2
    ARTICLE: Reference.Type.ValueType  # 6
    DETECTION: Reference.Type.ValueType  # 9
    DISCUSSION: Reference.Type.ValueType  # 8
    EVIDENCE: Reference.Type.ValueType  # 7
    FIX: Reference.Type.ValueType  # 4
    GIT: Reference.Type.ValueType  # 11
    INTRODUCED: Reference.Type.ValueType  # 10
    PACKAGE: Reference.Type.ValueType  # 5
    REPORT: Reference.Type.ValueType  # 3
    WEB: Reference.Type.ValueType  # 1

    TYPE_FIELD_NUMBER: builtins.int
    URL_FIELD_NUMBER: builtins.int
    type: global___Reference.Type.ValueType
    """Required. The type of the reference."""
    url: builtins.str
    """Required. The URL."""
    def __init__(
        self,
        *,
        type: global___Reference.Type.ValueType = ...,
        url: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["type", b"type", "url", b"url"]) -> None: ...

global___Reference = Reference

@typing.final
class Vulnerability(google.protobuf.message.Message):
    """A vulnerability entry.
    The protobuf representation is *NOT* stable and only used for implementing
    the JSON based API.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SCHEMA_VERSION_FIELD_NUMBER: builtins.int
    ID_FIELD_NUMBER: builtins.int
    PUBLISHED_FIELD_NUMBER: builtins.int
    MODIFIED_FIELD_NUMBER: builtins.int
    WITHDRAWN_FIELD_NUMBER: builtins.int
    ALIASES_FIELD_NUMBER: builtins.int
    RELATED_FIELD_NUMBER: builtins.int
    UPSTREAM_FIELD_NUMBER: builtins.int
    SUMMARY_FIELD_NUMBER: builtins.int
    DETAILS_FIELD_NUMBER: builtins.int
    AFFECTED_FIELD_NUMBER: builtins.int
    REFERENCES_FIELD_NUMBER: builtins.int
    DATABASE_SPECIFIC_FIELD_NUMBER: builtins.int
    SEVERITY_FIELD_NUMBER: builtins.int
    CREDITS_FIELD_NUMBER: builtins.int
    schema_version: builtins.str
    """The OSV schema version."""
    id: builtins.str
    """The `id` field is a unique identifier for the vulnerability entry. It is a
    string of the format `<DB>-<ENTRYID>`, where `DB` names the database and
    `ENTRYID` is in the format used by the database. For example:
    “OSV-2020-111”, “CVE-2021-3114”, or “GHSA-vp9c-fpxx-744v”.
    """
    summary: builtins.str
    """Required. One line human readable summary for the vulnerability. It is
    recommended to keep this under 120 characters.
    """
    details: builtins.str
    """Required. Any additional human readable details for the vulnerability."""
    @property
    def published(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """The RFC3339 timestamp indicating when this entry was published."""

    @property
    def modified(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """The RFC3339 timestamp indicating when this entry was last modified."""

    @property
    def withdrawn(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """Optional. The RFC3339 timestamp indicating when this entry is considered to
        be withdrawn.
        """

    @property
    def aliases(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Optional. IDs for the same vulnerability in other databases."""

    @property
    def related(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Optional. List of IDs of closely related vulnerabilities, such as the same
        problem in alternate ecosystems.
        """

    @property
    def upstream(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Optional. List of IDs of upstream vulnerabilities of a vulnerability."""

    @property
    def affected(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Affected]:
        """Required. Affected commit ranges and versions."""

    @property
    def references(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Reference]:
        """Optional. URLs to more information/advisories (including the
        scheme e.g "https://").
        """

    @property
    def database_specific(self) -> google.protobuf.struct_pb2.Struct:
        """Optional. JSON object holding additional information about the
        vulnerability as defined by the database for which the record applies.
        """

    @property
    def severity(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Severity]:
        """Optional. Severity of the vulnerability."""

    @property
    def credits(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Credit]:
        """Optional. Credits for the vulnerability."""

    def __init__(
        self,
        *,
        schema_version: builtins.str = ...,
        id: builtins.str = ...,
        published: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        modified: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        withdrawn: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        aliases: collections.abc.Iterable[builtins.str] | None = ...,
        related: collections.abc.Iterable[builtins.str] | None = ...,
        upstream: collections.abc.Iterable[builtins.str] | None = ...,
        summary: builtins.str = ...,
        details: builtins.str = ...,
        affected: collections.abc.Iterable[global___Affected] | None = ...,
        references: collections.abc.Iterable[global___Reference] | None = ...,
        database_specific: google.protobuf.struct_pb2.Struct | None = ...,
        severity: collections.abc.Iterable[global___Severity] | None = ...,
        credits: collections.abc.Iterable[global___Credit] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["database_specific", b"database_specific", "modified", b"modified", "published", b"published", "withdrawn", b"withdrawn"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["affected", b"affected", "aliases", b"aliases", "credits", b"credits", "database_specific", b"database_specific", "details", b"details", "id", b"id", "modified", b"modified", "published", b"published", "references", b"references", "related", b"related", "schema_version", b"schema_version", "severity", b"severity", "summary", b"summary", "upstream", b"upstream", "withdrawn", b"withdrawn"]) -> None: ...

global___Vulnerability = Vulnerability
